Skip to content

release.sh: tag the version bump on a main commit whose CI already passed #1588

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Context

scripts/release.sh only finishes if main stays quiet. Releasing 0.17.4 took 2 hours (18:13–20:16 on 2026-10-28), almost all of it waiting. Main moved three times while it waited for CI on main's tip, and each move started the wait over. #976 made it follow main's tip instead of refusing; it still has to wait.

The script depends on a quiet main in three places, all because the tag goes on the bump PR's merge commit on main:

  1. Before the bump. It waits for push CI on main's tip, and starts the wait over whenever main moves.
  2. Before merging the bump PR. It refuses with "main contains content absent from the measured Candidate; choose a fresh release version" if anything merged while the bump PR's CI ran. That version number then can't be released.
  3. Before tagging. It refuses unless the merge commit's tree equals the bump commit's tree. A merge that lands alongside the bump PR fails this check.

Decision (maintainer, 2026-10-28): tag the version bump on a main commit whose push CI already passed, not the bump PR's merge commit.

Agent Brief

Category: enhancement
Summary: scripts/release.sh tags a version bump on a main commit whose CI already passed, so merges to main during a release no longer delay it or make it refuse.

Current behavior:

  1. The script waits for push CI on main's tip, following every move.
  2. It cuts release-<version> with the version bump, opens the bump PR and waits for its CI.
  3. It refuses if main has moved since the bump branch was cut.
  4. It merges the PR and refuses unless the merge tree equals the bump tree.
  5. It tags v<version> on the merge commit, then waits for the release workflow.

Desired behavior:

  • The release base. It is the newest commit on main whose latest push CI run succeeded. The script finds it without waiting on main's tip. It waits only when no such commit is newer than the last release tag. In that case it waits for a run to succeed and does not follow every move of the tip.
  • The bump commit. release-<version> is that base plus the version bump only (Cargo.toml, Cargo.lock), as today.
  • The bump PR. The script opens it and waits for its checks as today. If they fail, it leaves the PR open and untagged and exits 1, as today.
  • The tag. v<version> goes on the bump commit, the head of release-<version>, not on a merge commit. The release workflow then starts from that tag, and the script waits for it as today.
  • Merging the bump PR. After tagging, the script merges the bump PR into main with a merge commit, so the tagged commit ends up in main's history. If main has moved, that is fine. If the merge fails, for example because of a conflict, the release still stands. The script says so and names the PR left for the Day shift to merge. It does not move or delete the tag.
  • Checks that go away. The refusal for "main contains content absent from the measured Candidate" goes, and so does the merge-tree-equals-bump-tree check before tagging. The tagged tree is now the bump tree by construction.
  • --with-experiment. The release Experiment's Candidate is the release base, its content commit. The tagged tree is exactly that content plus the version bump, so no recheck of main is needed.
  • Resuming. A resumed release recognises v<version> on origin at the head of release-<version> as its own tag. It still refuses a v<version> tag on origin anywhere else. A resume whose tag exists but whose bump PR is still open goes on to merge the PR and wait for the release workflow. The other resume paths behave as today, adjusted for the new order: open the PR, wait, tag, merge, then wait for the release workflow.
  • The release summary. It still covers the PRs merged between the last release tag and the release base.

Key interfaces:

  • The script's usage line and its header comment, which document every refusal and the resume behaviour, describe the new order and the new tag location.
  • The release workflow's push: tags trigger is unchanged; it builds from whatever commit the tag names.
  • docs/guide.md and any hand-written site page that describes cutting a release (search release.sh) match the new behaviour.

Acceptance criteria:

  • With the newest main commit's CI still pending and an older main commit green, the release cuts its bump from the green commit without waiting. The release tests drive the script with fake git and gh.
  • A commit merged to main while the bump PR's CI runs doesn't make the script refuse or wait. The tag lands on the bump commit, and the bump PR is merged afterwards.
  • git merge-base --is-ancestor v<version> origin/main holds after a successful run.
  • A bump PR that can't be merged after tagging leaves the tag and the published release in place, and the script reports the open PR and exits 0. Exit 0 is fine because the release itself succeeded.
  • Resuming after each step, whether the branch is pushed, the PR open, the tag pushed with the PR open, or the PR merged, finishes the release without a second tag or a second PR.
  • A v<version> tag on origin that is not at the head of release-<version> is still refused.
  • The existing release tests pass, updated where they asserted the old tag location or refusals.

Out of scope:

Activity

  1. added
    enhancement
    ready-for-agent
    in-progress
    and removed
    ready-for-agent
    on Oct 29, 2026
  2. removed
    in-progress
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions