-
Notifications
You must be signed in to change notification settings - Fork 124
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
As a user, I can perform a content-only mirror of a repo. #2146
Conversation
Attached issue: https://pulp.plan.io/issues/9316 |
5e66a86
to
620ad7e
Compare
e13ea3d
to
bb172c9
Compare
c9f0e25
to
295269d
Compare
c6072d4
to
a860877
Compare
The CLI tests are failing due to ACS being pulled out, PR here: pulp/pulp-cli#392 |
The mirrorlist test is flaky because the mirror that tends to be picked is the MIT one, and it's broken. |
And I suppose we can have the |
mirror = data.get("mirror", None) | ||
sync_policy = data.get("sync_policy", None) | ||
|
||
if mirror and sync_policy: |
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 'mirror' in data and 'sync_policy' in data....
otherwise
$ http :24817/pulp/api/v3/repositories/rpm/rpm/46335757-c221-4539-874b-6e21bcce6674/sync/ remote=/pulp/api/v3/remotes/rpm/rpm/3a95a54f-31cb-40ff-a7fa-33c38ed8085d/ sync_policy=mirror_complete mirror=False
HTTP/1.1 202 Accepted
Access-Control-Expose-Headers: Correlation-ID
Allow: POST, OPTIONS
Connection: close
Content-Length: 67
Content-Type: application/json
Correlation-ID: 0313a5fad5314321b0ce0aac60497ef6
Date: Fri, 15 Oct 2021 10:36:53 GMT
Referrer-Policy: same-origin
Server: gunicorn
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
{
"task": "/pulp/api/v3/tasks/f5511ee9-3efa-4d22-a5db-9638c2412c3a/"
}
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.
Nice catch, I'll also add a test for this.
@@ -111,11 +132,11 @@ def test_with_xml_base_in_metadata(self): | |||
completely different base path when looking up relative paths. | |||
""" | |||
delete_orphans() | |||
self.do_test("immediate", mirror=False, url=REPO_WITH_XML_BASE_URL) | |||
self.do_test("immediate", sync_policy="mirror_content_only", url=REPO_WITH_XML_BASE_URL) |
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 probably does not matter whether the policy is additive or mirror_content_only in this testcase?
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.
Right, it does not. But this is expected to fail with metadata mirroring so I figured I ought to use a mirror mode since it would be more likely to be mixed up with future changes.
I'd prefer to stick to sync_policy, since users are already familiar with this concept in the remote's download policy. |
e2c47d5
to
af767c1
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.
Looks good, I'll review policy change in the other PR
Test failure unrelated |
err_msg = ( | ||
"Cannot use '{}' in combination with a 'mirror_complete' or " | ||
"'mirror_content_only' sync policy." | ||
) |
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.
Could you remind me why we are not using i18n here? to preserve api parameter names?
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, is there a way to i18n the string without changing particular substrings?
Required PR: pulp/pulpcore#1684 closes: #9316 https://pulp.plan.io/issues/9316
closes: #9316
https://pulp.plan.io/issues/9316