Calling the script .github/ci-test-each-commit-exec.sh
, which merges master
, obviously doesn’t work, if the script itself is missing.
Fix it by a move-only to first merge master
and then call the script.
Calling the script .github/ci-test-each-commit-exec.sh
, which merges master
, obviously doesn’t work, if the script itself is missing.
Fix it by a move-only to first merge master
and then call the script.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32218.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
79 - run: |
80 sudo apt-get update
81 sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y
82 - name: Compile and run tests
83 run: |
84 # Run tests on commits after the last merge commit and before the PR head commit
${{ env.TEST_BASE }}
, which I am not changing in this pull.
Run tests on commits after the last merge commit and before the PR head commit
This sounds to me like a more verbose explanation for ci-test-each-commit
.
21 cmake --build build -j "$( nproc )" && ctest --output-on-failure --stop-on-failure --test-dir build -j "$( nproc )"
22
23 ./build/test/functional/test_runner.py -j $(( $(nproc) * 2 )) --combinedlogslen=99999999
24
25-git merge --abort
26+git merge --abort || echo "Nothing to abort. The state was already up to date."
if we need to keep this change, maybe mention that the abort is related to merging
Yes, the abort in git merge --abort
is related to merging. I think the code is self-explanatory.
The CI log is also self-explanatory, because the code will print itself before being executed (xtrace
).
You can see this by reading the CI logs of this pull and the one I linked to earlier.
81 sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y
82 - name: Compile and run tests
83 run: |
84 # Run tests on commits after the last merge commit and before the PR head commit
85- git rebase --exec "./.github/ci-test-each-commit-exec.sh" ${{ env.TEST_BASE }}
86+ git rebase --exec "git merge --no-commit origin/${GITHUB_BASE_REF} && ./.github/ci-test-each-commit-exec.sh" ${{ env.TEST_BASE }}
we’re setting the author info in a separate step above - we could localize it as:
0 git rebase --exec "GIT_COMMITTER_NAME="CI" GIT_COMMITTER_EMAIL="ci@ci.com" git merge --no-commit origin/${GITHUB_BASE_REF} && ./.github/ci-test-each-commit-exec.sh" ${{ env.TEST_BASE }}
given that we initiate the merge here, would it make sense to do the abort here as well? And maybe we could do a reset
instead which works regardless of whether we’re already up-to-date or not, e.g.:
0 git rebase --exec "git merge --no-commit origin/${GITHUB_BASE_REF} && ./.github/ci-test-each-commit-exec.sh && git reset --hard" ${{ env.TEST_BASE }}
0# GIT_COMMITTER_NAME="CI" GIT_COMMITTER_EMAIL="ci@ci.com" git merge master --no-commit
1Automatic merge went well; stopped before committing as requested
2
3# git status
4On branch feature
5All conflicts fixed but you are still merging.
6 (use "git commit" to conclude merge)
7
8Changes to be committed:
9 new file: xyz.txt
10
11# git reset --hard
12HEAD is now at f7c4340 first 6
13
14# git status
15On branch feature
16nothing to commit, working tree clean
Happy to review a follow-up doing this refactor, if people want it. However, I currently don’t have the time to try if it works and if it is better.
edit: I tested this and it works locally, so it may work when I push it.
Happy to push it, if this is the last blocker for you.
Happy to push it, if this is the last blocker for you.
yes, only the things I’ve posted
ci-test-each-commit-exec.sh
returns with an error?
master
branch has to be cloned and stored for this. Storing a dummy name and email is harmless in any case.
should we reset if
ci-test-each-commit-exec.sh
returns with an error?
Why? The CI will discard itself after failure
That’s why I asked, my understanding was that it doesn’t matter.
What about in case of merge conflict, what is the expected outcome, should the script still be executed?
And the script only measures a single commit, not “each commit”, is the naming deliberate?
I have a slight preference for the current way. Also, It is extremely tedious and time consuming to test the changes here remotely on GitHub in a separate repo on every tiny change. So I’ll leave this as-is.
If there is need for this refactor, it can be done in the future.
I am not changing the name of the script here, so it is unrelated and can be changed in a separate pull, if needed.
The name of the script simply includes the task name.
What about in case of merge conflict, what is the expected outcome, should the script still be executed?
No. Why? The CI will discard itself after it failed after a merge conflict, so there is no need to delay and execute anything.
I wonder how this new requirement will perform for heavy refactors - but overall it’s a good change!
See #32203 (comment)
* Run git config earlier and only once
* Run git merge in the yaml, before calling the bash script
* Run git reset in the yaml as well, for symmetry
* Replace "git merge --abort" with "git reset --hard", because it does
not fail when already up to date and no merge was started.
Code review ACK fa10a1ded5b747e9db6d6c1942fceb279f1abedc
Would prefer the scope reduction suggested in #32218 (review) as well, but I think the current version is already better than before
edit: I haven’t tested the merge conflict or test failures scenarios
Force pushed for new CI run in the remote repo: https://github.com/maflcko/bitcoin-core-with-ci/actions/runs/14268201238/job/39995098276?pr=6
(no changes here)
0> ~~~~