-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement [skip ci] for Jenkins #9554
Conversation
ac20f37
to
46b956c
Compare
tests/scripts/git_skip_ci.sh
Outdated
# headline | ||
|
||
if git log --format='%s' HEAD~1..HEAD | grep --quiet \ | ||
--regexp='\[skip ci\]' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is something new we are introducing, we could start with only one documented pattern rather than all these option variants, which makes a bit harder to manually grep on which commits in history didn’t run a full CI.
I am also a bit concerned on how we make sure that only exceptional changes that don’t really need CI will make use of this. As an extension, I wonder if Jenkins could somehow tag the PR with something when it detects the “skip ci” tag, so that it is obvious for reviewers that this didn’t run any checks, apart from lint.
Any idea on how to tackle these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on consolidating on a single trigger message like [skip ci]
for now. At some level we'd need to rely on committers / mergers knowing that [skip ci]
should only be applied to quick fixes and reverts to unbreak master which seems do-able. We could make it easier to tell without clicking by add a label like CI was skipped
to the PR (through GitHub Actions or (ideally) directly from Jenkins)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. To me, that is a must to have this PR in.
Another point, just to mention, is that we ideally would like to document it somewhere, so that it is clear for the community this is available and how to use it.
couple thoughts:
i'm also curious about @leandron's comment about flagging skipped PRs. |
b68189a
to
b980b76
Compare
b980b76
to
e93a905
Compare
Jenkinsfile
Outdated
script: './tests/scripts/git_skip_ci.sh', | ||
label: "Check if CI should be skipped", | ||
) | ||
// if (skip_ci == 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these comments be removed as they are duplicated below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry this was some work-in-progress code, I should have marked this as a draft since I'm still working on implementing the PR labeling aspect
af98484
to
1c3b526
Compare
There are some test usages here showing how skip is triggered (i.e. the CI on the first commit in that PR takes only a few minutes): #9686 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question here--also, we should push this to ci-docker-staging one final time i think. just checking that makes sense to you?
["commit", "--allow-empty", "--message", "[skip ci] commit 1"], | ||
], | ||
should_skip=True, | ||
why="ci should be skipped on a branch with [skip ci] in the last commit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a test for when [skip ci]
is in a commit but not in PR title? i don't think we should allow only the commit to have [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added one in 0710915
Confirming sounds good, it should be ready to push now |
387183e
to
1c47808
Compare
1c47808
to
b48f47b
Compare
b48f47b
to
d7b0cce
Compare
looks like the branch failed due to a flaky test. given passing tests linked from #9686, i think we can merge and be confident we aren't going to break the Jenkinsfile |
This reverts commit 9d867c2. Note: This PR is a test of the skip CI functionality from apache#9554. It was made with: ```bash git checkout -b revert_test git revert HEAD gh pr create --draft ```
This was inadvertently removed by apache#9554
This was inadvertently removed by #9554 Co-authored-by: driazati <[email protected]>
* Rebase * Fix missing skip Co-authored-by: driazati <[email protected]>
This was inadvertently removed by apache#9554 Co-authored-by: driazati <[email protected]>
* Rebase * Fix missing skip Co-authored-by: driazati <[email protected]>
This was inadvertently removed by apache#9554 Co-authored-by: driazati <[email protected]>
* Rebase * Fix missing skip Co-authored-by: driazati <[email protected]>
This was inadvertently removed by apache#9554 Co-authored-by: driazati <[email protected]>
GitHub Actions already respects this (link), this implements it for Jenkins as well. When
[skip ci]
is in the commit message of the head commit and in the PR title, the only things that will run are the sanity check + lint, so CI should be much quicker if someone manually sets this.This is useful for PRs that need to get landed quickly and the outcome is pretty well known, such as reverts (and should only be used in these situations). Tested in #9686
Also see the related forum discussion: https://discuss.tvm.apache.org/t/rfc-ci-add-a-skip-ci-tag-to-shortcut-builds-and-tests/11589/10
@areusch