-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add cpanm option --with-recommends #9555
base: main
Are you sure you want to change the base?
Add cpanm option --with-recommends #9555
Conversation
93a6439
to
ed02509
Compare
Hi @ZephOne please update the main branch, then rebase your PR branch with it to fix the Alpine tests |
There was a problem hiding this 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!
You don't need to rebase BTW, adding another commit also resolves the CI problems.
ed02509
to
0b4ccb4
Compare
Hi, thanks for your quick answer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @ZephOne thanks for your contribution!
The spelling needs fixing.
That being said, a couple of general comments:
- since you are doing
--with-recommends
, I would suggest you expand that and make the exact same thing for--with-suggests
, which seem to be a distinct categorie of dependencies forcpanm
. - quoting from
cpanm
docs:There's also
--without-recommend
and--without-suggests
to override the default decision made earlier inPERL_CPANM_OPT
. I made a suggestion that allows both forms to be selected by the user - docs will need an update for that as well.
e8736fe
to
818cfbf
Compare
This comment was marked as outdated.
This comment was marked as outdated.
818cfbf
to
94206b0
Compare
plugins/modules/cpanm.py
Outdated
- Installs dependencies declared as recommends per META spec. | ||
- When these dependencies fail to install, cpanm continues the installation, since they are just recommendation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be telling the user about the 3 options they have. Maybe something like:
- Installs dependencies declared as recommends per META spec. | |
- When these dependencies fail to install, cpanm continues the installation, since they are just recommendation. | |
- If V(true), installs dependencies declared as recommends per META spec. | |
- If V(false), it ensures the dependencies declared as recommends are not installed, overriding any decision made earlier in E(PERL_CPANM_OPT). | |
- If parameter is not set, C(cpanm) will use its existing defaults. | |
- When these dependencies fail to install, cpanm continues the installation, since they are just recommendation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I agree. Explicit is better. I'll just use your suggestion.
By the way what's the keyword for the doc about those doc functions : V(true)
, V(false)
, C(cpanm) and E(PERL_CPANM_OPT) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merci for the changes :-) the docs need just one more adjustment, IMO. And sorry, I should have picked it up earlier: you need to update line 273 in your code, adding the new args to the command runner, otherwise it will not pass them to the command line. See more in https://docs.ansible.com/ansible/latest/collections/community/general/docsite/guide_cmdrunner.html One other thing - not mandatory, but recommended - is to add test cases to |
Currently I cannot see any test in tests/unit/plugins/modules/test_cpanm.yaml. I will check the other modules plugins for a start. |
My bad I must look at |
94206b0
to
fd76584
Compare
cb9d15d
to
f8c145c
Compare
@russoz I added the tests. |
Awesome, will take a look in a moment. As for the docs right they are.......... in my brain. I wrote that helper code, and it is in my to-do list to write a developer guide within the collection docs (I have a couple of other such guides there). It's in the list for 2025 :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small adjustment to the changelog, then it looks good from my side as well:
changelogs/fragments/9554-add-cpanm-option_with-recommends-and-suggests.yml
Outdated
Show resolved
Hide resolved
f8c145c
to
0245115
Compare
LGTM, will merge in a few days if nobody objects. |
Fix #9554
SUMMARY
Fixes #9554
This PR aims to add the use of the option --with-recommands to cpanm module
ISSUE TYPE
COMPONENT NAME
cpanm