-
Notifications
You must be signed in to change notification settings - Fork 692
release: Switch branch to stable branch from script #980
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
@ivanvc nice work 👍🏽 Could we test it, and paste the test output here 🤔 |
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 we also need to check whether the working directory is clean, error out if not.
scripts/release.sh
Outdated
# Checkout release branch and ensure to return to the current reference after | ||
# the release finishes. | ||
PREVIOUS_REF=$(git rev-parse HEAD) | ||
if git symbolic-ref HEAD &>/dev/null; then | ||
PREVIOUS_REF=$(git symbolic-ref HEAD | rev | cut -d/ -f1 | rev) | ||
fi |
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.
suggest to keep it as simple as possible
# Checkout release branch and ensure to return to the current reference after | |
# the release finishes. | |
PREVIOUS_REF=$(git rev-parse HEAD) | |
if git symbolic-ref HEAD &>/dev/null; then | |
PREVIOUS_REF=$(git symbolic-ref HEAD | rev | cut -d/ -f1 | rev) | |
fi |
scripts/release.sh
Outdated
# shellcheck disable=SC2064 # Intentionally expanding PREVIOUS_REF now. | ||
trap "git checkout ${PREVIOUS_REF}" EXIT |
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.
ditto
# shellcheck disable=SC2064 # Intentionally expanding PREVIOUS_REF now. | |
trap "git checkout ${PREVIOUS_REF}" EXIT |
Based on the current implementation, you can release bbolt on any forked repo. Suggest to follow the same approach as etcd.
|
Another related comment on checking whether tag exists or not (see below), I think it should be a little better to follow the same approach/command as etcd to ensure exact match. Otherwise it will run into the corner case when releasing the very first minor version. For example, when releasing v1.5.0, the v1.5.0-alpha.0 might have already exist, then current script will think the tag v1.5.0 already exist Lines 36 to 40 in a129a9e
|
Create a stage directory in the temp file system, and clone the repository there. Signed-off-by: Ivan Valdes <ivan@vald.es>
Make it consistent with other of our release scripts. Signed-off-by: Ivan Valdes <ivan@vald.es>
Check for the actual tag by an explicit query, rather than listing all tags available at the repository. Signed-off-by: Ivan Valdes <ivan@vald.es>
ff867b4
to
a5955bd
Compare
I applied the suggestions. Therefore, this pull request grew in size, as it needed some refactoring. I verified running the script by pointing to my fork. i.e.,
Note that this is a fictional 1.4.3 version, that branch is not up to date with the upstream. |
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 & thx
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, ivanvc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Follow up from #903 (comment)
Switch branches to avoid backporting and maintaining the release script in each of the stable release branches.
/cc @ahrtr @Elbehery