Skip to content

Feature filter replace_keys #8446

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

Merged

Conversation

vbotka
Copy link
Contributor

@vbotka vbotka commented Jun 1, 2024

SUMMARY

Implement #8445

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

community.general.replace_keys

ADDITIONAL INFORMATION

See related feature requests #8438, #8442, and PR #8456, #8443

@ansibullbot
Copy link
Collaborator

@vbotka this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Jun 1, 2024
@vbotka vbotka force-pushed the feature-filter-replace_keys branch from 696bd5d to 81d52c6 Compare June 1, 2024 05:47
@ansibullbot ansibullbot added integration tests/integration plugins plugin (any type) tests tests and removed merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Jun 1, 2024
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jun 1, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch labels Jun 1, 2024
@vbotka vbotka changed the title Feature filter replace keys Feature filter replace_keys Jun 3, 2024
@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jun 4, 2024
@vbotka vbotka force-pushed the feature-filter-replace_keys branch from dde2649 to 3088f38 Compare June 4, 2024 14:56
@ansibullbot

This comment was marked as outdated.

@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI merge_commit This PR contains at least one merge commit. Please resolve! and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI labels Jun 4, 2024
@vbotka vbotka force-pushed the feature-filter-replace_keys branch from 3088f38 to 37cf3a7 Compare June 4, 2024 15:40
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI merge_commit This PR contains at least one merge commit. Please resolve! labels Jun 4, 2024
@felixfontein
Copy link
Collaborator

community.general 9 requires ansible-core 2.13+, which requires Python 3.8+ on the controller. So there's no need to worry about Python 3.5 and earlier for filters :)

* No target testing in _keys_filter_params
* Interface changed _keys_filter_params(data, matching_parameter)
* If there are items with equal C(before) the B(first) one will be used.
@ansibullbot ansibullbot added the filter filter plugin label Jun 9, 2024
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Jun 13, 2024
@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Jun 13, 2024
@vbotka
Copy link
Contributor Author

vbotka commented Jun 13, 2024

Done. Thank you!

@felixfontein felixfontein merged commit 1d61541 into ansible-collections:main Jun 14, 2024
134 checks passed
Copy link

patchback bot commented Jun 14, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/1d61541951a3ec3ecc5417bdd97ca2b1e9aca698/pr-8446

Backported as #8507

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jun 14, 2024
* Add filter replace_keys.

* Update examples and integration tests.

* Fix examples and copyright.

* Update documentation, examples and integration tests.

* Implement #8445. Add filter replace_keys

* Fix documentation formatting.

* Fix documentation.

* Fix type(target). Formatting improved.

* Instead of a dictionary, _keys_filter_target_dict returns a list

* No target testing in _keys_filter_params
* Interface changed _keys_filter_params(data, matching_parameter)
* If there are items with equal C(before) the B(first) one will be used.

* Update remove_keys. Interface changed _keys_filter_params(data, matching_parameter)

* The target can't be empty also in _keys_filter_target_dict

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Test attributes before and after are strings in the iteration of target.

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 1d61541)
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jun 14, 2024
@felixfontein
Copy link
Collaborator

@vbotka thanks for your contribution!

felixfontein pushed a commit that referenced this pull request Jun 15, 2024
…8507)

Feature filter replace_keys (#8446)

* Add filter replace_keys.

* Update examples and integration tests.

* Fix examples and copyright.

* Update documentation, examples and integration tests.

* Implement #8445. Add filter replace_keys

* Fix documentation formatting.

* Fix documentation.

* Fix type(target). Formatting improved.

* Instead of a dictionary, _keys_filter_target_dict returns a list

* No target testing in _keys_filter_params
* Interface changed _keys_filter_params(data, matching_parameter)
* If there are items with equal C(before) the B(first) one will be used.

* Update remove_keys. Interface changed _keys_filter_params(data, matching_parameter)

* The target can't be empty also in _keys_filter_target_dict

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Test attributes before and after are strings in the iteration of target.

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 1d61541)

Co-authored-by: Vladimir Botka <[email protected]>
@vbotka vbotka deleted the feature-filter-replace_keys branch June 15, 2024 14:10
@vbotka
Copy link
Contributor Author

vbotka commented Jun 15, 2024

@felixfontein I appreciate your cooperation!

Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
* Add filter replace_keys.

* Update examples and integration tests.

* Fix examples and copyright.

* Update documentation, examples and integration tests.

* Implement ansible-collections#8445. Add filter replace_keys

* Fix documentation formatting.

* Fix documentation.

* Fix type(target). Formatting improved.

* Instead of a dictionary, _keys_filter_target_dict returns a list

* No target testing in _keys_filter_params
* Interface changed _keys_filter_params(data, matching_parameter)
* If there are items with equal C(before) the B(first) one will be used.

* Update remove_keys. Interface changed _keys_filter_params(data, matching_parameter)

* The target can't be empty also in _keys_filter_target_dict

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Test attributes before and after are strings in the iteration of target.

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
austinlucaslake pushed a commit to austinlucaslake/community.general that referenced this pull request Mar 14, 2025
* Add filter replace_keys.

* Update examples and integration tests.

* Fix examples and copyright.

* Update documentation, examples and integration tests.

* Implement ansible-collections#8445. Add filter replace_keys

* Fix documentation formatting.

* Fix documentation.

* Fix type(target). Formatting improved.

* Instead of a dictionary, _keys_filter_target_dict returns a list

* No target testing in _keys_filter_params
* Interface changed _keys_filter_params(data, matching_parameter)
* If there are items with equal C(before) the B(first) one will be used.

* Update remove_keys. Interface changed _keys_filter_params(data, matching_parameter)

* The target can't be empty also in _keys_filter_target_dict

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

* Test attributes before and after are strings in the iteration of target.

* Update plugins/filter/replace_keys.py

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch feature This issue/PR relates to a feature request filter filter plugin integration tests/integration plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants