-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25018] [Infra] Use Co-authored-by and Signed-off-by git trailer in merge_spark_pr.py
#21991
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
Conversation
|
There are couple other common used git trailers used in linux community, https://git.wiki.kernel.org/index.php/CommitMessageConventions We may consider to add |
Co-Authored-By git trailer in merge_spark_pr.pyCo-authored-by and Signed-off-by git trailer in merge_spark_pr.py
dev/merge_spark_pr.py
Outdated
| # The string "Closes #%s" string is required for GitHub to correctly close the PR | ||
| merge_message_flags += ["-m", "Closes #%s from %s." % (pr_num, pr_repo_desc)] | ||
|
|
||
| authors = "\n".join(["Co-authored-by: %s" % a for a in distinct_authors]) |
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.
For single author commit, should we do Authored-by instead of Co-authored-by?
Or we can have the first author as Authored-by like the following.
Authored-by: David <[email protected]>
Co-authored-by: Bill <[email protected]>
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.
or leave it as before Author: to be safe?
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 these particular keys have a meaning to github or other tools? if "Author:" is what something is looking for, we'd want to leave it, I presume. But adding more lines for co-authors seems fine. I would have just listed multiple "Author:" lines, but sounds like there's another convention around "Co-authored-by:" that another tool looks for?
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.
Seems that those keys are widely used in Linux community for a long time, and Github adopted Co-authored-by to include the work of cu-authoers in the profile contributions graph and the repository's statistics.
This has to be in the end of the message, and Github will just ignore those keys that are not recognized.
If we want to keep both multiple lines of Author: and Co-authored-by:, the information will be duplicated twice. I would like to purpose to just keep Co-authored-by:. For single developer commit, we can just use Authored-by: for consistency.
|
Test build #94161 has finished for PR 21991 at commit
|
|
Test build #94181 has finished for PR 21991 at commit
|
|
+1 |
|
Jenkins, retest this please |
felixcheung
left a comment
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.
SGTM
|
Test build #94204 has finished for PR 21991 at commit
|
|
Test build #94265 has finished for PR 21991 at commit
|
|
retest this please |
Empty commit to test 'Co-authored-by' and 'Signed-off-by'
|
@HyukjinKwon Thanks for pushing a test. I used this script to merge this PR into my own repo. Here is the result. https://github.com/dbtsai/spark/commits/PR_TOOL_MERGE_PR_21991_MASTER As you can see, three authors are properly shown in git status. I also tested it with single author PR, and here is the result. dbtsai@16dd571 |
|
Test build #94284 has finished for PR 21991 at commit
|
|
Test build #94295 has finished for PR 21991 at commit
|
|
Test build #94305 has finished for PR 21991 at commit
|
Add manually given primary author at the head of author list
| primary_author = distinct_authors[0] | ||
| else: | ||
| # When primary author is specified manually, put it at the head of author list. | ||
| distinct_authors.insert(0, primary_author) |
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.
@viirya good catch. When we put it at the head of the author list, do we need to dedupe it again?
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 gave it a thought, but didn't do it. If you think it is necessary, I will push another commit for it.
|
Test build #94299 has finished for PR 21991 at commit
|
|
Test build #94310 has finished for PR 21991 at commit
|
HyukjinKwon
left a comment
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.
LGTM
|
retest this please |
|
@HyukjinKwon thanks! Is it possible to use this script to merge this PR which has many people involve? A good demonstration of collaboration in the community. |
|
Yes, I think so. I was about to merge this in that way :-). Seems to me we are good to merge now since the current change is only checked by Python lint which is already passed. |
|
Test build #94322 has finished for PR 21991 at commit
|
|
Let me leave it to you @dbtsai. I thought you live in a timezone completely different with me. |
|
Merged to master. |
|
51bee7a looks good :-) |
|
Test build #94324 has finished for PR 21991 at commit
|
|
The failed test is |
|
Test build #94323 has finished for PR 21991 at commit
|
|
Test build #94329 has finished for PR 21991 at commit
|
|
Thanks all! |
What changes were proposed in this pull request?
In Linux community,
Co-authored-byandSigned-off-bygit trailer have been used for awhile.Until recently, Github adopted
Co-authored-byto include the work of co-authors in the profile contributions graph and the repository's statistics. It's a convention for recognizing multiple authors, and can encourage people to collaborate in OSS communities.Git provides a command line tools to read the metadata to know who commits the code to upstream, but it's not as easy as having
Signed-off-byas part of the message so developers can find who is the relevant committers who can help with certain part of the codebase easier.For a single author PR, I purpose to use
Authored-byandSigned-off-by, so the message will look likeFor a multi-author PR, I purpose to use
Lead-authored-by:andCo-authored-by:for the lead author and co-authors. The message will look likeIt's also useful to include
Reviewed-by:to give credits to the people who participate on the code reviewing. We can add this in the next iteration.