Skip to content

Commit 90591be

Browse files
Base the bump on the commit the suite tested
propose_bump checked out the default branch tip at bump time, not the tree the test job ran against. The four-platform matrix takes tens of minutes; a default branch that advances meanwhile puts the new engine pin on binding code nothing tested, while the pull request body says the suite passed. github.sha is fixed for the whole run, so checking that out makes the claim true. Rooting the branch there means it can be behind the default branch, which is honest and what GitHub already shows. It also reintroduces the case the previous commit removed — a manual run from a branch that is not the default one would carry that branch;s other changes into the bump — so the compare API decides: identical or behind means the tested commit is on the default branch, anything else declines to propose. Verified the three statuses against real refs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 3c33591 commit 90591be

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/engine-release-check.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ jobs:
9090
outputs:
9191
pr: ${{ steps.bump.outputs.pr }}
9292
steps:
93-
# Explicitly the default branch. A manual run from some other branch would
94-
# otherwise root the bump there and open the pull request against it.
93+
# The commit the suite actually ran against, not whatever the default branch
94+
# has become since. github.sha is fixed for the whole run, so this is the
95+
# same tree the test job exercised; a default branch that moved during a
96+
# long matrix would otherwise put the new pin on untested code while the
97+
# pull request claims the suite passed.
9598
- uses: actions/checkout@v4
9699
with:
97-
ref: ${{ github.event.repository.default_branch }}
100+
ref: ${{ github.sha }}
98101

99102
- id: bump
100103
name: Open a PR moving the pin to this engine
@@ -114,6 +117,17 @@ jobs:
114117
exit 1 ;;
115118
esac
116119
120+
# A manual run from a branch that is not the default one would carry that
121+
# branch's other changes into the bump. "behind" means the tested commit
122+
# is an ancestor of the default branch; "identical" means it is the tip.
123+
rel=$(gh api "repos/$GITHUB_REPOSITORY/compare/$DEFAULT_BRANCH...$GITHUB_SHA" --jq .status)
124+
case "$rel" in
125+
identical|behind) ;;
126+
*)
127+
echo "tested commit $GITHUB_SHA is $rel relative to $DEFAULT_BRANCH; not proposing a bump"
128+
exit 0 ;;
129+
esac
130+
117131
current=$(grep -E '^CHDB_ENGINE_PIN=' update_libchdb.sh | cut -d= -f2)
118132
if [ "$current" = "$ENGINE_VERSION" ]; then
119133
echo "already pinned to $ENGINE_VERSION, nothing to propose"
@@ -158,6 +172,8 @@ jobs:
158172
echo
159173
echo "$RUN_URL"
160174
echo
175+
echo "Based on $GITHUB_SHA, the commit that run tested."
176+
echo
161177
echo "No checks will appear here. GitHub does not start workflow runs for"
162178
echo "commits a workflow pushed with \`GITHUB_TOKEN\`, and running CI on this"
163179
echo "branch would exercise the same tests against the same engine the check"

0 commit comments

Comments
 (0)