Skip to content
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

CONTRIB: Automate AUTHORS file update #10308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tvegas1
Copy link
Contributor

@tvegas1 tvegas1 commented Nov 19, 2024

What?

Automate AUTHORS updates according to documentation.

Why?

Seems better to try to have common approach.

How?

$ ./contrib/authors_update.sh upstream/v1.17.x..upstream/v1.18.x
..
   Artemy Kovalyov <[email protected]>
++ Arun Chandran <[email protected]>
   Edgar Gabriel <[email protected]>
   Evgeny Leksikov <[email protected]>
..

Copy link
Contributor

@yosefe yosefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this script to CI, so that if new author is adding a commit and it is not in AUTHORS file, the CI fails?

@tvegas1
Copy link
Contributor Author

tvegas1 commented Nov 20, 2024

adding to CI imposes PR creators to have their commits under exact email, or name, could this become a problem at some point?

michal-shalev
michal-shalev previously approved these changes Nov 21, 2024
Copy link
Contributor

@michal-shalev michal-shalev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

contrib/authors_update.sh Outdated Show resolved Hide resolved
contrib/authors_update.sh Show resolved Hide resolved

if [ ! -w AUTHORS ]
then
echo "AUTHORS file not accessible"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not writable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, but -w also covers the case where file does not exist


set -eEu -o pipefail

range="${1?Provide commit range like orig/v1.17..orig/v1.18}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like -> , for example:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

lines=$(git log --no-merges --pretty=format:"%an%x09%ae" "$range" | sort | uniq)
if [ -z "$lines" ]
then
echo "Error: empty range \"$range\""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provided range is empty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

exit 1
fi

if [ "$(git log --no-merges --oneline "$range" | wc -l)" -eq 0 ]
# Failure message triggered if range is not valid
lines=$(git log --no-merges --pretty=format:"%an%x09%ae" "$range" | sort | uniq)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: add "-u" flag to sort instead of pipe to uniq

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants