Skip to content

Commit bf3b589

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#26791: ci: Properly set COMMIT_RANGE in lint task
fa5cbf2 ci: Properly set COMMIT_RANGE in lint task (MarcoFalke) Pull request description: Currently the variable holds (apart from the commits in the pull request) all commits to master since the pull was opened. This is problematic, because already merged commits are linted in unrelated pulls, leading to: * Wasted resources. For example, currently the lint task may take 9 minutes, when it should take 1. See https://cirrus-ci.com/task/6032782770569216?logs=lint#L1449 * False failures. For example, when a "wrong" commit is in master it can lead to some pulls failing unrelatedly, and others not. Now that the CI has the `/merge` commit (since commit fad7281), `COMMIT_RANGE` can simply be set to `HEAD~..HEAD` to only hold the changes in the pull. ACKs for top commit: fanquake: ACK fa5cbf2 Tree-SHA512: e85fca4ca9d2615ddd2544403485e06885769a3f70bca297e23eefda2a1d28f47c5271f6adfa6ce0e5e972335c78098b76e0db4b109f59d0986bf508cef7528f
2 parents 4bb840a + fa5cbf2 commit bf3b589

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.cirrus.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ base_template: &BASE_TEMPLATE
2929
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
3030
- git fetch $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
3131
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts
32+
# Also, the merge commit is used to lint COMMIT_RANGE="HEAD~..HEAD"
3233

3334
main_template: &MAIN_TEMPLATE
3435
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out

ci/lint/06_script.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
export LC_ALL=C
88

9-
GIT_HEAD=$(git rev-parse HEAD)
109
if [ -n "$CIRRUS_PR" ]; then
11-
COMMIT_RANGE="${CIRRUS_BASE_SHA}..$GIT_HEAD"
10+
COMMIT_RANGE="HEAD~..HEAD"
1211
echo
1312
git log --no-merges --oneline "$COMMIT_RANGE"
1413
echo

0 commit comments

Comments
 (0)