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

Enhance the bump_version.sh script #43

Merged
merged 6 commits into from
Sep 24, 2024

Conversation

mcdonnnj
Copy link
Member

@mcdonnnj mcdonnnj commented Sep 24, 2024

🗣 Description

This pull request does the following:

  • Rename the bump_version.sh script to bump-version.
  • Update the bump-version script to provide more functionality, including:
    • Bump the prerelease version when bumping the major, minor, or patch version. This allows you to bump from 0.0.1 to 0.1.0-rc.1 in one command for example.
    • Make the git push opt-in as an option.
    • Change the label used when bumping the build or prerelease versions. This allows you to generate a 0.0.1+dev.1 or a 0.1.0-alpha.1 with the script.
  • Make the usage information more useful and add explicit flags to get help information.

💭 Motivation and context

I have wanted to update this script to remove some of the pain points I have with it such as having to run it twice to generate a prerelease of a new version. This seemed like as good a time as any to do so.

🧪 Testing

Automated tests pass. I used it to update the version in this pull request. I then used the prerelease version I published from this branch in my modified local cisagov/cyhy_amis and cisagov/skeleton-packer repositories and confirmed things work as expected from previously merged pull requests.

✅ 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 relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Finalize version.

✅ Post-merge checklist

  • Create a release.

This updates the script to allow you to simultaneously bump the
prerelease with the major, minor, or patch versions; de-duplicates
logic for modifying and committing files; allows you to set the label
used when bumping the build or prerelease versions; and makes
performing a `git push` an optional flag.
Adjust the usage information to document some new options, make the
command name in the usage based on the file name for the script, and
add explicit help flags.
This treats this script like the `setup-env` script already present.
@mcdonnnj mcdonnnj added breaking change This issue or pull request involves changes to existing functionality improvement This issue or pull request will add or improve functionality, maintainability, or ease of use labels Sep 24, 2024
@mcdonnnj mcdonnnj requested a review from a team September 24, 2024 20:46
@mcdonnnj mcdonnnj self-assigned this Sep 24, 2024
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.

Love all of these quality of life improvements! Thanks for doing these. 👍 👍 👍

bump-version Outdated Show resolved Hide resolved
bump-version Show resolved Hide resolved
A reference in the script was not updated when the script had its name
changed.

Co-authored-by: dav3r <david.redmin@trio.dhs.gov>
@mcdonnnj mcdonnnj merged commit 35958fb into develop Sep 24, 2024
4 checks passed
@mcdonnnj mcdonnnj deleted the improvement/enhance_bump_version_script branch September 24, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This issue or pull request involves changes to existing functionality improvement This issue or pull request will add or improve functionality, maintainability, or ease of use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants