feat(context): expose determined bump type in release context#1483
Open
ChihebBENCHEIKH1 wants to merge 1 commit intoorhun:mainfrom
Open
feat(context): expose determined bump type in release context#1483ChihebBENCHEIKH1 wants to merge 1 commit intoorhun:mainfrom
ChihebBENCHEIKH1 wants to merge 1 commit intoorhun:mainfrom
Conversation
8ee147e to
57ee25b
Compare
…1220) Add `bump_type` field to the `Release` struct so that templates can reference `{{ bump_type }}` and the JSON context (`-x`) includes the determined version bump type ("major", "minor", "patch", or null). The bump type is derived by comparing the previous and next semver versions, or taken directly from the forced `bump_type` config when set.
57ee25b to
4e6abc8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1483 +/- ##
==========================================
+ Coverage 47.40% 47.83% +0.44%
==========================================
Files 24 24
Lines 2129 2141 +12
==========================================
+ Hits 1009 1024 +15
+ Misses 1120 1117 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
|
Nope, all done! The force pushes were just formatting fixes. CI is green now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1220
Adds a
bump_typefield to theReleasestruct, exposing the determined version bump type in both templates and the JSON context output (-x).Values:
"major","minor","patch", ornullUsage in templates:
{% if bump_type == "major" %}Breaking release{% endif %}
In JSON context (
--context):{"version": "1.2.0", "bump_type": "minor", ...}
How it works:
bump_typeis forced via config, uses that directlynullwhen no previous version exists (initial tag)Changes:
bump_type: Option<BumpType>toReleasestructcalculate_next_version_with_configto return the determined bump typebump_version()to populate the fieldbump_version_typetest covering auto-detection, forced config, and initial tag cases