-
Notifications
You must be signed in to change notification settings - Fork 664
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
ansible-lint on collection tries to install the collection itself #4219
Comments
This should never happen and the only case where I would see it as happening is if you have your own collection mentioned as a dependency somewhere inside your codebase (or being listed as an indirect dependency of another collection). Please run with |
Hello @ssbarnea, I run The debug shows as when the dependencies are parsed, also the collection itself is tried to install.
I could attach the entire output if it could be useful. The check about dependecies run more times, I don't understand why. |
Hi @falon , Since you originally reported this problem, there have been several bug fixes and releases. The current version of ansible-lint is now 24.7.0, and we have addressed multiple issues since version 24.6.0. I was unable to reproduce the problem you mentioned using the steps provided and the latest version of ansible-lint. Could you please check on your end with the most recent version and let me know if the issue still persists? If you are still experiencing the problem, it would be helpful if you could provide updated steps to reproduce it. This is what I got upon reproducing the steps. :~/ansible-lint/AllTests/mynamespace/mycollection$ ansible-lint Passed: 0 failure(s), 0 warning(s) on 6 files. Last profile that met the validation criteria was 'production'. |
Hello @tanwigeetika1618 , I'm sorry for the delay, I was away for a while. I still see the same problem even with the last version of ansible-lint:
My big question is that I can't understand why you can't reproduce the issue. |
I have the same problem:
Some interesting behaviour I noticed in verbose output - It appears to be doubling up the paths in the
|
Have been seeing this behavior as well with ansible-lint 24.9.0:
I have been seeing this for a while now. It is more of a cosmetic issue. |
Reopening as during debugging we found several issues we want to address. |
@falon Linter will try to install current collection unless run in offline mode, but it will do it from disk, not from galaxy. Exception would if there is this collection mentioned in a requirement file from within the repo. We will downgrade that warning to info level as we might expect that a considerable number of people might already have it installed locally at user or system level. Still due to path manipulation done by the linter, its custom install path would take precedence and the already existing versions will not be used. So once we do this you will no longer see these messages. |
Closing as with current release this no longer reproduces. |
I agree, thank you @ssbarnea! Really now there is another warning:
Maybe do I have to do something with ansible-compat config? Even if I remove /root/.cache/ansible-compat/* when I run I wonder if this could be related to
which it seems to be enabled by default. Maybe /root/.cache should not be a system path for a collection scan purpose. Thank you |
Same. |
Summary
If I develop a collection and I lint it, the linter try to install the same collection by Galaxy. After that it warn that multiple collection versions were found.
I don't understand. If I'm developing a collection, I don't expect that the linter modify this collection by installing it from Galaxy.
Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
Init a new fresh collection with ansible-galaxy.
When I run ansible-lint from the base path of the collection I see
Why does ansible-lint want to install the collection which I'm linting?
My galaxy.cfg is
Desired Behavior
It's good that ansible-lint installs collection dependent by the collection. Ansible-lint shoud not try to install from ansible-galaxy the same collection that I'm linting.
Actual Behavior
Finally, as I see above, it's not true that Multiple versions of 'mynamespace.mycollection' were found installed.
If I run the lint with
--offline
this warning doesn't appear.The text was updated successfully, but these errors were encountered: