-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update versions on stable branch #259
Conversation
The maven action plugin used to only be able to update the version on the default branch of the repository. Recently a change has been made to make the branch configurable. For this reason a step has been introduced to the workflow to decide our git branch. It works by first figuring out what the major and minor version of the release are (e.g. 1.4 when the release is 1.4.1). If this fails to yield a result we exit the workflow. Otherwise we will add the branch (stable/major.minor) as an output of this step. This will then be used by the community-action-maven-release as the branch for updating the versions.
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 👍
Thanks for the comprehensive description of the problem and how it was solved. Complicated stuff, but it makes all sense to me now. Nice work! 👏
I only have 1 question about the case where the release is run from the main
branch.
# to stable/major.minor. | ||
- name: Decide git branch | ||
id: branch | ||
if: github.ref != 'refs/head/main' |
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.
❓ What happens if gihub.ref
equals refs/head/main
? Can line 148 then set branch or does it just set it to null or so?
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.
That's a good point. It does not set anything, but it should set it to the default branch. Thanks for finding this bug 😄
We would only decide the git branch when the workflow was not triggered by a new release. When it was triggered by a push to the main branch it would not be set. The community-action-maven-release does require the branch to contain a value. This means we need to set it for the main branch to the default branch.
@korthout I know you already approved it last time, but it'd be great if you could have a look at the latest fix I did. |
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.
Awesome! Thanks @remcowesterhoud LGTM 🥳
Update versions on stable branch
Description
The maven action plugin used to only be able to update the version on the default branch of the repository. Recently a change has been made to make the branch configurable. For this reason a step has been introduced to the workflow to decide our git branch.
It works by first figuring out what the major and minor version of the release are (e.g. 1.4 when the release is 1.4.1). If this fails to yield a result we exit the workflow. Otherwise we will add the branch (stable/major.minor) as an output of this step. This will then be used by the community-action-maven-release as the branch for updating the versions.
I've done some manual test to verify the workflow works as expected. I did this by creating a
stable/0.0
branch and creating some test release. I have deleted this branch and the releases by now, but the workflows are still available:stable/0.0
with tag0.0.1
: https://github.com/camunda/zeebe-process-test/runs/5553684537?check_suite_focus=trueExpected the workflow to create new commits updating the version on the
stable/0.0
branch. ✅stable/0.0
with tagrelease-0
: https://github.com/camunda/zeebe-process-test/runs/5554164842?check_suite_focus=trueExpected the workflow to fail, mentioning how the tag does not adhere to semantic versioning. ✅
stable/0.0
with tag0.0.1-alpha1
: https://github.com/camunda/zeebe-process-test/runs/5554214263?check_suite_focus=trueExpected the workflow to create new commits updating the version on the
main
branch.The test did not match the expectation. No new commits were created. After analysing why, the reason is that the release was created on the
stable/0.0
branch. The community-action-maven-release has a check to see if the release tag is pointing to the latest commit on the target branch (main
). This was not the case in my test, so my expectations were wrong. I can see in the logging that the correct branch (main
) is being used. If the release would've been made on themain
branch the workflow would've succeeded. Therefore, I consider this test a succes ✅Related issues
closes #231
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
Testing:
Documentation: