-
Notifications
You must be signed in to change notification settings - Fork 19
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
NWO: All version numbers should be tagged (automatically or manually) #178
Comments
I've updated the PR (ansible/ansible#69680) to also require that |
ansible/ansible#69680 has been merged, so this now works. |
Was the intention for the ask_inventory:
description:
- Prompt user for inventory on launch.
type: bool
version_added: "ansible.builtin:2.9" The collection didn't introduce the option, it was carried over from Ansible 2.9. Likewise, if someone did fork a collection, the version numbers would be wrong unless the new collection backdated version or something, which would be meaningless anyway. Right now this gets the invalid semantic version error, saying it got |
No, that's not intended. (During migration all |
ansible/ansible#69926 has been merged, which changes the implementation away from tagged version numbes/dates to extra fields for the collection name. |
@AlanCoding with the current implementation (now in 2.10 beta 1, so it shouldn't change again) you can explicitly specify the collection name. You might need to add ignore.txt entries in some cases, though. |
Closing this proposal, since a better system has been now implemented. |
Proposal: All version numbers should be tagged
Author: Felix fontein <@felixfontein>
Date: 2020-05-21
(less if the main changes to ansible-base are meant, more when the time needed to adjust all collections is counted)
Motivation
In the NWO, both ansible-base (ansible.builtin) and collections have version numbers. If a feature is added, deprecated, or removed, it should be clear in which version of which collection this happen(s/ed).
Example 1: module
test
in collectionfoo.bar
usesfiles
doc fragment. Optionattributes
(fromfiles
) saysversion_added: 2.3
, whilefoo.bar
has version 1.0.0. Users reading this in the docs are confused.Example 2: doc fragment in module_utils in
foo.bar
deprecates an existing optionbaz
, to be removed in version2.0.0
offoo.bar
. The modulestuff
fromfoo.fancy
uses the doc fragment and module_utils fromfoo.bar
. When a user runsfoo.facy.stuff
with this option, a deprecation warningThis option will be removed in version 2.0.0
will be printed. Sincefoo.fancy
has version 2.5.1, the user is confused.Problems
Make it clear to users in documentation and deprecation warnings which collection is talked about. The user does not know that option
attributes
offoo.bar.test
comes from ansible.builtin, or that the option infoo.fancy.stuff
is deprecated because it comes from thefoo.bar
collection.A more detailled writeup: https://github.com/ansible/community/wiki/Version-numbers-for-documentation-deprecation-removal-in-the-collection-world
Solution proposal
ansible.builtin:2.10
orcommunity.general:1.3.0
; the HTML docs output could beAdded in Ansible-base 2.10
orAdded in community.general 1.3.0
.version_added
, the collection name can be tracked automatically:version_added
is added in plugin or module docs, and in doc fragments. Since Ansible knows where each fragment is loaded from, the loading code can tag allversion_added
values.display.deprecated()
calls,module.deprecate()
calls,removed_in_version
anddeprecated_aliases.version
in module argument spec - must be passed explicitly tagged version numbers:Testing (optional)
ansible-test can validate some of these:
validate-modules
, it can ensure that version numbers use the correct format if they appear in the documentation or in the module argument spec. I.e. it can check whether the tag is there, and when the tag is there, make sure that collection versions follow the semantic versioning version number definition, and for Ansible versions that they are parsable byStrictVersion
.pylint
plugin can check allmodule.deprecate()
anddisplay.deprecation()
calls, and ensure that they add the correct tags and that the verison number is correct (assuming that the version is passed as a literal in the call).Documentation (optional)
This requires updating the dev guide, so that people know how to tag version numbers, and it should be announced in ansible/community#346 and ansible-collections/overview#45 so that module/plugin and collection maintainers know about this.
Anything else?
Q: Why not label all version numbers (i.e. also the ones appearing in documentation and doc fragments)?
A: For two reasons:
version_added
. Deprecations do not happen very often. So the task that happens most (addingversion_added
) is not complicated unnecessarily, while the task that is made more complicated doesn't happen very often.Q: Isn't this a lot of work (to tag all version numbers in code)?
A: I think it is not that much work:
Q: Isn't this making forking collections (copying them and releasing them under a new name) more complicated?
A: Not much: right now you already have to adjust many places where the collection name is imprinted, and usually a global search-and-replace with some manual post-processing (verify all changes) does the job fine. Since deprecations don't happen too often, this should not increase the amount of work by much.
The text was updated successfully, but these errors were encountered: