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

Fix collection loading #223

Merged
merged 3 commits into from
Feb 14, 2023
Merged

Conversation

apatard
Copy link
Contributor

@apatard apatard commented Feb 13, 2023

  • Ensure the cache dir is added to the collection loader path, in order to allow linting a collection role against a module this collection is providing

  • Add missing default collection path to the loader for ansible version prior 2.15.0.dev0, as done by ansible's _configure_collection_loader(). The only remaining difference is the missing handling of COLLECTIONS_SCAN_SYS_PATH.

See ansible/ansible-lint#2969 for reference.

Signed-off-by: Arnaud Patard apatard@hupstream.com

- Ensure the cache dir is added to the collection loader
  path, in order to allow linting a collection role against
  a module this collection is providing

- Add missing default collection path to the loader for ansible
  version prior 2.15.0.dev0, as done by ansible's
  _configure_collection_loader(). The only remaining difference
  is the missing handling of COLLECTIONS_SCAN_SYS_PATH.

See ansible/ansible-lint#2969 for
reference.

Signed-off-by: Arnaud Patard <apatard@hupstream.com>
@apatard apatard requested a review from a team as a code owner February 13, 2023 16:32
@ssbarnea ssbarnea added the bug Something isn't working label Feb 13, 2023
@ssbarnea
Copy link
Member

@apatard LGTM but can you please add a test? Just as safety measure to avoid regression.

@apatard
Copy link
Contributor Author

apatard commented Feb 13, 2023

@apatard LGTM but can you please add a test? Just as safety measure to avoid regression.

@ssbarnea I know I should have added two tests (1 for plugin in collection and 1 for the issue found in ansible-lint bug 2969) but I don't know enough the test suite to do that. If you can give me some clues about that, I can try adding them.

@ssbarnea
Copy link
Member

@apatard I will take it over from here as there are few other changes needed. Funny, I reached the same bug while debugging something else.

@ssbarnea ssbarnea self-assigned this Feb 14, 2023
@apatard
Copy link
Contributor Author

apatard commented Feb 14, 2023

ok. Ping me if you need someone to test things.

@ssbarnea ssbarnea merged commit f51159b into ansible:main Feb 14, 2023
@ssbarnea ssbarnea changed the title src/ansible_compat/runtime.py: Fix collection loading Fix collection loading Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants