Skip to content

fix(ci): stop push-time release rebuilds and merge a green release when main only added fragments - #8548

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/release-no-push-rebuild
Oct 20, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/release-no-push-rebuild

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

No related issue: release pull request cancellation loop observed 2026-10-20 (runs 39375083134, 39375176650 cancelled)

Summary

The plugin release pull request (release/plugins, e.g. #8194) never settles under steady merges: every push to main that adds a changelog fragment makes it stale, a push-time merge run rebuilds it, and the new head cancels its running checks. A stale head could not merge anyway, so the release only landed tonight after all enqueues were held for one CI run.

Fix

Two parts, chosen with the release owner (committee decision, recorded in the ADR 0048 amendment):

  1. No push-time rebuilds (decide-rebuild.sh): on a push event merge never rebuilds; it queues the release PR only if green, otherwise defers. Rebuilds happen on the 3-hourly schedule and workflow_dispatch. Push runs no longer cancel a running scheduled rebuild: cancel-in-progress is now github.event_name != 'push' (release-publish-plugins.yml:53). A waiting push run can still replace a waiting scheduled run in the group's pending slot, and that rebuild then slips to the next schedule. With no release PR open, a push still builds one.
  2. A green head merges when main only added newer fragments (scripts/check-changelog-fragments.sh:204-232, --check-release): for every path the head changes, the blob on main must equal the blob at the build base (the head's merge base with main). A consumed fragment edited or removed on main, or a plugin CHANGELOG.md / plugin.json changed on main since the build, refuses (EDITED FRAGMENT, REMOVED FRAGMENT, CHANGED ON BASE). Fragments added after the build are not in the head's diff and ride the next release.

Risk for review

In the merge queue (pr-require-checks.yml:1827-1849) --check-release used to compare against HEAD^1, the queued squash commit's own parent and merge base, so it always passed there. It now judges the release against merge_group.base_sha ("The SHA of the merge group's parent commit", webhook payload docs). The queue merges by squash (one parent, no HEAD^2), so the release is read from the queued pull request's head commit (steps.queued_pr.outputs.head_sha, passed as CHANGELOG_PR_HEAD), and its build base is that head's merge base with base_sha. The step refuses when the queued pull request cannot be resolved, when base_sha is empty or unreadable, or when the release head is missing; it never falls back to HEAD^1. A queued pull request that is not the release is declined, as before it always passed.

Queue entries ahead: base_sha already includes them. GitHub's merge-queue docs say a group holds "changes from pull requests ahead of it in the queue" (managing a merge queue), and recent queue refs stack on earlier group heads (checked by GitHub Security & Cost), so an entry ahead of the release is seen by the check.

Also not changed: the workflow_dispatch input description under on: still describes the old rule (left alone to keep on: untouched).

Verification

  • scripts/check-changelog-fragments.test.sh: 6 cases failed before the fix; 63/63 pass after. Queue mode: 4 of 6 new cases failed before the fix (the absent and unreadable base already exited 2); 66/66 pass after. Follow-up: the absent-base case now asserts its error message, and queue cases cover a removed consumed fragment and a plugin.json version change; each fails against a gate mutated to skip that check, and 68/68 pass. decide-rebuild.test.sh passes (stub gate; cases relabeled).
  • shellcheck and actionlint pass. scripts/check-affected.sh --tests passes except the pytest-run Python suites, which fail locally for want of pytest and PyYAML on this machine; CI runs them.

Related

  • ADR 0048 amendment in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT

kyle-sexton and others added 4 commits October 20, 2026 02:06
Each rebuild of release/plugins pushes a new head and cancels the release
pull request's running pr-require-checks; with fragments landing on main
faster than those checks finish, push-triggered rebuilds kept it from ever
settling. A push run now only queues an open release pull request that is
current and green (or builds one when none is open); rebuilds happen on the
3-hourly schedule and workflow_dispatch. A push run also waits instead of
cancelling a running one, so it cannot cancel a scheduled rebuild. ADR 0048
gains a 2026-10-20 amendment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
…r fragments

check-changelog-fragments.sh --check-release counted every fragment main
added after the release was cut as stale, so while fragments kept landing
the release pull request was rebuilt before its checks finished and never
merged. The gate now fails only when main changed a file the release
changes (a consumed fragment edited or removed, a CHANGELOG.md, a
plugin.json) since its build base, the release head's merge base with
main; fragments added after the build ride the next release. The merge
job's decide-rebuild.sh and the merge queue run the same gate. ADR 0048's
2026-10-20 amendment records the new meaning of current.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
In the merge queue the release gate compared against HEAD^1, the queued
squash commit's own parent and so its merge base, and always passed. The
queue now judges the release, read from the queued pull request's head
commit, against merge_group.base_sha, and refuses when either is missing
or unreadable. Non-release pull requests in the queue are declined.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
The absent-group-base queue case now asserts the gate's own error, so a
setup crash no longer passes it. Queue mode gains cases for a consumed
fragment removed on the group's base and a released plugin.json version
changed there. The ADR 0048 amendment and the pr-require-checks comment
now describe the queue check as base_sha against the queued pull
request's head, which refuses when either is missing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 20, 2026 06:32
@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-20T06:34:22.074565Z 34ff45a Draft marked ready
ℹ️ 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.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed cf464fd27860ea9e4c7220c48b2aab2157c99a3c: 0 finding(s), 0 as inline comments.

No security issues found in the incremental change (cf464fd, scripts/check-changelog-fragments.test.sh).

The change adds one unset line at the top of the test script. It clears GITHUB_EVENT_NAME, MERGE_GROUP_BASE_SHA, CHANGELOG_PR_HEAD, CHANGELOG_HEAD_REF, CHANGELOG_PR_AUTHOR and GITHUB_REPOSITORY, so each test case starts with none of them set. It only affects test isolation. It adds no input handling, no secrets or credential handling, and no change to the gate script itself. It deletes or softens no standing instruction. The cases that need one of these variables set it themselves.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed cf464fd27860ea9e4c7220c48b2aab2157c99a3c: 0 finding(s), 0 as inline comments.

Incremental review of scripts/check-changelog-fragments.test.sh (fc7bfe8 to cf464fd): no findings.

The change adds one unset line at the top of the test script, so every case starts without the CI-exported environment. This fixes a real problem: a CI run exports GITHUB_EVENT_NAME=merge_group, which would switch the gate into queue mode for every test case.

I checked the unset list against what the gate and its library read (scripts/check-changelog-fragments.sh and scripts/lib/changelog-fragments.sh). It covers GITHUB_EVENT_NAME, CHANGELOG_PR_HEAD, CHANGELOG_HEAD_REF, CHANGELOG_PR_AUTHOR and GITHUB_REPOSITORY, and it also covers MERGE_GROUP_BASE_SHA. CF_LIST and CF_EM_DASH_LIST can be overridden from the environment, but CI doesn't export them, so I left them alone. Unsetting an already-unset variable is a no-op under set -uo pipefail, so the line is safe.

I ran no commands: the Bash sandbox blocked my grep and test runs for approval. The review rests on reading the diff and the two source files. The PR description's claim of 68/68 passing is the author's and unverified by me.

The release queue gate compares against merge_group.base_sha. GitHub's
merge-queue docs say a group carries changes from pull requests ahead of it
in the queue, so that base already includes them; say so where the gate is
wired.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026
The merge_group CI run exports GITHUB_EVENT_NAME=merge_group, which reached
the gate under test and sent every pull-request-mode --check-release case
down the queue path (rc=2). Unset the gate's environment inputs once at the
top of the test file; cases that need one set it themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 2e78b06 Oct 20, 2026
33 checks passed
@kyle-sexton
kyle-sexton deleted the fix/release-no-push-rebuild branch October 20, 2026 07:34
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