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

Ensure the bump-version script can bump pre-releases #205

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

mcdonnnj
Copy link
Member

@mcdonnnj mcdonnnj commented Jan 6, 2025

🗣 Description

This pull request fixes a bug in the logic for checking the prerelease command that prevents one from successfully running ./bump-version prerelease. This resolves #204.

Note

Upon approval of this pull request I will open an equivalent pull request in cisagov/skeleton-packer since it uses the same version management script.

💭 Motivation and context

It is important to be able to bump just the pre-release version.

🧪 Testing

Automated tests pass. I also verified that the command checking logic worked as expected:

$ ./bump-version build prerelease
Changing the prerelease is only allowed in conjunction with the following commands: major minor patch
Update the version of the project.

Usage:
  bump-version [--push] [--label LABEL] (major | minor | patch | prerelease | build | finalize | show)
  bump-version --list-files
  bump-version (-h | --help)

Options:
  -h | --help    Show this message.
  --push         Perform a `git push` after updating the version.
  --label LABEL  Specify the label to use when updating the build or prerelease version.
  --list-files   List the files that will be updated when the version is bumped.
$ ./bump-version finalize prerelease
Changing the prerelease is only allowed in conjunction with the following commands: major minor patch
Update the version of the project.

Usage:
  bump-version [--push] [--label LABEL] (major | minor | patch | prerelease | build | finalize | show)
  bump-version --list-files
  bump-version (-h | --help)

Options:
  -h | --help    Show this message.
  --push         Perform a `git push` after updating the version.
  --label LABEL  Specify the label to use when updating the build or prerelease version.
  --list-files   List the files that will be updated when the version is bumped.
$ ./bump-version major prerelease
Changing version from 0.2.0 to 1.0.0
Changing version from 1.0.0 to 1.0.0-rc.1
$ ./bump-version minor prerelease
Changing version from 1.0.0-rc.1 to 1.1.0
Changing version from 1.1.0 to 1.1.0-rc.1
$ ./bump-version patch prerelease
Changing version from 1.1.0-rc.1 to 1.1.1
Changing version from 1.1.1 to 1.1.1-rc.1
$ ./bump-version prerelease
Changing version from 1.1.1-rc.1 to 1.1.1-rc.2

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

Currently there is a bug in the script's logic that prevents you from
running `./bump-version prerelease` to bump _just_ the prerelease. This
is due to faulty checking logic to ensure expected behavior when
combining bump commands.
@mcdonnnj mcdonnnj added the bug This issue or pull request addresses broken functionality label Jan 6, 2025
@mcdonnnj mcdonnnj requested a review from a team January 6, 2025 06:55
@mcdonnnj mcdonnnj self-assigned this Jan 6, 2025
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix on this! 👍

@mcdonnnj mcdonnnj added the kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release label Jan 10, 2025
@mcdonnnj mcdonnnj added this pull request to the merge queue Jan 12, 2025
Merged via the queue into develop with commit f26b47c Jan 12, 2025
17 checks passed
@mcdonnnj mcdonnnj deleted the bugfix/allow_bump-version_to_bump_prereleases branch January 12, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release
Projects
Development

Successfully merging this pull request may close these issues.

bump-version script does not allow bumping of just the pre-release version
4 participants