Skip to content
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

Merged
merged 3 commits into from Dec 17, 2018
Merged

API Changes #133

merged 3 commits into from Dec 17, 2018

Conversation

dralley
Copy link
Collaborator

@dralley dralley commented Nov 27, 2018

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.

@@ -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)
Copy link
Collaborator Author

@dralley dralley Nov 27, 2018

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.

Copy link

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?

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Member

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

Copy link
Collaborator Author

@dralley dralley Dec 4, 2018

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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'
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@dralley dralley force-pushed the api-changes branch 5 times, most recently from adc3e43 to d98c48f Compare November 28, 2018 21:22
@dralley dralley force-pushed the api-changes branch 2 times, most recently from f91b955 to 22d1d5c Compare December 4, 2018 18:01
dralley added a commit to dralley/pulp that referenced this pull request Dec 4, 2018
@dralley
Copy link
Collaborator Author

dralley commented Dec 4, 2018

@pulp/qe

@dralley
Copy link
Collaborator Author

dralley commented Dec 4, 2018

The smash tests pass locally, it just needs pulp/pulp-smash#1154 in order to work

@dralley dralley force-pushed the api-changes branch 2 times, most recently from 4b987c6 to ae12392 Compare December 4, 2018 22:16
dralley added a commit to dralley/pulp that referenced this pull request Dec 5, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 6, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 10, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 11, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 12, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 13, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 13, 2018
dralley added a commit to dralley/pulp that referenced this pull request Dec 14, 2018
@dralley dralley force-pushed the api-changes branch 3 times, most recently from c3e404e to 60a2891 Compare December 14, 2018 20:45
@dralley dralley force-pushed the api-changes branch 2 times, most recently from 4286014 to 1634ba5 Compare December 17, 2018 17:08
Copy link
Member

@dkliban dkliban left a 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.

@dralley
Copy link
Collaborator Author

dralley commented Dec 17, 2018

@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]
dralley added a commit to dralley/pulp that referenced this pull request Dec 17, 2018
Shorter and probably more efficient than fetching all the content data.

Required PR: pulp/pulp-smash#1154
Required PR: pulp/pulp_file#133

[noissue]
@dralley dralley force-pushed the api-changes branch 4 times, most recently from ff29f65 to d5f43fb Compare December 17, 2018 19:45
"""Create class-wide variables."""
cls.cfg = config.get_config()
cls.client = api.Client(cls.cfg, api.json_handler)

Copy link

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
Copy link

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.

@dkliban dkliban merged commit 2488131 into pulp:master Dec 17, 2018
@dralley dralley deleted the api-changes branch December 17, 2018 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants