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

Make previous version optional in release_pull_request.bash #1013

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Sep 14, 2023

This also adds some documentation

This also adds some documentation

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
source-repo-scripts/release_pull_request.bash Outdated Show resolved Hide resolved
exit 1
fi

set -e

git fetch --tags
PREV_VER=$(git describe --tags --abbrev=0 | sed 's/.*_//')
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm tempted to try to use the TO_BRANCH variable here to try to make sure we identify a tag that matches the major version of our target branch, though it may not be necessary. Feel free to ignore this suggestion.

Suggested change
PREV_VER=$(git describe --tags --abbrev=0 | sed 's/.*_//')
PREV_VER=$(git describe --tags --match ${TO_BRANCH}* --abbrev=0 | sed 's/.*_//')

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

#
# Requires the 'gh' CLI to be installed.
#
# Usage:
# $ ./merge_forward_pull_request.bash <from_branch> <to_branch>
# $ ./release_pull_request.bash <from_branch> <to_branch>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# $ ./release_pull_request.bash <from_branch> <to_branch>
# $ ./release_pull_request.bash <new_version> <to_branch>

Not fully convinced that the name to_branch is the best one to use here. Maybe base_branch? Feel free to ignore.

#
# For example, to merge `ign-rendering6` forward to `main`:
# For example, to release `gz-rendering7` 7.1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# For example, to release `gz-rendering7` 7.1.0
# For example, to release 7.1.0 using the `gz-rendering7` branch

I'm trying to match order and concepts defined in the help usage.

exit 1
fi

set -e

git fetch --tags
PREV_VER=$(git describe --tags --abbrev=0 | sed 's/.*_//')
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@@ -44,7 +49,10 @@ CURRENT_BRANCH="${REMOTE}:${LOCAL_BRANCH}"
ORIGIN_URL=$(git remote get-url origin)
ORIGIN_ORG_REPO=$(echo ${ORIGIN_URL} | sed -e 's@.*github\.com.@@' | sed -e 's/\.git//g')

PREV_TAG=$(git tag | grep "_${PREV_VER}$")
if [[ $PREV_VER == $VERSION ]] then
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if [[ $PREV_VER == $VERSION ]] then
if [[ "$PREV_VER" == "$VERSION" ]]; then

Beware, this has a broken syntax

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.

3 participants