Project

Profile

Help

Issue #7412

Collection Remote sync breaks when requirements.yml is added.

Added by newswangerd 3 months ago. Updated 3 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

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

Related to Ansible Plugin - Story #7439: As a user, I can sync docs_blob information for collection versionsCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 2f400ceb View on GitHub
Added by Fabricio Aguiar 3 months ago

Build collections URL according to requirements.yml

https://pulp.plan.io/issues/7412 closes #7412

History

#1 Updated by daviddavis 3 months ago

  • Related to Story #7439: As a user, I can sync docs_blob information for collection versions added

#2 Updated by fao89 3 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89

#3 Updated by fao89 3 months ago

#4 Updated by pulpbot 3 months ago

  • Status changed from ASSIGNED to POST

#5 Updated by bmbouter 3 months 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?

#6 Updated by Anonymous 3 months ago

  • Status changed from POST to MODIFIED

#7 Updated by fao89 3 months ago

  • Sprint/Milestone set to 0.3.0

#8 Updated by pulpbot 3 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF