Repository navigation
Anchor and check upstream-targeted ship branches against the target's default branch - #293
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…epository's default branch A direct-PR task with upstream consent now starts its branch from the consented repository's default branch and gates every push on a diff measured against it, so fork-only history cannot ride into the upstream pull request.
trillium
force-pushed
the
fm/upstream-pr-base
branch
from
November 4, 2026 04:05
8f44fd5 to
9a61465
Compare
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 changes
A ship task that publishes to another repository (recorded with
--upstream-consent) used to build on the clone's forkmain, which can be hundreds of commits ahead of the target. A push from that branch put fork-only files into the upstream pull request.Now the generated direct-PR brief for such a task:
bin/fm-target-base.sh anchor), not the fork's.bin/fm-target-base.sh check <target> --allow <intended path>before every push. It refuses when the branch is not built on the target's tip or touches a file outside the intended set, and it prints the commit and file list to read.The new script only fetches into
FETCH_HEAD; it never pushes and never edits remotes or git config. No-mistakes mode was already refused for a foreign target, because the pipeline rebases onto origin's default branch and has no setting that names a different repository; that refusal is unchanged.Affected output: the generated ship brief (
Setupstep 2 andDefinition of done) when--upstream-consentis present, plus the newbin/fm-target-base.sh.Evidence
flowchart LR subgraph Before A[fork main +N commits] --> B[task branch] --> C[push] --> D[upstream PR shows fork-only files] end subgraph After E[target main] --> F[anchor] --> G[task branch] --> H[check against target] -->|clean| I[push] H -->|other base or stray file| J[refused] endTest run (
tests/fm-target-base.test.sh, a fork that diverged from its upstream by two commits):The brief assertions are in
tests/fm-self-repo-role.test.sh;bin/fm-lint.shandbin/fm-doc-audience-check.shpass.