Skip to content

Rebase or Append Where an Upstream Rejects Merges or Rewrites - #4339

Merged
ptr727 merged 5 commits into
developfrom
burndown/upstream-branch-rewrite
Nov 22, 2026
Merged

ptr727 merged 5 commits into
developfrom
burndown/upstream-branch-rewrite

Conversation

@ptr727

@ptr727 ptr727 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements the maintainer's recorded answers on two upstream-contribution policies in the upstream-contribution-workflow skill, and reconciles git-commit-conventions's never-force-push rule with it.

  • Upstream CI rejects merge commits (upstream-contribution-workflow: merging into the dirty branch breaks upstreams whose CI rejects merge commits #2274, option 1). The dirty branch is rebased onto the mirror branch instead of merging it in, and a stacked branch moves with git rebase --onto from 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-lease pinned to that old head. The sh and PowerShell blocks each stop on any failed step. Backup branches are left for the maintainer to delete.
  • Upstream forbids rewriting a published PR (Decide How upstream-contribution-workflow Updates the Clean Branch Where an Upstream Forbids Rewriting a Published Pull Request #4176, option 1). The clean branch stays append-only there. Each round lands as a new commit on top, pushed without force, and the squash happens once, at the end or through the upstream's own squash merge. On every other upstream, step 5's re-squash is unchanged. Neither answer covers how an append-only clean branch follows a moved upstream base, so the skill stops for the maintainer there, including before a round taken from a dirty branch that has merged the moved mirror.
  • Force-push go-ahead. Each --force-with-lease push the skill allows still waits for the maintainer's explicit, current go-ahead, per GOVERNANCE.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 to upstream-contribution-workflow for the branches there. GOVERNANCE.md's "Never force push" summary governs fleet repositories and stays true unchanged.
  • The skill description gains the two new triggers and is trimmed to stay under the 1024-character limit. Generated copies are rebuilt with scripts/build_dist.py.

Closes on promotion: #2274, #4176

Verification

  • scripts/build_dist.py --check: current.
  • scripts/prose_lint.py --diff against the merge base: 0 violations.
  • scripts/docker_lint.py --linter markdownlint --linter cspell: 0 issues.
  • tests/test_build_dist.py: 102 tests OK.
  • Both rebase blocks exercised against a disposable local bare remote: a reused backup suffix stops before the rebase, and a fresh suffix rebases and force-pushes.
  • 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 introduced findings left open when the local pass's edit budget ran out. Commit b59ae6c fixes both, and the pass recorded on that head found nothing:

  1. Fixed: the PowerShell block throws when $mirror is unset. Without that check, PowerShell drops the null argument and git rebase $mirror work/x rebases the checked-out branch.
  2. Fixed: after a conflicted rebase, the skill says to read the old head back from the backup branch and run only the lease push.

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 22, 2026 07:04
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]>
Copilot AI lite review requested due to automatic review settings November 22, 2026 15:14
@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head b4d975c76e0b98c20a8cbf5c810d1a814226f350, the content this pull request carries at that commit against develop, and it recorded 2 findings.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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]>
@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head b59ae6c0b0c9ee0e59cdd81700e66c173ce6875a, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.54%. Comparing base (b38e084) to head (8a9c1c4).
⚠️ Report is 284 commits behind head on develop.

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     
Flag Coverage Δ
python-3.13 79.54% <ø> (-2.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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]>
@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 8a9c1c42c4fd3c23668cf2dd326fa3112f880e08, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 97fa314 into develop Nov 22, 2026
14 checks passed
@ptr727
ptr727 deleted the burndown/upstream-branch-rewrite branch November 22, 2026 16:22
ptr727 added a commit that referenced this pull request Nov 22, 2026
…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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants