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 global repository version list command #647
Conversation
if self.repository_ctx.tangible: | ||
return {self.repository_ctx.HREF: self.repository_ctx.pulp_href} | ||
else: | ||
return {} |
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.
Now i need to find a new way to make the existence of lookup values in the repository context mandatory for version detail commands. XD
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.
When does scope
get called? You could add more logic to the version generic command that checks list_only
and sets a parameter on the context object which scope
could check to make sure the lookup has been set.
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.
Yeah, something like that.
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.
It sounds easier to not use the baseclass RepositoryContext for the generic endpoint, but subclass one for it. I will keep the tangible however. I like it.
47c8a1e
to
c637cb8
Compare
66bdb2e
to
2552089
Compare
if self.has_plugin(PluginRequirement("core", max="99.99.0")): | ||
# https://github.com/pulp/pulpcore/issues/3634 | ||
for operation_id, (method, path) in self.api.operations.items(): |
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.
You think we should look into moving this method into it's own file? context.py
will grow quite large as we discover more schema bugs. Also, can plugins that are not apart of this package contribute to this method?
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.
No, they cannot, and that is a valid concern. Maybe we need some plugin lookup for glue parts after all.
) -> None: | ||
result = repository_version_ctx.repair() | ||
pulp_ctx.output_result(result) | ||
callback.add_command(list_command(decorators=decorators + [content_in_option])) |
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.
This is also adding the --content
fields to all of the other plugin repo version commands too, neat.
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.
yes!
fixes #631
Review Checklist: