feat(ci): name the docs sync branch after the exported commit - #490
Tim Beyer (TimBeyer) wants to merge 1 commit into
Conversation
The sync delivered to one fixed branch, force-pushed. That converged the release fan-out onto a single pull request, which is worth keeping, but it made the branch permanent while each delivery was not. contentful-docs sets deleteBranchOnMerge, so the branch was deleted on merge and recreated by the next sync under the same name. Worse, a release landing while an earlier sync was still open force-pushed over the commit a reviewer was reading, and that repository allows squash merges only, so there was no history to fall back on. Naming the branch after the exported commit keeps the convergence and drops both problems. Merging the grouped release pull request tags every component at one merge commit, so all of that moment's release events resolve to the same branch; a later release exports a different commit and gets its own branch, which is never rewritten and never outlives its own merge. Because each delivery now has a distinct branch, two sync pull requests could be open at once, and since a sync replaces the whole generated corpus they could only conflict with each other. Opening one now closes any older sync pull request and deletes its branch, which also retires the previous fixed branch on the first run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Impact Analysis by BitoCross-Repository Impact Analysis
Code Paths AnalyzedImpact: Flow: Direct Changes (Diff Files): Repository Impact: Cross-Repository Dependencies: Database/Caching Impact: API Contract Violations: Infrastructure Dependencies: Additional Insights: Testing RecommendationsFrontend Impact: Service Integration: Data Serialization: Privacy Compliance: Backward Compatibility: OAuth Functionality: Cross-Service Communication: Reliability Testing: Additional Insights: Analysis based on known dependency patterns and edges. Actual impact may vary. |
There was a problem hiding this comment.
Code Review Agent Run #b98f73
Actionable Suggestions - 1
-
.github/workflows/sync-fern-docs.yaml - 1
- Undefined `SYNC_BRANCH_PREFIX` may close unrelated PRs · Line 234-236
Additional Suggestions - 1
-
.github/workflows/sync-fern-docs.yaml - 1
-
Supersede loop pagination cap · Line 234-234The supersede loop uses `gh pr list --state open --limit 100` to find older sync PRs to close. If contentful-docs ever has more than 100 open PRs, older `sync/optimization-docs-*` PRs beyond the first 100 are missed, leaving stale branches that outlive their commit — the exact outcome this change is meant to prevent. Please paginate through all open PRs (or raise the limit to a value that reliably covers the repo's open-PR count) so the loop always finds every open sync PR.
-
Review Details
-
Files reviewed - 2 · Commit Range:
8eaf13c..8eaf13c- .github/workflows/sync-fern-docs.yaml
- docs/ADRs/0002-generate-the-public-documentation-site-content-from-this-repository.md
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers an incremental AI Review. -
/review full- Manually triggers a full AI Review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.
Documentation & Help
✅ Review Settings OverriddenStatus: Guidelines:
Note: Extra guidelines beyond 3 general purpose guidelines and 1 language specific guideline per language are not processed. Guidelines are fetched from the source branch. |
|
Regarding Bito’s additional “Supersede loop pagination cap” suggestion: the edge case is technically possible because |
Summary
The sync delivered to one fixed branch,
sync/optimization-docs, force-pushed on every run. That converged the release fan-out onto a single pull request — worth keeping — but it made the branch permanent while each delivery was not.Branch names now carry the exported commit:
sync/optimization-docs-<short-sha>.What the fixed branch actually cost
Two things, both verified rather than assumed:
contentful-docssetsdeleteBranchOnMerge=true. The branch was deleted on merge and recreated under the same name by the next sync. Not a forgotten branch — a resurrected one.Why the commit is the right key, and the tag is not
Merging the grouped release pull request tags every component at the same merge commit. Confirmed against the repository's own tags:
So keying on the commit gives exactly one identity per release moment, and all of that moment's release events converge on one branch and one pull request with no force-push race. Keying on the tag would have produced nine branches and nine pull requests for one release.
A later release exports a different commit and gets its own branch, which is never rewritten and never outlives its own merge. The remaining
--forcecovers only re-running the same commit.Superseding
Because each delivery now has a distinct branch, two sync pull requests could be open at once, and since a sync replaces the whole generated corpus they could only conflict with each other. Opening one closes any older sync pull request and deletes its branch, so an unreviewed sync is superseded rather than queued.
That also retires the old fixed branch on the first run, since
sync/optimization-docsmatches the prefix.Validation
Exercised the supersede filter against a representative pull request list:
sync/optimization-docs-a735ef03(current)sync/optimization-docs-65efcf2esync/optimization-docs(legacy fixed)feat/unrelated-docs-changesync/openapi-somethingrenovate/fern-api-5.xbash -n; no${{ }}inside anyrun:pnpm fern:check, Prettier cleanThe
jqfilter uses--argrather than string interpolation so a branch name cannot alter the expression.🤖 Generated with Claude Code