Issue #7412
closedCollection Remote sync breaks when requirements.yml is added.
Description
Sync breaks when requirements.yml is added. This appears to be happening because pulp_ansible tries to append api/v2/collections/<namespace>/<name>
on to the end of the URL, which throws a 404.
- On API version 2 (galaxy), the sync process tries to look up
https://galaxy.ansible.com/api/v2/collections/api/v2/collections/newswangerd/collection_demo
- On API verson 3 (hub) the sync process looks up
https://cloud.redhat.com/api/automation-hub/v3/collections/api/v2/collections/frr/frr
I haven't tested sync on galaxy.ansible.com without a requirements.yml because I don't want to sync all 500 collections on there.
I had to put in https://cloud.redhat.com/api/automation-hub/v3/collections
as the base URL for hub because just pointing to the api root didn't seem to work, so I assume appending v2/collections...
is not the correct behaviour.
Here is my config:
galaxy
{
"name": "galaxy",
"url": "https://galaxy.ansible.com/api/v2/collections",
"requirements_file": "---\ncollections:\n - newswangerd.collection_demo"
}
hub
{
"name": "test remote",
"url": "https://cloud.redhat.com/api/automation-hub/v3/collections",
"requirements_file": "---\ncollections:\n - frr.frr",
"auth_url": "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token",
"token": "REDACTED"
}
Related issues
Updated by daviddavis over 4 years ago
- Related to Story #7439: As a user, I can sync docs_blob information for collection versions added
Updated by fao89 over 4 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to fao89
Updated by fao89 over 4 years ago
This is bad, we are appending the same path for any URL: https://github.com/pulp/pulp_ansible/blob/master/pulp_ansible/app/tasks/collections.py#L327
remote.url: https://galaxy.ansible.com/api/v2/collections => https://galaxy.ansible.com/api/v2/collections/api/v2/collections/{namespace}/{name}
we need to build the collections endpoint according to the root
Updated by pulpbot over 4 years ago
- Status changed from ASSIGNED to POST
Updated by bmbouter over 4 years ago
In thinking this over more, I believe the solution is to require validation on remote.url such that:
If a user has a non-empty value for requirements_file then the remote.url should require it to end in /v2/
or /v3/
. Or perhaps end in /v2/collections/
or /v3/collections/
. This would be good regardless I think.
Then we could more reliably modify the url when a requirements_file is in place.
fao89 what do you think about this?
Added by Fabricio Aguiar over 4 years ago
Updated by Anonymous over 4 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp_ansible|2f400ceb8e95beb8d930e189ec9d4772e4ae75da.
Updated by pulpbot over 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Build collections URL according to requirements.yml
https://pulp.plan.io/issues/7412 closes #7412