Repository navigation
fix(vcs): skip GitHub resources whose installation has no owner instead of failing the webhook - #14119
Merged
Conversation
…er instead of failing the webhook
When GET /app/installations/{id} has no account.login, getOwnerName threw a plain Exception that createGitDeployments collected and turned into a 500 for the whole push, even though nothing can be built or reported for that installation. GitHub now throws a typed OwnerNotFound and the deployment loop skips that resource like the other skip reasons.
🟢 Tier S · Ready to mergeIntroduces a typed OwnerNotFound exception for GitHub installation owner lookup failures. Deployment processing catches it per linked resource, records a skip, and logs a warning instead of failing the webhook. An E2E test checks the exception for an unknown installation.
📂 Walkthrough · 4
Reviewed |
ghost
suggested changes
Oct 5, 2026
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Adapter::call() does not throw on HTTP errors, so a rate-limited or failed installation lookup also lacked account.login and was being skipped as if permanent. Only a 404 now raises OwnerNotFound; every other failure keeps failing the webhook so GitHub redelivers it. The regression test moves from a live GitHub E2E call to unit tests over a faked response.
…ix/vcs-push-owner-login
HarshMN2345
approved these changes
Oct 5, 2026
abnegate
added a commit
that referenced
this pull request
Oct 5, 2026
Merges main a2cca78 (#14009, #14106, #14117, #14115, #14119, #14114, #14101, #14125, #14129, #14127) so cloud#5410 can require a train head that contains main at or after 0ed7232. Conflicts: none. Database 8.0 port: none needed. Main's new code only uses Document getAttribute/setAttribute and Query::equal/lessThan/orderAsc/limit (Tasks/Interval.php), all unchanged in database 8.0; no removed Database::* constants, config collections, or model magic reads. composer.json and composer.lock are untouched by main, so the train's database and migration pins stay as they are. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
A GitHub push or pull-request webhook returns 500 when
GET /app/installations/{id}comes back withoutaccount.login.GitHub::getOwnerName()threw a plainException,createGitDeploymentscollected it as an error for that linked resource, and after the loop the whole event failed withgeneral_unknown. Without an owner, Appwrite can't post comments or commit statuses for that installation, and its token can't clone the repository either.packages/vcs:GitHub::getOwnerName()now throws a typedUtopia\VCS\Exception\OwnerNotFoundwhen GitHub answers 404 for the installation. It extends\Exception, so existing callers behave the same.Adapter::call()does not throw on HTTP errors, so the status is checked explicitly. A rate limit (403/429), a 5xx, or a 200 withoutaccount.loginstill throws the plainException, and the webhook still fails so GitHub redelivers it.createGitDeploymentscatchesOwnerNotFoundper repository and skips that resource. It recordsbuild.skipped/build.skipped.reason = owner not foundon the span and logs a warning, the same way it handles the existing skip reasons (resource not found, branch, path). The other linked resources in the push are unaffected and the webhook returns 200.The payload's
repository.owneris not used as a substitute owner. The external-contributor authorize flow passes the fork's owner (head.repo.owner.login) intocreateGitDeployments, so comments and statuses would go to the wrong repository.Sentry: CLOUD-29EK, CLOUD-35FH, CLOUD-3AM7 (
Owner name retrieval response is missing account login.).Test Plan
packages/vcs/tests/GitHubTest.phpfake the installation response by overridingcall(). A 404 throwsOwnerNotFound; 403, 429 and 502 throw an exception that is notOwnerNotFound; a 200 with a login returns it. The 404 case fails againstmain, and the transient cases fail against this PR's first commit, which treated every missing login asOwnerNotFound.composer lint, PHPStan and Rector on the changed files,bin/monorepo check vcs, and the vcs unit suite (125 tests).Related PRs and Issues
Checklist
Related: #14124