-
Notifications
You must be signed in to change notification settings - Fork 28
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
add argument to update version in galaxy.yml file #127
Conversation
I'm a bit conflicted as to whether antsibull-changelog is the right place/level in the stack to handle bumping the version. Also, pyyaml is lossy and does not preserve comments or formatting which is problematic for galaxy.yml. @felixfontein, wdyt? |
@KB-perByte, thanks for the PR! I left some feedback. |
Also, a changelog fragment is needed for this change. |
Co-authored-by: Maxwell G <maxwell@gtmx.me>
Co-authored-by: Maxwell G <maxwell@gtmx.me>
Thanks for the quick review, @gotmax23 |
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 your contribution. I started adding comments earlier today, but then got interrupted... and now most of the things already changed ;) So here's a new set of comments.
I agree, this feels a bit wrong. For such changes ruamel is the better library, but I don't think we should add a dependency on a second YAML library just for that. Maybe it would make sense to add this to collection_prep, as it already has a similar tool (https://github.com/ansible-network/collection_prep/blob/master/collection_prep/cmd/version.py)? |
I'm happy to merge this if you think there's a significant usecase, but I think the sed approach that preserves formatting is more ideal. Even ruamel.yaml doesn't preserve formatting, just comments, and I agree that it doesn't make sense to add that as an extra dependency. I'm not sure about the current maintenance status of collection_prep, but yeah, that might be a better place. |
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
@gotmax23 @felixfontein Thanks for the quick and detailed reviews, |
@KB-perByte, do you plan to fix the lint errors and address the remaining feedback? |
@gotmax23 this completely went out of my radar, l'll update the PR. |
I am trying to add unit tests! WIP |
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 updating this! I have some follow ups :).
src/antsibull_changelog/cli.py
Outdated
@@ -609,7 +616,8 @@ def command_release(args: Any) -> int: | |||
version, codename = _get_version_and_codename( | |||
paths, config, collection_details, args | |||
) | |||
|
|||
if args.update_galaxy_file and paths.galaxy_path: |
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.
If galaxy_path
is None but --update-galaxy-file
is passed, this should raise an error instead of continuing silently.
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.
I think it should return 1
and exit with an error code, not just print a log message.
Co-authored-by: Maxwell G <maxwell@gtmx.me>
Co-authored-by: Maxwell G <maxwell@gtmx.me>
Co-authored-by: Maxwell G <maxwell@gtmx.me>
making
|
Ah, right. We also need to update the
This one seems legitimate. The calling code should make sure that the function isn't called when that variable is None. |
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.
It looks like you added a fixture but didn't make any test changes?
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.
I haven't added any tests yet.
Co-authored-by: Maxwell G <maxwell@gtmx.me>
Yeah, ruamel.yaml would be better here, but I'm not particularly inclined to add another dependency; we already use pyyaml |
tags: | ||
- test | ||
- dummy | ||
version: 2.0.0 |
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.
This file isn't used so far.
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
@KB-perByte this PR hasn't progressed in a year. Are you still planning to work on this or can we close it? Thanks. |
We can close this off! Thanks |
Thank you! |
usage -
antsibull-changelog release --version 6.0.0 --update-galaxy-file
updates the version in the changelog and also in the galaxy.yml