-
Notifications
You must be signed in to change notification settings - Fork 42
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
It looks like option order can matter in unintuitive ways. #650
Comments
My hunch is that click-processing hits https://github.com/pulp/pulp-cli/blob/main/pulpcore/cli/common/generic.py#L356 before it's had a chance to add a RepositoryContext to the context, and we're asserting on "no repo found". To address this we prob want to do something like --version=name:version , --repository= implies latest_version, and you can't specify both. At a minimum, we need to document that "order matters" in this case. |
I have tested the issue on a pulp file repository and can confirm that this is indeed not pulp-deb specific. |
This is the default behavior of click it seems: https://click.palletsprojects.com/en/8.1.x/advanced/#callback-evaluation-order. Going to need to be more clever in our callbacks if we want to be order invariant. |
Use entered order of parameters matter, and can lead to unexpected behavior in some cases. Resource lookup option is now an eager parameter, which means it is processed before all non-eager parameters, no matter the order user entered them in. closes pulp#650
Use entered order of parameters matter, and can lead to unexpected behavior in some cases. Resource lookup option is now an eager parameter, which means it is processed before all non-eager parameters, no matter the order user entered them in. closes pulp#650
Use entered order of parameters matter, and can lead to unexpected behavior in some cases. --repository is now an eager parameter, which means it is processed before all non-eager parameters, no matter the order user entered them in. This applies to both the option and the resource lookup option (but not on repository_href_option). closes pulp#650
Use entered order of parameters matter, and can lead to unexpected behavior in some cases. --repository is now an eager parameter, which means it is processed before all non-eager parameters, no matter the order user entered them in. This applies to both the option and the resource lookup option (but not on repository_href_option). closes pulp#650
Use entered order of parameters matter, and can lead to unexpected behavior in some cases. --repository is now an eager parameter, which means it is processed before all non-eager parameters, no matter the order user entered them in. This applies to both the option and the resource lookup option (but not on repository_href_option). closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes pulp#650
The order in which the user enters options (--version, --repository, ..) no longer matters for 'pulp <plugin> repository version' commands, since all API calls are now deferred to after the options' callbacks are processed. closes #650
Summary
While using Pulp CLI, I encountered the following:
Steps to reproduce
--version
and--repository
flags in that orderError: A apt repository must be specified for this command.
Expected behavior
The order the
--version
and--repository
flags are given to a CLI command in should not matter.Pulp and pulp-cli version info
Additonal context
I suspect this is nothing to do with
pulp-cli-deb
and will happen equally for other content plugins, but I did not test this.The text was updated successfully, but these errors were encountered: