Skip to content

[CI/Packaging] Keep publication-pinned commits reachable after merge - #1080

Merged
brandonpayton merged 1 commit into
mainfrom
ci/preserve-head-merge-qk044
Jul 24, 2026
Merged

[CI/Packaging] Keep publication-pinned commits reachable after merge#1080
brandonpayton merged 1 commit into
mainfrom
ci/preserve-head-merge-qk044

Conversation

@brandonpayton

Copy link
Copy Markdown
Member

Why

Some packaging releases must keep one exact reviewed pull-request commit reachable after the pull request merges. For example, the ABI 42 Homebrew publisher and bottle catalog are pinned to one exact commit. A squash or rebase merge rewrites that identity, but the current merge-candidate activation protocol rejects merge commits. That would leave us with a bad choice: lose the pinned commit or merge successfully and then fail the canonical package activation.

This adds one narrow, fail-closed merge mode for that situation. It does not change the default: ordinary pull requests still squash, and batched-changes pull requests still rebase.

What changed

  • Add a preserve-head-commit history mode to Prepare merge.
  • Require its final merge commit to have exactly the prepared base and reviewed pull-request head as its ordered parents.
  • Continue requiring the merged tree to equal the tree that Prepare merge tested.
  • Reject a pull request that carries both batched-changes and preserve-head-commit before creating a candidate.
  • Document the bounded repository-settings window: merge commits may remain disabled except while an approved preserve-head merge is performed.

Validation

  • bash scripts/dev-shell.sh bash .github/scripts/test-verify-merge-candidate.sh
  • bash scripts/dev-shell.sh bash .github/scripts/test-init-merge-candidate.sh
  • bash scripts/dev-shell.sh bash .github/scripts/test-merge-candidate-workflows.sh
  • bash scripts/dev-shell.sh ruby -e 'require "yaml"; YAML.parse_file(".github/workflows/prepare-merge.yml")'
  • bash -n for every changed shell script
  • git diff --check

All listed checks passed. actionlint was not run because it is not declared in the repository dev shell; the repository's merge-candidate workflow contract suite and a YAML parse were run instead.

Scope

This changes CI/package-release history validation only. It does not change the kernel, ABI, runtime behavior, package bytes, or the frozen head of PR #1079.

Teach Prepare merge and post-merge activation one bounded merge-commit history shape. A preserve-head-commit candidate accepts only the exact prepared base and reviewed PR head as its ordered parents and still requires the tested tree byte-for-byte.

This lets publication workflows pin an exact reviewed SHA without leaving canonical package activation incompatible with the merge that keeps that SHA reachable. Conflicting history labels fail before candidate creation.
@brandonpayton brandonpayton added the ready-to-ship Maintainer attests the exact tested head and requests merge preparation. label Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

prepare-merge: runtime/materialization tests passed against the synthetic PR merge; package staging and durable package publishing were skipped. merge-gate=success posted on PR HEAD. This PR is ready for a reviewer to squash merge.

@brandonpayton
brandonpayton merged commit 0773105 into main Jul 24, 2026
59 checks passed
@brandonpayton
brandonpayton deleted the ci/preserve-head-merge-qk044 branch July 24, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-ship Maintainer attests the exact tested head and requests merge preparation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant