-
Notifications
You must be signed in to change notification settings - Fork 660
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
release: add release script #903
base: main
Are you sure you want to change the base?
Conversation
0b369bb
to
7649a72
Compare
@Elbehery, we don't have a |
7649a72
to
d35e27d
Compare
done 👍🏽 .. so it was mainly adding |
50ecec3
to
ff51289
Compare
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.
Thanks for the pull request, @Elbehery. I left some comments ✌️
scripts/release.sh
Outdated
echo "committing version.go" | ||
git commit -s -m "Update version to ${VERSION}" | ||
|
||
git push -u origin "${BRANCH}" |
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.
If we're allowing to override REPOSITORY
with an environment variable, we could also receive a REMOTE
, and replace the origin
instances with "${REMOTE}"
.
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.
makes perfect sense
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.
done 👍🏽
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.
iiuc, you want to have user-input for the remote name, correct ?
I just think, the PR has to be created from origin to upstream anyways
please correct me if I'm wrong
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 meant:
REMOTE="${REMOTE:-origin}"
Then later:
git push -u "${REMOTE}" "${BRANCH}"
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.
origin
is the name of the default remote. That's why I would call it "REMOTE" rather than "ORIGIN".
By the way, you missed changing it in line 59 (https://github.com/etcd-io/bbolt/pull/903/files#diff-1bba00e5aca52286a667c09eff92ba2ca8e3ca77e0d31b0599cc829ab0173389R59)
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.
thx for quick review 👍🏽
on it
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 meant:
REMOTE="${REMOTE:-origin}"
Then later:
git push -u "${REMOTE}" "${BRANCH}"
so I create a branch like this
date_string=$(date +%Y%m%d)
local_branch_name="version_${date_string}"
I use this branch to push the changes
git push -u -f "${REMOTE}" "${local_branch_name}"
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.
updated 👍🏽
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.
ran it again now after changes
./scripts/release.sh version_20250213
enter release string according to semantic versioning (e.g. v1.2.3).
v1.4.0-beta.20
fatal: a branch named 'version_20250213' already exists
Updating version from '1.4.0-alpha.0' to '1.4.0-beta.20' in 'version.go'
committing 'version.go'
[version_20250213 c3d9930] Update version to 1.4.0-beta.20
1 file changed, 1 insertion(+), 1 deletion(-)
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 12 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 376 bytes | 376.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To github.com:Elbehery/bbolt.git
+ 2e41368...c3d9930 version_20250213 -> version_20250213 (forced update)
branch 'version_20250213' set up to track 'origin/version_20250213'.
'version.go' has been committed to remote repo.
Creating new tag for 'v1.4.0-beta.20'
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To github.com:Elbehery/bbolt.git
* [new tag] v1.4.0-beta.20 -> v1.4.0-beta.20
Tag 'v1.4.0-beta.20' has been created and pushed to remote repo.
SUCCESS
ff51289
to
17b4956
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Elbehery The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
f10036b
to
5a05933
Compare
the last run after updates
|
e24ec75
to
9afab2b
Compare
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
9afab2b
to
fe76a05
Compare
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.
Thanks for the changes, @Elbehery. Sorry if there has been a lot of back and forth. I should have tested your script locally (apologies). Thanks again :)
echo "committing 'version.go'" | ||
git add ./version/version.go | ||
git commit -s -m "Update version to ${VERSION}" | ||
git push -u -f "${REMOTE}" "${local_branch_name}" |
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 suggest removing the force. If we're pushing to the etcd-io remote, it should not be a good idea to force it (it may even be good to fail if it fails to push).
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.
so iiuc, this script creates a branch in origin
, to be used to create a PR against upstream
I don't think the script should push directly to etcd-io
repos, please correct me if I'm wrong
git tag -f "${INPUT}" | ||
git push -f "${REMOTE}" "${INPUT}" |
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.
Here, too. I suggest removing the force.
# creating a branch to bump 'version.go'. | ||
date_string=$(date +%Y%m%d) | ||
local_branch_name="version_${date_string}" | ||
local_branch_err=$(git checkout -b "${local_branch_name}" | grep -E "error|fatal" || true ) | ||
if [[ -n "${local_branch_err}" ]]; then | ||
echo "${local_branch_err}" | ||
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.
I tested your script locally, and it works. However, I think creating a branch and creating the tag against the commit from that branch is conceptually wrong. I believe the right way would be to push straight to the release-${VERSION_MINOR}
branch (which is where the script should have been executed from) so the tag and the commit belong to that branch.
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 see, now I got what u mean
so we execute the script from the local release-${VERSION_MINOR}
branch
iiuc, this should pushed to a fork, which then used to create a PR against upstream, or ?
git checkout -q "tags/${INPUT}" | ||
elif [ "${remote_tag_exists}" -eq 0 ]; then | ||
echo "Creating new tag for '${INPUT}'" | ||
git tag -f "${INPUT}" |
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 we want to GPG sign the tag in this repository, too? I don't think we've been doing it, but it may be easier with the script in place. What do you think, @ahrtr?
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 we want to GPG sign the tag in this repository, too?
I think so. It's exactly what I have been doing (manually).
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.
@ahrtr should the script
- pushes a branch with the changes and new tag to a fork (origin)
- pushes the changes directly to upstream (etcd-io) release branch (e.g. release-1.4)
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 the latter, else the tag would be in a fork, and we'll need to manually tag the upstream later.
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.
A gentle reminder, @ahrtr. I think we're just waiting for confirmation on this.
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.
Yes, we should push the changes to upstream etcd-io/bbolt
directly. But please ensure you verify this in your forked repo firstly. I. believe @ivanvc did similar work lots of times.
This PR adds
release.sh
script to automate the process of releasingbbolt
repo.resolves #896
Below is output of
release.sh
run