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

apt_rpm: fix package install check #8263

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

felixfontein
Copy link
Collaborator

SUMMARY

The for loop variable is packages, but the loop body uses package. This is obviously a typo, causing the loop to check the same package (from a previous for loop) multiple times.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

apt_rpm

@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 Apr 21, 2024
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Apr 21, 2024
Comment on lines 273 to 274
for package in pkgspec:
if not query_package_provides(module, package):
Copy link
Contributor

Choose a reason for hiding this comment

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

It's package here, but still packages below. I don't know this module and how it works, but is this really correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

packages is the concatenated list of elements of pkgspec, and below it would be used correctly assuming the variable wouldn't be clobbered here. So from the logic, the one below should stay packages, and this one should be package.

@felixfontein felixfontein merged commit 17e11d7 into ansible-collections:main Apr 22, 2024
132 of 133 checks passed
Copy link

patchback bot commented Apr 22, 2024

Backport to stable-7: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 17e11d7 on top of patchback/backports/stable-7/17e11d7d7e1ddd6bf3e73536a464aea08fd20084/pr-8263

Backporting merged PR #8263 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/community.general.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-7/17e11d7d7e1ddd6bf3e73536a464aea08fd20084/pr-8263 upstream/stable-7
  4. Now, cherry-pick PR apt_rpm: fix package install check #8263 contents into that branch:
    $ git cherry-pick -x 17e11d7d7e1ddd6bf3e73536a464aea08fd20084
    If it'll yell at you with something like fatal: Commit 17e11d7d7e1ddd6bf3e73536a464aea08fd20084 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 17e11d7d7e1ddd6bf3e73536a464aea08fd20084
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR apt_rpm: fix package install check #8263 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-7/17e11d7d7e1ddd6bf3e73536a464aea08fd20084/pr-8263
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

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

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Apr 22, 2024
Copy link

patchback bot commented Apr 22, 2024

Backport to stable-8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-8/17e11d7d7e1ddd6bf3e73536a464aea08fd20084/pr-8263

Backported as #8270

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

@felixfontein felixfontein deleted the apt_rpm-bug branch April 22, 2024 04:42
patchback bot pushed a commit that referenced this pull request Apr 22, 2024
Fix package install check.

(cherry picked from commit 17e11d7)
@felixfontein
Copy link
Collaborator Author

@mariolenz thanks for reviewing this!

felixfontein added a commit to felixfontein/community.general that referenced this pull request Apr 22, 2024
Fix package install check.

(cherry picked from commit 17e11d7)
@felixfontein
Copy link
Collaborator Author

Backport to stable-2.7 in #8271.

felixfontein added a commit that referenced this pull request Apr 22, 2024
…heck (#8270)

apt_rpm: fix package install check (#8263)

Fix package install check.

(cherry picked from commit 17e11d7)

Co-authored-by: Felix Fontein <[email protected]>
felixfontein added a commit that referenced this pull request Apr 22, 2024
apt_rpm: fix package install check (#8263)

Fix package install check.

(cherry picked from commit 17e11d7)
aretrosen pushed a commit to aretrosen/community.general that referenced this pull request Apr 22, 2024
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
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 plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants