-
Notifications
You must be signed in to change notification settings - Fork 29
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 validate-tags command #456
Conversation
$ antsibull-build validate-tags -i tags.yaml --data-dir ./build/ansible-build-data/7 7.0.0b1
ERROR:antsibull:func=validate_tags:mod=antsibull.tagging|cisco.nso 1.0.3 is not tagged in https://github.com/CiscoDevNet/ansible-nso
ERROR:antsibull:func=validate_tags:mod=antsibull.tagging|cyberark.pas 1.0.14 is not tagged in https://github.com/cyberark/ansible-security-automation-collection
ERROR:antsibull:func=validate_tags:mod=antsibull.tagging|f5networks.f5_modules 1.20.0 is not tagged in https://github.com/F5Networks/f5-ansible
ERROR:antsibull:func=validate_tags:mod=antsibull.tagging|fortinet.fortimanager 2.1.6 is not tagged in https://github.com/fortinet-ansible-dev/ansible-galaxy-fortimanager-collection
ERROR:antsibull:func=validate_tags:mod=antsibull.tagging|hpe.nimble 1.1.4 is not tagged in https://github.com/hpe-storage/nimble-ansible-modules
ERROR:antsibull:func=validate_tags:mod=antsibull.tagging|inspur.sm 2.3.0 is not tagged in https://github.com/ISIB-Group/inspur.sm
ERROR:antsibull:func=validate_tags:mod=antsibull.tagging|mellanox.onyx 1.0.0 is not tagged in https://github.com/ansible-collections/mellanox.onyx
ERROR:antsibull:func=validate_tags:mod=antsibull.tagging|ovirt.ovirt 2.3.1 is not tagged in https://github.com/ovirt/ovirt-ansible-collection |
b7ed559
to
6ec7e23
Compare
6ec7e23
to
8a04307
Compare
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've marked this as ready for review. I'm happy with the tag retrieval code, but I'd like your opinion on my other question :).
This adds a new validate-tags command to retrieve the tags in each collection's git repository and ensure that the current version is tagged. Currently, this is a separate command, but I'd like to have `antsibull-build` include the data from `get_collections_tags()` in ansible-build-data and the ansible sdist after this has gotten more testing/feedback. I also split CollectionsMetadata into a separate file and added the new keys. Previously, this class was part of changelog.py and only used for retrieving changelog URLs. Relates: ansible-community/community-topics#148 Depends-on: ansible-community/ansible-build-data#176
We should ensure that the input file exists (if that option is passed) and that the deps file exists to avoid exceptions down the line. Also, this fixes a typo in _normalize_validate_tags_options.
da0077f
to
80580c5
Compare
antsibull/src/antsibull/cli/antsibull_build.py Lines 342 to 352 in e8c91b6
Is |
Anyways, I've added a separate |
Also...
ovirt.ovirt 2.3.1 is tagged as 2.3.1-1. All of that collection's tag names are suffixed with |
Pass needed variables as function arguments instead of using app_ctx.
e8c91b6
to
38e42aa
Compare
How about allowing to configure a regex per collection that allows to extract the version? The default would be |
38e42aa
to
006f606
Compare
ovirt.ovirt's tags are fetched correctly with the latest commit and diff --git a/7/collection-meta.yaml b/7/collection-meta.yaml
index ff380d8..d9e9c42 100644
--- a/7/collection-meta.yaml
+++ b/7/collection-meta.yaml
@@ -275,6 +275,7 @@ collections:
repository: https://github.com/ansible-collections/openvswitch.openvswitch
ovirt.ovirt:
repository: https://github.com/ovirt/ovirt-ansible-collection
+ tag_version_regex: "^(.*)-1$"
purestorage.flasharray:
repository: https://github.com/Pure-Storage-Ansible/FlashArray-Collection
purestorage.flashblade: |
006f606
to
3386c32
Compare
#456 (comment) is still a problem :). |
repository, | ||
) | ||
flog.debug(f'Running {args}') | ||
proc = await asyncio.create_subprocess_exec( |
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.
Why not use sh
for running commands as all other parts of antsibull do?
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.
Yes, but isn't it blocking (in the asyncio sense)?
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's blocking (sh does not support asyncio yet, see amoffat/sh#552).
Remove --input from the validate-tags subcommand in favor of a separate validate-tags-file command.
We don't want git to ask for a password when a repository is inaccessible. The program should consider it a failure and move on.
Some collections don't tag versions as v{version} or {version}. While collections should use a standard tag name format per the Collection Requirements, we won't impose this on existing collections.
3386c32
to
e5c194a
Compare
@gotmax23 thanks for your contribution! |
This adds a new validate-tags command to retrieve the tags in each collection's git repository and ensure that the current version is tagged.
Currently, this is a separate command, but I'd like to have
antsibull-build
include the data fromget_collections_tags()
in ansible-build-data and the ansible sdist after this has gotten more testing/feedback.I also split CollectionsMetadata into a separate file and added the new keys. Previously, this class was part of changelog.py and only used for retrieving changelog URLs.
Relates: ansible-community/community-topics#148
Depends-on: ansible-community/ansible-build-data#176