Skip to content

ci(rollup): manage conflicting stacks from GitHub - #1606

Closed
tignear wants to merge 1 commit into
stack/tignear/fix/stack-dependency-urls/resolve-url-form-stack-deps--0de76083from
stack/tignear/fix/stack-dependency-urls/manage-conflicting-stacks-github--bba65e1f
Closed

tignear wants to merge 1 commit into
stack/tignear/fix/stack-dependency-urls/resolve-url-form-stack-deps--0de76083from
stack/tignear/fix/stack-dependency-urls/manage-conflicting-stacks-github--bba65e1f

Conversation

@tignear

@tignear tignear commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

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

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
@tignear

tignear commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 ci(mergify): resolve URL-form stack dependencies #1604
2 ci(rollup): manage conflicting stacks from GitHub #1606 👈

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T11:14:04.523668Z eb2d988 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 20, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread scripts/rollup-plan.mjs
Comment on lines +119 to +122
current.draft ||
current.head?.sha !== source.sha ||
current.head?.repo?.full_name !== repository ||
(current.state !== "open" && !current.merged)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread scripts/rollup-plan.mjs
"| 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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread .mergify.yml
Comment on lines +28 to +29
- scripts/rollup-plan.mjs
- scripts/rollup-plan.test.mjs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread scripts/github-rollup.mjs
current.draft ||
current.head?.sha !== source.sha ||
current.head.repo.full_name !== repository ||
(current.state !== "open" && !current.merged)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread scripts/github-rollup.mjs
number,
sha: pull.head.sha,
head: pull.head.ref,
title: pull.title,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@tignear tignear removed the merge-ready Request merging through Mergify after required checks label Oct 20, 2026
@mergify

mergify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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.

@tignear tignear closed this Oct 20, 2026
@tignear
tignear deleted the stack/tignear/fix/stack-dependency-urls/manage-conflicting-stacks-github--bba65e1f branch November 8, 2026 20:19
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.

1 participant