-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-24651 release script utils should set local user when GPG_KEY is defined. #1992
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
Just some observations.
@@ -20,6 +20,9 @@ DRY_RUN=${DRY_RUN:-1} #default to dry run | |||
DEBUG=${DEBUG:-0} | |||
GPG=${GPG:-gpg} | |||
GPG_ARGS=(--no-autostart --batch) | |||
if [ -n "${GPG_KEY}" ]; then |
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.
When is GPG_KEY
not set? The script builds up the @apache.org
email address, so it should always be available. Shouldn't that be an error case?
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.
no, in the case of directly running do-release.sh then GPG_KEY isn't defined when we source release-util.sh
. shortly thereafter we call get_release_info
, which sets GPG_KEY. (with this change we use GPG_KEY to update GPG_ARGS in that function)
@@ -20,6 +20,9 @@ DRY_RUN=${DRY_RUN:-1} #default to dry run | |||
DEBUG=${DEBUG:-0} | |||
GPG=${GPG:-gpg} | |||
GPG_ARGS=(--no-autostart --batch) | |||
if [ -n "${GPG_KEY}" ]; then | |||
GPG_ARGS=("${GPG_ARGS[@]}" --local-user "${GPG_KEY}") |
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.
Again, to my previous comments, I'm surprised this script identifies GPG identity via an email address/--local-user
. I expected that we'd manage everything via a key fingerprint/--default-key
.
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.
it doesn't identify the gpg identity necessarily via email address. --local-user
takes the name of a key, the same as --default-key
does. that name can be a keyid, email address, or fingerprint. the --local-user
option is defined as "I specifically want you to use this identity to sign" and overrides any given default. IMO that better fits our usage because we expressly want to sign with this key.
If the release manager has multiple private keys defined and wants to use one for running a release that isn't configured to be the default then currently the release scripts will use the selected gpg key when doing the test signing but will fall back to using whatever is configured as the default when signing the source and binary tarballs.
this PR changes when we define the local user arg for gpg so that it is defined whenever we have GPG_KEY defined. tested both using
do-release-docker.sh
and directly withdo-release.sh
.