-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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 --pre flag for ansible-galaxy client #64905
Comments
Files identified in the description: If these files are inaccurate, please update the |
Talking with people, I think what we want to add is the ability to pass --pre-release flag to ansible-galaxy, to have galaxy client return the latest version uploaded. This would work much like pip |
For background and clarity, for the 2.9 release, we decided to not tackle this problem. Largely this is due to collections using semver (semver allows for pre-release versioning), and to keep from introducing another dependency, we handle release versions using As a result we have no way to sort pre-releases. Potentially we could switch to |
thanks for info! Yah, I think LooseVersion on --pre makes sense to me. |
@pabelanger The trouble with using
The first option is probably never going to happen, we are trying to reduce our dependencies as much as possible. The 2nd would lead to poor user experience as Python deps can be quite complex in some environment. The last option may be doable but quite a big ask, prerelease versioning rules for semantic versioning is quite complex. |
I would suggest we look to another project, for example openstack, which has a good solution to this for python packages. They use version logic with in pbr (https://opendev.org/openstack/pbr/) for semantic versioning, I suspect we can leverage a lot of that logic if needed. How that falls into 1,2 or 3 would still need to be decided. FWIW: We are using pbr today to generate our semantic versioning numbers, works well. |
That would be option 3 as per https://opendev.org/openstack/pbr/src/branch/master/pbr/version.py. It remains to be seen if the ability to sort pre-release versions instead of an explicit opt in is what we want to have. |
I found this ticket from ansible/galaxy#2137 @jborean93 wrote above:
On first glance, I don't think this would be impossible, particularly if we use the code from python-semanticversion as inspiration. Here's the important regular expression (from semantic_version/base.py) version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)(?:-([0-9a-zA-Z.-]+))?(?:\+([0-9a-zA-Z.-]+))?$') We could build a really small |
Informational: Currently the galaxy server will show the prereleases on the galaxy UI despite /usr/bin/ansible-galaxy not serving those releases. |
* Support pre-releases via new SemanticVersion. Fixes #64905 * Don't treat buildmeta as prerelease * Don't inherit from str and int * Add helper method to try and construct a SemanticVersion from a LooseVersion * Don't count major 0 as pre-release, it's different * Guard against invalid or no version in LooseVersion * return a bool * Add integration tests for pre-release * Fix up lingering issues with comparisons * typo fix * Always allow pre-releases in verify * Move pre-release filtering into CollectionRequirement, add messaging when a collection only contains pre-releases * Update changelog * If explicit requirement allow pre releases * Enable pre-releases for tar installs, and collections already installed when they are pre-releases * Drop --pre-release alias, make arg name more clear * Simplify code into a single line * Remove build metadata precedence, add some comments, and is_stable helper * Improve from_loose_version * Increase test coverage * linting fix * Update changelog
SUMMARY
We publish semver collection (vyos.vyos:0.0.1-dev58) to ansible galaxy, however by default it seems ansible-galaxy client will not be able to find it. You must specific the version number directly to fetch it.
https://galaxy.ansible.com/vyos/vyos
EDIT:
This is working as expect, but it would be nice to Include:
--pre Include pre-release and development versions. By default, ansible-galaxy only finds stable versions.
ISSUE TYPE
COMPONENT NAME
ansible-galaxy
ANSIBLE VERSION
CONFIGURATION
STEPS TO REPRODUCE
EXPECTED RESULTS
vyos.vyos collection to be found and installed
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: