Skip to content

Share one approval branch per source commit across environments - #921

Merged
AnthonyRonning merged 2 commits into
masterfrom
opensecret/shared-approval-branch
Sep 14, 2026
Merged

AnthonyRonning merged 2 commits into
masterfrom
opensecret/shared-approval-branch

Conversation

@AnthonyRonning

Copy link
Copy Markdown
Contributor

Each OpenSecret EIF release run pushed its own opensecret/pcr-approval-<env>-<commit> branch. When one commit changes both measurement sets, the two single-environment PRs each fail the other environment's approval comparison by design (#918, #919), and the approvals had to be combined by hand (#920).

scripts/ci/publish_opensecret_approval.sh now targets opensecret/pcr-approval-<commit>, shared by both environments' runs for that commit:

  • If the branch exists it must descend from the source commit and change only the four approval files; a run whose environment is already on the branch refuses, as before.
  • The run's commit is rebased onto the branch tip (the two environments touch disjoint files), then pushed without force. A push rejected by the other environment's concurrent run is refetched, replayed and retried, up to five times, and a final failure leaves the commit in the checkout and fails loudly.
  • Single-environment use is unchanged: the branch simply holds one commit.

Fixtures: sequential second environment lands on the same branch with both approvals; repeated environment is refused; a lost push race (a git shim pushes the other environment's commit between fetch and push) is replayed on top. The Nitro runbook describes the shared branch. No workflow YAML change.

🤖 Generated with Claude Code

AnthonyRonning and others added 2 commits September 14, 2026 18:03
Each OpenSecret EIF release run pushed its own opensecret/pcr-approval-<env>-<commit>
branch, so when one commit changed both measurement sets the two
single-environment pull requests each failed the other environment's
approval comparison (#918 and #919), and the approvals had to be combined
by hand (#920). The publisher now targets opensecret/pcr-approval-<commit>:
if the branch already exists it must descend from the source commit and
change only approval files, the run refuses to repeat an environment that
is already on it, and its commit is rebased onto the branch tip. A push
rejected by the other environment's concurrent run is refetched, replayed
and retried up to five times. Fixtures cover the sequential second
environment, the repeated environment refusal, and a lost push race driven
through a git shim; the runbook describes the shared branch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Nix check sandbox has no /usr/bin/env, so the shim must name the bash
the test itself found.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning merged commit 46b0b6b into master Sep 14, 2026
21 checks passed
@AnthonyRonning
AnthonyRonning deleted the opensecret/shared-approval-branch branch September 14, 2026 19:21
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