Skip to content
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

Pass only prefixed attributes to filters #102

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

maxtruxa
Copy link
Contributor

@maxtruxa maxtruxa commented May 27, 2021

SUMMARY

This PR is mutually exclusive with #103 .

In contrast to the jinja expressions in compose, groups and keyed_groups, filters was given all droplet attributes without a prefix. My bad for not catching that.

Note that this will break anyone who started using this feature since the release of version 1.5.0. If that is a no-go, I can amend the PR to keep the previous inconsistent behavior as well.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

Inventory plugin

ADDITIONAL INFORMATION

Before:

plugin: community.digitalocean.digitalocean
attributes:
  - tags
filters:
  - '"test" in tags'

or even without the attributes:

plugin: community.digitalocean.digitalocean
filters:
  - '"test" in tags'

After:

plugin: community.digitalocean.digitalocean
attributes:
  - tags
filters:
  - '"test" in do_tags'

@codecov
Copy link

codecov bot commented May 27, 2021

Codecov Report

Merging #102 (6c000d2) into main (e928762) will increase coverage by 7.98%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
+ Coverage   63.75%   71.73%   +7.98%     
==========================================
  Files          30        1      -29     
  Lines        2163       92    -2071     
  Branches      417       17     -400     
==========================================
- Hits         1379       66    -1313     
+ Misses        551       24     -527     
+ Partials      233        2     -231     
Impacted Files Coverage Δ
plugins/inventory/digitalocean.py 71.73% <100.00%> (+0.14%) ⬆️
plugins/modules/digital_ocean_sshkey.py
plugins/modules/digital_ocean_kubernetes_info.py
plugins/modules/digital_ocean_image_info.py
plugins/modules/digital_ocean_kubernetes.py
plugins/modules/digital_ocean_database.py
plugins/modules/digital_ocean_tag.py
plugins/modules/digital_ocean_floating_ip_info.py
...lugins/modules/digital_ocean_load_balancer_info.py
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e928762...6c000d2. Read the comment docs.

Copy link
Contributor

@tadeboro tadeboro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is superior compared to #103 because it preserves the consistency of behavior. And although this is indeed an API break, I would say that the original behavior was flawed, and thus this is a fix that sets things straight. Plus, the Ansible PyPI package did not include the "broken" version of the plugin yet, so not many users were exposed to it.

But this PR does need a documentation fragment that describes the change, this is why I am requesting changes in my review.

In contrast to the jinja expressions in `compose`, `groups` and `keyed_groups`,
`filters` was given all droplet attributes without a prefix.
@maxtruxa
Copy link
Contributor Author

maxtruxa commented Jun 8, 2021

@tadeboro Thanks for the feedback! I added the missing changelog fragment.

@mamercad mamercad self-requested a review June 10, 2021 12:29
Copy link
Collaborator

@mamercad mamercad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this, want to close #103?

@mamercad mamercad merged commit 649952a into ansible-collections:main Jun 10, 2021
@maxtruxa
Copy link
Contributor Author

Closed #103. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants