Repository navigation
ci(rollup): manage conflicting stacks from GitHub - #1606
Conversation
Add a Run workflow entry point that expands selected stack tips into one rollup PR, preserves source commits, and holds the original PRs while integration is active. Conflicts create copied-source resolution PRs that can be edited in GitHub; resolution pushes automatically resume integration. Support resume, source-snapshot refresh, and cancellation with restoration of pre-existing holds. Record the recovery plan before claiming source labels, reserve sources against overlapping rollups, and reject stale or incomplete rollups in queue validation. Run the controller only from the trusted default branch without executing source code with app credentials. Validation: all 274 repository script tests passed, including a real Git lifecycle covering conflict resolution, source updates, refresh, interrupted publication, duplicate ownership, and cancellation. Actionlint, Mergify schema validation, pnpm lint, script formatting, and git diff --check passed. Live Actions dispatch requires the workflow to land on the default branch first. Change-Id: Ibba65e1f1c8c3a4f176231d6da65a32c21d16daa
|
This pull request is part of a Mergify stack:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb2d988a15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| current.draft || | ||
| current.head?.sha !== source.sha || | ||
| current.head?.repo?.full_name !== repository || | ||
| (current.state !== "open" && !current.merged) |
There was a problem hiding this comment.
Revalidate source topology before queueing
If an included source is retargeted or its Depends-On: line is edited after rollup creation, its head SHA does not change and the workflow does not subscribe to the edited event, so this predicate still accepts the stale plan during queue validation. A master rollup can consequently land a PR now targeting develop, or omit a newly declared stack predecessor; re-expand plan.tips and verify the current base/dependency chain before certifying the rollup.
Useful? React with 👍 / 👎.
| "| Source PR | Pinned head |\n| --- | --- |\n" + | ||
| plan.sources.map((s) => `| #${s.number} | \`${s.sha}\` |`).join("\n") + | ||
| "\n\n" + | ||
| plan.sources.map((s) => `Closes #${s.number}`).join("\n") |
There was a problem hiding this comment.
Close source PRs explicitly after develop rollups
When plan.base is develop while the repository default branch is master, GitHub does not apply these closing keywords when the rollup is merged into the non-default branch. In particular, stacked members targeting stack/* remain open even though their commits landed via the rollup; the rollup's closed-event cleanup then removes their holds, allowing retained merge-ready labels to queue the original stacks again. Successful develop rollups need to close their source PRs explicitly rather than relying solely on body keywords.
Useful? React with 👍 / 👎.
| - scripts/rollup-plan.mjs | ||
| - scripts/rollup-plan.test.mjs |
There was a problem hiding this comment.
Keep the rollup runtime in a shared queue scope
These exclusions assign rollup-plan.mjs solely to the pr-policy scope, but github-rollup.mjs, which remains in core, imports that module directly. Parallel changes to the controller and its plan API can therefore be validated and merged independently without any batch ever testing their combined tree, potentially breaking the trusted rollup workflow; keep the shared runtime module and its consumers in a common scope, or make them participate in both scopes.
Useful? React with 👍 / 👎.
| current.draft || | ||
| current.head?.sha !== source.sha || | ||
| current.head.repo.full_name !== repository || | ||
| (current.state !== "open" && !current.merged) |
There was a problem hiding this comment.
Reject sources that merged outside the rollup
When a held source is merged independently—manually or during the asynchronous window before its new hold takes effect—the source's closed event resumes the rollup and this condition deliberately treats the merged PR as valid. The controller can then queue an empty or partial aggregate whose title still includes the already-landed source, producing a second release/changelog entry and defeating source reservation; an active rollup should stop or be refreshed when any source merges outside it.
Useful? React with 👍 / 👎.
| number, | ||
| sha: pull.head.sha, | ||
| head: pull.head.ref, | ||
| title: pull.title, |
There was a problem hiding this comment.
Enforce source titles before deriving release impact
A source PR with a non-Conventional title can be selected because collection merely copies the title without validating it. That source's own failing title check is never applied to the aggregate PR, and commitReleaseImpact treats the unparseable title as zero, so sources with non-Conventional commits can be published as a chore(rollup) and land without the release impact that the normal queue would require; reject invalid source titles before constructing the plan.
Useful? React with 👍 / 👎.
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Add a Run workflow entry point that expands selected stack tips into one rollup PR, preserves source commits, and holds the original PRs while integration is active. Conflicts create copied-source resolution PRs that can be edited in GitHub; resolution pushes automatically resume integration.
Support resume, source-snapshot refresh, and cancellation with restoration of pre-existing holds. Record the recovery plan before claiming source labels, reserve sources against overlapping rollups, and reject stale or incomplete rollups in queue validation. Run the controller only from the trusted default branch without executing source code with app credentials.
Validation: all 274 repository script tests passed, including a real Git lifecycle covering conflict resolution, source updates, refresh, interrupted publication, duplicate ownership, and cancellation. Actionlint, Mergify schema validation, pnpm lint, script formatting, and git diff --check passed. Live Actions dispatch requires the workflow to land on the default branch first.
Depends-On: #1604