8000 Update molecule dependency logic to allow setting roles-path and collections-path by dmbuck32 · Pull Request #4718 · ansible/molecule · GitHub
[go: up one dir, main page]

Skip to content

Update molecule dependency logic to allow setting roles-path and collections-path - #4718

Open
dmbuck32 wants to merge 2 commits into
ansible:mainfrom
dmbuck32:fix/galaxy-dependency-role-collection-options
Open

dmbuck32 wants to merge 2 commits into
ansible:mainfrom
dmbuck32:fix/galaxy-dependency-role-collection-options

Conversation

@dmbuck32
@dmbuck32 dmbuck32 commented Oct 19, 2026 •
Copy link
Copy Markdown

Partially Fixes #4427.

I've just added fixes for:

  • roles-path when installing collections
  • collections-path when installing roles

This probably be updated to also include all the other incompatible options between ansible-galaxy collection install and ansible-galaxy role install if there is interest, e.g.:

Exclusive options for collections

  • clear-response-cache
  • no-cache
  • pre
  • upgrade or U
  • keyring
  • disable-gpg-verify
  • signature
  • required-valid-signature-count
  • ignore-signature-status-code
  • ignore-signature-status-codes
  • offline

Exclusive options for roles

  • keep-scm-meta or g

Summary by CodeRabbit

  • Bug Fixes
    • Ansible Galaxy collection installations now use the configured collections path.
    • Ansible Galaxy role installations now use the role installation command and configured roles path, keeping both installation types aligned with their configured destinations.

@github-actions
Copy link
Copy Markdown

Label error. Requires at least 1 of: breaking, chore, feat, fix. Found: . Follow https://www.conventionalcommits.org to get auto-labeling to work correctly.

@coderabbitai
coderabbitai Bot commented Oct 19, 2026 •
Copy link
Copy Markdown

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ad2c5570-d7cf-4a4c-8440-ea051376dac7
📥 Commits

Reviewing files that changed from the base of the PR and between da31a19 and 61dcf49.

📒 Files selected for processing: 4
  • src/molecule/dependency/ansible_galaxy/collections.py
  • src/molecule/dependency/ansible_galaxy/roles.py
  • tests/unit/dependency/ansible_galaxy/test_collections.py
  • tests/unit/dependency/ansible_galaxy/test_roles.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

Collection and role dependency options now filter path settings for the other command type. Baked collection installs include --collections-path. Baked role installs use ansible-galaxy role install and include --roles-path.

Changes: Ansible Galaxy dependency options

Layer / File(s) Summary
Collection path option
src/molecule/dependency/ansible_galaxy/collections.py, tests/unit/dependency/ansible_galaxy/test_collections.py
Collections filter roles-path. Tests check that collections-path remains in options and in the baked collection install command.
Role path and install command
src/molecule/dependency/ansible_galaxy/roles.py, tests/unit/dependency/ansible_galaxy/test_roles.py
Roles filter collections-path and use the role install command. Tests check that roles-path remains in options and in the baked command.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: greg-hellings

Merge Risk: Minimal · previous review 61dcf

The configured paths are passed to their matching Galaxy install commands, and the changed command forms are covered by unit assertions. No actionable merge-blocking risk is evident.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: support separate roles-path and collections-path handling in Molecule dependency logic.
Linked Issues check Passed The PR satisfies the coding requirement in [#4427]. Collections.FILTER_OPTS removes roles-path before ansible-galaxy collection install. Roles.FILTER_OPTS removes collections-path before `an…
Out of Scope Changes check Passed The changed source files implement the two option-filtering cases described in [#4427]. The changed unit tests verify those cases and the explicit role command. No unrelated production behavior or unr…
Full details: Linked Issues check

Explanation

The PR satisfies the coding requirement in [#4427]. Collections.FILTER_OPTS removes roles-path before ansible-galaxy collection install. Roles.FILTER_OPTS removes collections-path before ansible-galaxy role install. Roles.COMMANDS now uses the explicit role install command. Unit tests cover the filtered options and the generated commands for both dependency types. The issue does not require the other exclusive options listed in the PR description.

Full details: Out of Scope Changes check

Explanation

The changed source files implement the two option-filtering cases described in [#4427]. The changed unit tests verify those cases and the explicit role command. No unrelated production behavior or unrelated tests appear in the reviewed diff.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@shvenkat-rh
Copy link
Copy Markdown
Contributor

Please push verified commits @dmbuck32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

The dependency options are not universal when galaxy is using collections vs roles

2 participants

0