From dc29fdc84c30c65bcd42c76403191b3b75a129c4 Mon Sep 17 00:00:00 2001 From: codex-bot-andresmgsl Date: Mon, 31 Aug 2026 21:06:50 +0000 Subject: [PATCH] fix(labels): compare release shape to merge base --- actions/labels-reconcile/labels-reconcile.sh | 7 +++++-- changelog.d/275.md | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelog.d/275.md diff --git a/actions/labels-reconcile/labels-reconcile.sh b/actions/labels-reconcile/labels-reconcile.sh index ca11fa1..7b07a8b 100755 --- a/actions/labels-reconcile/labels-reconcile.sh +++ b/actions/labels-reconcile/labels-reconcile.sh @@ -270,7 +270,8 @@ set_required_bots() { # the PR author is recused by construction # The state machine. Pure functions over these globals, set per PR: # DRAFT true|false # HEAD_SHA the PR's current head commit -# BASE_SHA the PR's base branch head (the release-shape guard's ref) +# BASE_SHA the PR's base branch head +# MERGE_BASE_SHA the PR's merge base (the release-shape guard's ref) # REQUESTED newline-separated logins with a review currently requested # REVIEWS_JSON JSON array of submitted, gradeable reviews # MERGEABLE MERGEABLE | CONFLICTING | UNKNOWN (GitHub's own verdict) @@ -918,7 +919,8 @@ reconcile_pr() { # $1 = PR number; relies on the globals set from its fetch # Drafts are exempt (the build phase is the builder's); the version # reads cost two API calls and only on PRs missing the label. if [ "$DRAFT" != true ] && ! has_label release; then - release_shape_warning "$n" "$(tree_version "$HEAD_SHA")" "$(tree_version "$BASE_SHA")" + release_shape_warning "$n" "$(tree_version "$HEAD_SHA")" \ + "$(tree_version "${MERGE_BASE_SHA:-$BASE_SHA}")" fi # ---- merge-next: cleared, never set ---------------------------------- @@ -1031,6 +1033,7 @@ main() { set_required_bots "$AUTHOR" HEAD_SHA="$(jq -r '.head.sha' <<<"$PR_JSON")" BASE_SHA="$(jq -r '.base.sha' <<<"$PR_JSON")" + MERGE_BASE_SHA="$(jq -r '.merge_base // empty' <<<"$PR_JSON")" LABELS="$(jq -r '.labels[].name' <<<"$PR_JSON")" # This allow-list answers whether a row is a submitted, gradeable review; # bot_verdict separately answers what that submitted verdict says (#235). diff --git a/changelog.d/275.md b/changelog.d/275.md new file mode 100644 index 0000000..4cf6559 --- /dev/null +++ b/changelog.d/275.md @@ -0,0 +1 @@ +- Compare release-shaped pull requests with their merge base so later base-branch releases do not create phantom version-change warnings (#275).