Compile all commits of a PR branch #13688
Conversation
7524db4 to
9464c54
Compare
.github/workflows/ci.yml
Outdated
There was a problem hiding this comment.
Can you show an example of failure for a non-head commit? Would it be easy enough to identify which commit failed?
Also, I don't think we want to run all checks on all commits except the head. We only want to make sure other commits compile.
bafff60 to
1b6b936
Compare
484415c to
7d40c52
Compare
.github/workflows/ci.yml
Outdated
There was a problem hiding this comment.
Git rebase needs an identity to assign to commits. I'm using the identity from the top commit in the PR.
There was a problem hiding this comment.
Provide any random identity - doesn't matter since we won't use the results.
1f9e9e4 to
6182350
Compare
.github/workflows/ci.yml
Outdated
There was a problem hiding this comment.
Rebasing on origin/master instead of PR head means that the commit hashes for the rebased result may change (since other PRs could've been merged in meantime) and users will have harder time to figure out which commit caused compilation failure.
Also not every PR is open against master - they can target different branches as well.
There was a problem hiding this comment.
There are examples elsewhere in this workflow how to get current PRs head
92d0660 to
a641169
Compare
8fe57f0 to
a641169
Compare
0c6ec81 to
9284850
Compare
.github/workflows/ci.yml
Outdated
There was a problem hiding this comment.
What's the purpose of this?
BTW, compile-all-commits@trino.org is not a valid email.
There was a problem hiding this comment.
git rebase needs an identity to tag rebased commits with.
These commits will be discarded at the end, but the important part is that git rebase will run whatever is passed in --exec between all commits
There was a problem hiding this comment.
Does it need to be a real email? Can it be a string such as "dummy", "nobody", "empty"?
There was a problem hiding this comment.
I'm not sure if git validates this, but I finally noticed you probably meant that trino.org is not the Trino domain trino.io
There was a problem hiding this comment.
git doesn't validate it - any non-empty value works.
.github/workflows/ci.yml
Outdated
There was a problem hiding this comment.
The ordering depends on which branch is merged into which, but I think I found a less complicated way to do this.
9284850 to
3249cbb
Compare
.github/workflows/ci.yml
Outdated
There was a problem hiding this comment.
You can count the commits from merge-base to HEAD and if there is just 1 skip the rebase?
git rev-list --count start~..end
There was a problem hiding this comment.
The version you saw doesn't contain a git checkout HEAD~ which drops the top PR commit.
By doing so, if the PR branch is only 1 commit, HEAD ends up pointing to a commit that is already on the base branch and rebase turns into a no-op.
There was a problem hiding this comment.
Nice, this is much simpler now.
6223a2e to
2e2ccc9
Compare
|
@martint Could you take another look? Is this merge-worthy? |
|
@martint Could I request some feedback on this PR? |
|
Do you have some CI runs with this within your fork? |
I've pushed changes in 3 commits so we can see it in action. We can squash everything before merge. |
|
(remember to squash before merge) |
|
One this which verbose is showing is that it seems we are running compilation for alternate commits only? i.e. I see maven log output only for some steps of the rebase. Is there some way to verify it is indeed running compilation for each commit? |
With Compilation happens on even-numbered steps. |
|
Ah, that clears it up for me. I did not realise the numbers are for each "action" instead of commit - it makes total sense though why it looks like it does. Thankfully with |
|
@MiguelWeezardo Please squash after you have a green run with the latest changes. It's good to be merged now. |
|
@hashhar I think we're all set. Could you merge? |
|
@MiguelWeezardo Sorry for one more comment. Do you think it's be useful to print |
Description
To make automated git bisect work better, we need to make sure all commits in a PR are at least compiling.
This change calls Maven install for all commits between master and the PR branch.
This is an improvement of build stability.
This is a change in the CI pipeline.
Related issues, pull requests, and links
Documentation
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
(x) No release notes entries required.
( ) Release notes entries required with the following suggested text: