Repository navigation
Rebase or Append Where an Upstream Rejects Merges or Rewrites - #4339
Conversation
upstream-contribution-workflow covers two upstream policies. Where the upstream's CI rejects merge commits, the dirty branch is rebased and pushed with --force-with-lease, after its old head is pushed to a numbered backup branch on the fork. Where the upstream forbids rewriting a published pull request, the clean branch stays append-only and is squashed once at the end. Every force-with-lease push waits for the maintainer's explicit, current go-ahead. git-commit-conventions scopes its never-force-push rule to fleet repositories and points to upstream-contribution-workflow for the fork. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rebase block confirms the backup ref holds the old head before the lease push, numbers the backup in a variable, and gains a PowerShell equivalent. A stacked branch moves with rebase --onto from the lower branch's old head. An append-only clean branch stops for the maintainer before following a moved base, since no answer covers that case. Backup branches are left for the maintainer to delete. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The sh block chains every step with && and names a failed backup check. The PowerShell block checks each git exit code and casts the ls-remote output to a string, so a missing backup throws before the force-push. The append-only clean branch also stops before taking a round from a dirty branch that has merged the moved mirror. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
The PowerShell block throws when $mirror is unset, since PowerShell drops a null argument and the rebase would then move the checked-out branch. After a conflicted rebase, the old head is read back from the backup branch and only the lease push runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
Active findings remain in the workflow documentation, including an unsafe published-branch force-push path, missing mirror validation and rebase recovery guidance, and an unchecked final push status.
5 open issues
What changed in this PR
This PR updates the upstream contribution workflow for repositories that reject merge commits or forbid rewriting published pull requests, scopes the fleet force-push prohibition, and regenerates distributed skill copies.
Changes:
- Adds rebase and backup procedures for upstreams that reject merge commits.
- Adds append-only handling for upstreams that forbid rewriting published pull request branches.
- Updates force-push guidance and refreshes generated skill distributions and source digests.
| File | Description |
|---|---|
| .github/skills/upstream-contribution-workflow/SKILL.md | Generated GitHub Copilot upstream contribution workflow skill. |
| .github/skills/git-commit-conventions/SKILL.md | Generated GitHub Copilot commit conventions skill. |
| .claude-plugin/fleet-skills/skills/upstream-contribution-workflow/SKILL.md | Generated Claude upstream contribution workflow skill. |
| .claude-plugin/fleet-skills/skills/git-commit-conventions/SKILL.md | Generated Claude commit conventions skill. |
| .claude-plugin/fleet-skills/.source-digests/upstream-contribution-workflow | Updated source digest for the upstream contribution workflow skill. |
| .claude-plugin/fleet-skills/.source-digests/git-commit-conventions | Updated source digest for the commit conventions skill. |
| .agents/skills/upstream-contribution-workflow/SKILL.md | Canonical upstream contribution workflow rules and rebase procedures. |
| .agents/skills/git-commit-conventions/SKILL.md | Scopes the force-push prohibition to fleet repositories. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4339 +/- ##
===========================================
- Coverage 81.60% 79.54% -2.07%
===========================================
Files 26 45 +19
Lines 9070 15919 +6849
===========================================
+ Hits 7402 12663 +5261
- Misses 1668 3256 +1588
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
The PowerShell block throws when the final lease push is refused. The description reads "Triggers regardless of" again, and its new trigger names an upstream's CI rather than the upstream itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
…ocal Cover, UTF-8 Children (#4342) Promotes the eight pull requests that landed on develop since the last promotion. - #4334: Create the PR with the `comments` label in drive-pr. - #4337: Correct the reviewer reference on CodeRabbit in private repositories. - #4335: Probe each Python candidate in `install.ps1` and bound the profile mask. - #4336: Write kit files atomically through a temporary file beside each target. - #4338: Pin the governance sections the host CLAUDE.md blocks mirror. - #4340: Let an attested pass cover a main head with no Copilot table. - #4339: Rebase or append where an upstream rejects merges or rewrites. - #4341: Pass `PYTHONIOENCODING` to every Python child a test decodes as UTF-8. Closes #1577 Closes #2274 Closes #4176 Closes #4322 Closes #3601 Closes #4317 Closes #4031 Closes #4113 Closes #3925 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Improvements** * The Windows agent installer now detects a working Python 3.11+ interpreter and reports which options were unavailable or too old. * Agent installation better preserves existing files if interrupted or if a write fails. * Installer logs more accurately distinguish profile paths from similarly named folders. * Pull request review guidance clarifies when local review coverage can qualify and how labels affect review runs. * **Documentation** * Updated contribution, review, and agent setup guidance, including governance synchronization checks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->


Summary
Implements the maintainer's recorded answers on two upstream-contribution policies in the
upstream-contribution-workflowskill, and reconcilesgit-commit-conventions's never-force-push rule with it.git rebase --ontofrom the lower branch's old head. This applies only where the upstream's own CI rejects merge commits, and only to the dirty branch on the maintainer's fork. Its old head is pushed to a numbered backup branch on the fork first, and the block confirms the fork holds that exact SHA. The rebased branch is then pushed with--force-with-leasepinned to that old head. The sh and PowerShell blocks each stop on any failed step. Backup branches are left for the maintainer to delete.--force-with-leasepush the skill allows still waits for the maintainer's explicit, current go-ahead, perGOVERNANCE.md"Communicating with the User". The skill says where a force-push may happen, never that one may happen unasked.git-commit-conventions. "Never force push" is scoped to fleet repositories, where it stays absolute. A new paragraph says the maintainer's fork of a third-party repository is not one, and points toupstream-contribution-workflowfor the branches there.GOVERNANCE.md's "Never force push" summary governs fleet repositories and stays true unchanged.scripts/build_dist.py.Closes on promotion: #2274, #4176
Verification
scripts/build_dist.py --check: current.scripts/prose_lint.py --diffagainst the merge base: 0 violations.scripts/docker_lint.py --linter markdownlint --linter cspell: 0 issues.tests/test_build_dist.py: 102 tests OK.local-strict-review: five passes recorded, the last on this head with no findings, and attested.Local-Review Findings From the First Push
The first push listed two
introducedfindings left open when the local pass's edit budget ran out. Commit b59ae6c fixes both, and the pass recorded on that head found nothing:$mirroris unset. Without that check, PowerShell drops the null argument andgit rebase $mirror work/xrebases the checked-out branch.🤖 Generated with Claude Code