[Feat] Sync stored default branches from GitHub repository.edited webhooks#637
Merged
Merged
Conversation
GitHub sends repository.edited with a default_branch change entry when a repository's default branch moves. Update matching stored repository rows so metadata follows the change instead of going stale until a manual installation resync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
1 issue outstanding. See task
Reviewed a8864f6 |
Member
Author
|
Re the review finding about honoring 🤖 Generated with Claude Code |
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 changed
repository.editedGitHub webhook: when the delivery carries achanges.default_branchentry, update matching stored repository rows (sourceControlProvider = github, matched bygithubRepoId) to the new default branch. Edits that do not touch the default branch are acknowledged and ignored.repositoryevent, so existing installations receive these deliveries without any re-configuration.Why
Nothing currently refreshes
repositories.default_branchafter the initial installation sync, so a default-branch change on GitHub leaves the row stale until someone manually resyncs the installation. Stale defaults then feed implicit-branch checkouts and branch pickers. Complements #635 (worker-side resilience) and #636 (worker-side self-heal) by fixing the row at the source when webhook delivery is available.Validation
pnpm exec dotenvx run -f .env.test -- pnpm --filter @roomote/api exec vitest run src/handlers/github/__tests__/handleRepositoryEdited.test.ts(4 tests: update, non-default-branch edit, missing changes payload, zero-match reporting)pnpm --filter @roomote/api check-typespnpm lint🤖 Generated with Claude Code