Skip to content

ci(release): accept a later first-parent commit's green run on the same package tree (proposal A) - #2891

Open
abrichr wants to merge 1 commit into
mainfrom
grok/newest-green-later-run
Open

abrichr wants to merge 1 commit into
mainfrom
grok/newest-green-later-run

Conversation

@abrichr

@abrichr abrichr commented Dec 1, 2026

Copy link
Copy Markdown
Member

From: Grok

Implements proposal A from scripts/ci/post_merge_batching.md, which Richard approved at 1:43 PM ET Dec 1.

What changes

scripts/ci/newest_green.py (used by release-package.yml, release-program-graph.yml and release-and-publish.yml) now accepts a successful push run on main for any first-parent commit C between a package's subject S and the tip, when all of these hold:

  • C descends from S (git merge-base --is-ancestor);
  • the package tree at C equals S's (git diff --quiet S C -- paths); a mismatch refuses the release (fails closed);
  • the run passes today's filters (push, main, this repository, success) and job_problems finds the package's own jobs run and passed.

The newest qualifying C wins. S's own runs are always looked up, as before. Later commits are found among the 100 most recent successful push runs, and at most 5 later runs' job lists are fetched, so the API cost stays bounded.

Why A alone

A merge-queue push that lands several merges starts one push run, for its last commit, and its scope diffs against the previous tip, so it runs every changed package's jobs. That is what stranded openadapt-flow 4.1.0: subject 29215d8f (#2882) has no push run of its own, while run 46707764790 on 10d283ad (same push, identical packages/flow tree) ran the flow jobs. B (scope against the last green run) and C (cancelling superseded runs) are not in this PR. desktop-release.yml is unchanged.

Not weakened

Every existing filter and the per-package job requirement are unchanged. A later green run that skipped the package's jobs is still refused, as are runs off the first-parent path, on other branches, from other events, or from forks.

Tests

tests/test_newest_green.py covers these cases against a real temporary git repo: a later run accepted, a later run without the jobs refused, an off-path commit refused, branch/event/fork refused, a tree change refused, the subject's own run, newest wins, and the lookup bound. Local: tests/test_newest_green.py tests/test_release_plan.py tests/test_kernel_ci.py tests/test_desktop_release_subject.py tests/test_packages_concurrency.py, 92 passed.

Dry run against live main (read-only API): types, agent, verify, kernel, desktop and launcher resolve as before. Flow will resolve to run 46707764790 on 10d283ad once it finishes green.

…me package tree (proposal A)

newest_green.py now accepts a successful push run on main for any first-parent
commit between a package's subject and the tip, when the package tree there is
identical (git diff --quiet) and the package's own jobs ran and passed. The
merge queue pushing several merges at once leaves the subject with no run of
its own; this stranded openadapt-flow 4.1.0. Runs that skipped the package's
jobs, runs off the first-parent path, other branches, events and forks stay
refused, and a tree change after the subject fails closed.

This branch has not been deployed

No deployments
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