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

cargo: use the correct path when checking installation status fixing idempotency issue. #7970

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

rbomze
Copy link
Contributor

@rbomze rbomze commented Feb 15, 2024

SUMMARY

There is a problem when using the optional 'path' parameter. The initial installation works fine, but when running the module again the get_installed function, which is supposed to check the installation state does not use the parameter, thus a new installation is attempted, this again is registered by cargo install itself, but leads to a false 'changed' status, breaking ansibles' idempotency.
A similar problem occurs when removing packages.

This fix makes the get_installed function aware of the optional 'path' parameter.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

cargo

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review labels Feb 15, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-7 backport-8 Automatically create a backport for the stable-8 branch labels Feb 16, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! Can you please add a changelog fragment? Thanks!

@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added 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 and removed small_patch Hopefully easy to review labels Feb 16, 2024
@ansibullbot ansibullbot 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 Feb 16, 2024
Co-authored-by: Felix Fontein <felix@fontein.de>
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

If nobody objects, I'll merge this on the weekend.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Feb 23, 2024
@felixfontein felixfontein merged commit 9510988 into ansible-collections:main Feb 23, 2024
121 checks passed
Copy link

patchback bot commented Feb 23, 2024

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/9510988abc1a186610fb41797bffdffdb58037aa/pr-7970

Backported as #8018

🤖 @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 Feb 23, 2024
…idempotency issue. (#7970)

* cargo: use the correct path when checking installation status

* Add changelog fragment

* Update changelogs/fragments/7970-fix-cargo-path-idempotency.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 9510988)
Copy link

patchback bot commented Feb 23, 2024

Backport to stable-8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-8/9510988abc1a186610fb41797bffdffdb58037aa/pr-7970

Backported as #8019

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

@felixfontein
Copy link
Collaborator

@rbomze thanks for your contribution!

patchback bot pushed a commit that referenced this pull request Feb 23, 2024
…idempotency issue. (#7970)

* cargo: use the correct path when checking installation status

* Add changelog fragment

* Update changelogs/fragments/7970-fix-cargo-path-idempotency.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 9510988)
felixfontein pushed a commit that referenced this pull request Feb 23, 2024
…en checking installation status fixing idempotency issue. (#8018)

cargo: use the correct path when checking installation status fixing idempotency issue. (#7970)

* cargo: use the correct path when checking installation status

* Add changelog fragment

* Update changelogs/fragments/7970-fix-cargo-path-idempotency.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 9510988)

Co-authored-by: rbomze <14312790+rbomze@users.noreply.github.com>
felixfontein pushed a commit that referenced this pull request Feb 23, 2024
…en checking installation status fixing idempotency issue. (#8019)

cargo: use the correct path when checking installation status fixing idempotency issue. (#7970)

* cargo: use the correct path when checking installation status

* Add changelog fragment

* Update changelogs/fragments/7970-fix-cargo-path-idempotency.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 9510988)

Co-authored-by: rbomze <14312790+rbomze@users.noreply.github.com>
@rbomze
Copy link
Contributor Author

rbomze commented Feb 23, 2024

@rbomze thanks for your contribution!

Although it were just 3 lines of code it was an honor to contribute to this great project.

@felixfontein felixfontein mentioned this pull request Feb 23, 2024
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
…idempotency issue. (ansible-collections#7970)

* cargo: use the correct path when checking installation status

* Add changelog fragment

* Update changelogs/fragments/7970-fix-cargo-path-idempotency.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8 Automatically create a backport for the stable-8 branch bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants