-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Allow to deprecate options and aliases by date #68177
Conversation
(The remaining CI failures are package download timeouts, i.e. unrelated :) ) ready_for_review |
TODO next:
|
6200ead
to
33bdd34
Compare
@felixfontein What's the intended workflow for this feature? Deprecation by version seems obvious to me, but I'm not immediately coming up with a scenario for deprecation by date. |
…_aliases.date checks to validate-modules.
…eprecate() calls.
Co-authored-by: Jordan Borean <jborean93@gmail.com>
06a6579
to
2f19ea5
Compare
(Rebased so that the branch includes the changes from the routing PR, and changed behavior of |
rebuild_merge |
if not re.match('^[0-9]{4}-[0-9]{2}-[0-9]{2}$', value): | ||
raise ValueError(msg) |
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 logic appears to be redundant. The exception handler below should catch the same cases the regex does and return the same exception.
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.
The code below also accepts 2020-1-1
, which is not ISO 8601. It does catch invalid dates such as 2019-02-29
though, which this regex won't catch.
if not re.match('^[0-9]{4}-[0-9]{2}-[0-9]{2}$', v): | ||
raise ValueError(msg) |
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.
Same as previous comment about redundant logic.
@mattclay @bcoca @sivel @jborean93 @nitzmahone thanks a lot for reviewing and merging! :) |
…make validate-modules ensure version and date match (#69727) * Allow to deprecate module by date in documentation. * Make sure deprecation date/version match between module docs and meta/runtime.yml. * Unrelated fix: don't compare deprecated module version to Ansible's version in collection. * Allow documentation's removal version to be something else than fixed list of Ansible versions for collections. * Linting. * Allow to deprecate plugin options by date. * Add changelog fragment for deprecation by date (also covers #68177).
SUMMARY
Allows to deprecate options and aliases also by date and not only by version.
ISSUE TYPE
COMPONENT NAME
lib/ansible/module_utils/basic.py
lib/ansible/module_utils/common/parameters.py
lib/ansible/module_utils/common/warnings.py
lib/ansible/module_utils/csharp/Ansible.Basic.cs
test/lib/ansible_test/_data/sanity/pylint/plugins/deprecated.py
test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py
test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/schema.py