Skip to content

🐛 Retry the release PR lookup and fall back to the merge subject - #19

Merged
ltetzlaff merged 1 commit into
mainfrom
fix/release-pr-lookup
Oct 22, 2026
Merged

ltetzlaff merged 1 commit into
mainfrom
fix/release-pr-lookup

Conversation

@ltetzlaff

Copy link
Copy Markdown
Owner

The Release run for #18's merge commit (5261d2d) failed on all four attempts (run 39801679511). Each time, GET /repos/ltetzlaff/swift/commits/5261d2d…/pulls returned an empty HTTP 500, and gh reported unexpected end of JSON input. Run locally, the same call alternated between 500 and 200. As a result, v1.8.0 was never released and v1 still points at a3177b5 (Swift 6.3.3).

Changes (Find the merged PR and its version label)

  • Retries: every gh api call is retried up to 5 times, waiting 10s, 20s, … between attempts.
  • Fallback: if the commit → PR lookup returns nothing, the step reads the PR number from the merge commit subject (Merge pull request #N from …). It uses that number only after GET /pulls/N confirms the PR merged into main with this exact merge_commit_sha.
  • Fails loudly: if the lookup itself failed and the fallback finds nothing, the step now fails with an error. Before, it reported "nothing to release" and exited successfully.

Tested the step locally (with tr standing in for bash 4's ${LABELS,,}):

  • Real API, 5261d2d: PR #18 → minor
  • Commit lookup stubbed to always 500, 5261d2d: five warnings, then the fallback gives PR #18 → minor
  • Stubbed 500 on a commit whose subject isn't a merge: ::error::Could not look up the PR …

Why this PR is labelled minor

#18 (the Swift 6.4.1 default, a minor change) was never released. Merging this PR runs Release again. The notes cover every commit since v1.7.4, so this PR's label decides the version: minor gives v1.8.0, which includes the 6.4.1 update, and moves v1 to it.

The commit -> PR endpoint answered empty 500s for 5261d2d (#18's merge)
on four attempts in a row, so the release step failed and v1 never moved.
Retry each API call, fall back to the PR number in the merge commit's
subject once the PR confirms it merged as that commit, and fail loudly
instead of skipping the release when the lookup itself failed.
@ltetzlaff
ltetzlaff merged commit 6b94749 into main Oct 22, 2026
10 of 11 checks passed
@ltetzlaff
ltetzlaff deleted the fix/release-pr-lookup branch October 22, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant