fix(labels): compare release shape to merge base
Some checks failed
CI / self-guards (pull_request) Failing after 10s
CI / action-exercise (pull_request) Successful in 8s
CI / release-exercise (pull_request) Successful in 15s
CI / docs-sync-exercise (pull_request) Successful in 7s
labels / labels (pull_request) Successful in 10s
Refs guard / refs-not-closing (pull_request) Successful in 7s
CI / test (pull_request) Failing after 42s
Some checks failed
CI / self-guards (pull_request) Failing after 10s
CI / action-exercise (pull_request) Successful in 8s
CI / release-exercise (pull_request) Successful in 15s
CI / docs-sync-exercise (pull_request) Successful in 7s
labels / labels (pull_request) Successful in 10s
Refs guard / refs-not-closing (pull_request) Successful in 7s
CI / test (pull_request) Failing after 42s
This commit is contained in:
parent
328c8707df
commit
dc29fdc84c
2 changed files with 6 additions and 2 deletions
|
|
@ -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:
|
# The state machine. Pure functions over these globals, set per PR:
|
||||||
# DRAFT true|false
|
# DRAFT true|false
|
||||||
# HEAD_SHA the PR's current head commit
|
# 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
|
# REQUESTED newline-separated logins with a review currently requested
|
||||||
# REVIEWS_JSON JSON array of submitted, gradeable reviews
|
# REVIEWS_JSON JSON array of submitted, gradeable reviews
|
||||||
# MERGEABLE MERGEABLE | CONFLICTING | UNKNOWN (GitHub's own verdict)
|
# 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
|
# Drafts are exempt (the build phase is the builder's); the version
|
||||||
# reads cost two API calls and only on PRs missing the label.
|
# reads cost two API calls and only on PRs missing the label.
|
||||||
if [ "$DRAFT" != true ] && ! has_label release; then
|
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
|
fi
|
||||||
|
|
||||||
# ---- merge-next: cleared, never set ----------------------------------
|
# ---- merge-next: cleared, never set ----------------------------------
|
||||||
|
|
@ -1031,6 +1033,7 @@ main() {
|
||||||
set_required_bots "$AUTHOR"
|
set_required_bots "$AUTHOR"
|
||||||
HEAD_SHA="$(jq -r '.head.sha' <<<"$PR_JSON")"
|
HEAD_SHA="$(jq -r '.head.sha' <<<"$PR_JSON")"
|
||||||
BASE_SHA="$(jq -r '.base.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")"
|
LABELS="$(jq -r '.labels[].name' <<<"$PR_JSON")"
|
||||||
# This allow-list answers whether a row is a submitted, gradeable review;
|
# This allow-list answers whether a row is a submitted, gradeable review;
|
||||||
# bot_verdict separately answers what that submitted verdict says (#235).
|
# bot_verdict separately answers what that submitted verdict says (#235).
|
||||||
|
|
|
||||||
1
changelog.d/275.md
Normal file
1
changelog.d/275.md
Normal file
|
|
@ -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).
|
||||||
Loading…
Reference in a new issue