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
API Changes #133
API Changes #133
Conversation
| @@ -132,7 +132,7 @@ def test_all(self): | |||
| sync(cfg, remote, repo) | |||
|
|
|||
| repo = client.get(repo['_href']) | |||
| content = get_content(repo) | |||
| content = get_file_content(repo) | |||
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.
Since these functions are just one-liners, we could just replace this with get_content()['file'], and I'm open to changing it to be that way if QE would prefer it.
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.
Those changes will need to reflect in all plugins. Besides that, they are fine.
@rochacbruno, any other comments?
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.
Minor update that a better idea would be to use get_content()[FILE_CONTENT_NAME] instead of a string literal, if we were to do things that way.
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.
@kersommoura @dralley agreed, we can gradually replace the function with get_content()['file'] and keep the _file_ function with a DeprecationWarning for backwards compatibility.
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.
OR, if this function exists only in this repo, remove it and change in all references
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.
@rochacbruno That probably wouldn't be necessary since get_file_content() is defined inside the plugin, in pulp_file.tests.functional.utils, and isn't something in pulp-smash itself for which backwards compatibility would be an issue. But it's also something being added in this PR, so we can choose which way we want to go before this would get merged. Do you have a personal preference?
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.
@rochacbruno I just saw your second comment but yes that is correct. Still, if you have a personal preference I can go ahead and change it to avoid creating more work later on. This PR will probably be open for a few more days since it goes along with a big pulpcore PR.
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.
And since I'll need to copy this work over to each of the other plugins, I'd rather do things the preferred way to begin with :)
| @@ -9,7 +9,9 @@ | |||
| CONTENT_PATH | |||
| ) | |||
|
|
|||
| FILE_CONTENT_PATH = urljoin(CONTENT_PATH, 'file/files/') | |||
| FILE_CONTENT_NAME = 'filecontent' | |||
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.
TBH, I am not a fan of this change. What's the reasoning behind using 'filecontent' instead of a namespaced endpoint?
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 noticing it because it shouldn't be in this PR, accidental straggler.
adc3e43
to
d98c48f
Compare
f91b955
to
22d1d5c
Compare
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
|
@pulp/qe |
|
The smash tests pass locally, it just needs pulp/pulp-smash#1154 in order to work |
4b987c6
to
ae12392
Compare
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp_file#133 Required PR: pulp/pulp-smash#1154 [noissue]
Required PR: pulp/pulp-smash#1154 Required PR: pulp/pulp_file#133 [noissue]
c3e404e
to
60a2891
Compare
Required PR: pulp/pulp#3774 Required PR: pulp/pulp-smash#1154 [noissue]
4286014
to
1634ba5
Compare
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 once Travis is passing. I assume after pulpcore is merged.
|
@dkliban It'll be after this PR is merged pulp/pulp-smash#1154 |
Shorter and probably more efficient than fetching all the content data. [noissue]
Shorter and probably more efficient than fetching all the content data. Required PR: pulp/pulp-smash#1154 Required PR: pulp/pulp_file#133 [noissue]
ff29f65
to
d5f43fb
Compare
| """Create class-wide variables.""" | ||
| cls.cfg = config.get_config() | ||
| cls.client = api.Client(cls.cfg, api.json_handler) | ||
|
|
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.
If we do not intend to reuse those objects they could be created inside the test method as before. Since there is just one test method.
| from pulp_file.tests.functional.utils import set_up_module as setUpModule # noqa:F401 | ||
| from pulp_file.tests.functional.utils import ( # noqa:F401 | ||
| gen_file_remote, | ||
| set_up_module as setUpModule |
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.
The # noqa:F401 is related to the setUpModule in the new format looks like both functions are part of this #noqa. I would rather keep them apart.
Required PR: pulp/pulp#3774 Required PR: pulp/pulp-smash#1154 [noissue]
Make changes necessary to support the API changes brought over from the "single-table-content" concept, where content-in-repository-version filtering is done inside the content app instead of on special endpoints on a repository version.