-
Notifications
You must be signed in to change notification settings - Fork 240
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
Check a PR has been committed using git signoff #439
Conversation
Pre-merge build fails without seeing a `-s` signoff from anyone committing to a PR. If the author of a commit adds a single commit with a `-s`, that will be sufficient for the pre-merge build to pass. Signed-off-by: Tim Liu <[email protected]>
build |
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.
We may need to think a bit more about how to handle signoff checking and multiple commits. Looks like the current algorithm short-circuits to true if any commit has a signoff. However there are situations where this can lead to a false-positive (e.g.: branch contains merged commits from another branch that has at least one signoff but other, non-merged commits do not).
@NvTimLiu what are the plans for this? I'd like to see it go in, and I am happy to fix the spelling issue later if you don't have time right now to do it. |
build |
@revans2 are we going with only one signoff commit required per PR? Seems this logic would greenlight a PR with 20 commits where only 1 commit has the signoff. |
@jlowe I am fine with that, and we can change it in the future if we need to. |
"Any contribution which contains commits that are not signed off will not be accepted." https://github.com/NVIDIA/spark-rapids/blob/branch-0.2/CONTRIBUTING.md |
So I cannot upmerge without signing off on the merge commit? What if the github merge commit did not have a sign-off on it? Think about the case of merging a commit from one branch to another. I understand what the document says. We wrote that document. |
Shouldn't be too long before all the commits pulled in by a merge will have signoffs, but it could be a problem in the short term. Agree this is better than what we have today which is no checks. Let's go with this and file a followup to either tighten the checks or update the docs. |
I'm definitely fine with that as like you said its better the no checks |
Co-authored-by: Jason Lowe <[email protected]>
build |
1 similar comment
build |
Appears the CI build failed because the last commit doesn't have a signoff:
I'll dig a bit into why it didn't see the first commit in this PR which does have a signoff. |
jenkins/Jenkinsfile.premerge
Outdated
def signed_off = false | ||
for( String commit : revs_arr ) { | ||
def signed_log = sh(returnStdout: true, | ||
script: "git show ${commit} --shortstat | grep 'Signed-off-by'") |
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.
I think there's an issue here where if grep
fails to find a match it will return a non-zero exit code. That in turn will cause the pipeline command to return a non-zero exit code which will cause the sh
command to throw an exception as described here. I think this either needs to use the returnStatus: true
option and switch off the result code of the step or do something like this to avoid grep
failing to match to cause a pipeline failure:
script: "git show ${commit} --shortstat | grep 'Signed-off-by'") | |
script: "git show ${commit} --shortstat | grep 'Signed-off-by || echo'") |
build |
build |
Sorry for the delayed response, I was off for personal issue last week. Fixed the @jlowe @revans2 Do you mean we need to make sure the "Signed-off-by" tag exists in every commit? I've learned from Sameer @sameerz that we can PASS the pre-merge build only if one of the PR commits(instead of all commits) have a |
* Check a PR has been committed using git signoff Pre-merge build fails without seeing a `-s` signoff from anyone committing to a PR. If the author of a commit adds a single commit with a `-s`, that will be sufficient for the pre-merge build to pass. Signed-off-by: Tim Liu <[email protected]> * Update jenkins/Jenkinsfile.premerge Co-authored-by: Jason Lowe <[email protected]> * Append '|| true' to avoid failing to match to cause the pipeline failure Co-authored-by: Tim Liu <[email protected]> Co-authored-by: Sameer Raheja <[email protected]> Co-authored-by: Jason Lowe <[email protected]>
* Check a PR has been committed using git signoff Pre-merge build fails without seeing a `-s` signoff from anyone committing to a PR. If the author of a commit adds a single commit with a `-s`, that will be sufficient for the pre-merge build to pass. Signed-off-by: Tim Liu <[email protected]> * Update jenkins/Jenkinsfile.premerge Co-authored-by: Jason Lowe <[email protected]> * Append '|| true' to avoid failing to match to cause the pipeline failure Co-authored-by: Tim Liu <[email protected]> Co-authored-by: Sameer Raheja <[email protected]> Co-authored-by: Jason Lowe <[email protected]>
Signed-off-by: spark-rapids automation <[email protected]>
Pre-merge build fails without seeing a
-s
signoff from anyone committing to a PR.If the author of a commit adds a single commit with a
-s
, that will be sufficient for the pre-merge build to pass.2, Only update Jenkins scripts, no source change. No unit tests needed.
3, No Github issue related to the PR.