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

Update versions on stable branch #259

Merged
merged 2 commits into from
Mar 24, 2022
Merged

Update versions on stable branch #259

merged 2 commits into from
Mar 24, 2022

Conversation

remcowesterhoud
Copy link
Contributor

@remcowesterhoud remcowesterhoud commented Mar 15, 2022

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:

Related issues

closes #231

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually

Documentation:

  • Javadoc has been written
  • The documentation is updated

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.
@github-actions
Copy link

Unit Test Results

128 files  128 suites   5m 59s ⏱️
325 tests 325 ✔️ 0 💤 0
788 runs  788 ✔️ 0 💤 0

Results for commit 6b60d86.

Copy link
Member

@korthout korthout left a 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'
Copy link
Member

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?

Copy link
Contributor Author

@remcowesterhoud remcowesterhoud Mar 23, 2022

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.
@remcowesterhoud
Copy link
Contributor Author

@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.

Copy link
Member

@korthout korthout left a 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 🥳

@remcowesterhoud remcowesterhoud merged commit 032e4ff into main Mar 24, 2022
remcowesterhoud added a commit that referenced this pull request Mar 24, 2022
Update versions on stable branch
@remcowesterhoud remcowesterhoud deleted the 231_stable_branch branch April 7, 2022 12:04
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.

Deploy workflow stable branch compatibility
2 participants