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
feat(version): Add new version print flags to display the last released version and tag. #852
feat(version): Add new version print flags to display the last released version and tag. #852
Conversation
I'd rather see this be a modification to the version command. Is it possible to extend the current semantic-release version --print-last-released |
And also doesn't the --print option do this if you just capture the stdout? It will provide a stderr message but that doesn't stop the return of the current version as long as it hasn't changed? Or the rationale for this, is to not consider what has changed but only what is currently released? |
That is the rationale for this. I have a need to run my CI/CD pipeline periodically for security checks and I want the current version. |
Do you think I should be making two versions, one that returns the tag and another returning the semantic version? I could see both being useful. If I did make a version that printed the tag I would also add a |
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.
Thanks for the contribution. Just a few recommendations but I'm glad you were thorough with tests and doc updates.
One minor recommendation. I would rewrite your branch commits to remove at least the first one and then separate out the addition of the click-option-group
as its own build(deps): add click-option-group ...
because the maintainer tends to rebase and merge with the exact commits used. Once this occurs then a changelog is generated from those commits. If your first commit is in there then that is confusing to what actual features were added and the build change is then hidden from the changelog as its lumped into the feature creation.
@@ -117,11 +120,25 @@ def shell(cmd: str, *, check: bool = True) -> subprocess.CompletedProcess: | |||
"help_option_names": ["-h", "--help"], | |||
}, | |||
) | |||
@click.option( | |||
@optgroup.group("Print flags", cls=MutuallyExclusiveOptionGroup) |
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.
Very neat!
I think having all 4 variants was a great choice, thanks for thinking ahead. |
59225dc
to
91a0d67
Compare
Addressed changes and cleaned up commit log |
@cfxegbert, good job thanks! This is an optional change as it doesn't change much for your overall PR, but I wanted to recommend that the All in all thanks for the effort you have put into this PR! @relekang, PR ready for merge. |
91a0d67
to
ec8a11e
Compare
ec8a11e
to
2c263a7
Compare
Fix commit messages not to start with a capitol letter and not end with a period |
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.
Great work! Approved.
Ready for merge @relekang
This adds a the command
semantic-release current-version
so semantic-release can be used to determine the current tag on the branch based on semantic-release config.