Project

Profile

Help

Issue #7412

closed

Collection Remote sync breaks when requirements.yml is added.

Added by newswangerd over 3 years ago. Updated over 3 years 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 - CURRENTRELEASEfao89

Actions
Actions #1

Updated by daviddavis over 3 years ago

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

Updated by fao89 over 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89
Actions #3

Updated by fao89 over 3 years ago

Actions #4

Updated by pulpbot over 3 years ago

  • Status changed from ASSIGNED to POST
Actions #5

Updated by bmbouter over 3 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 3 years ago

Revision 2f400ceb | View on GitHub

Build collections URL according to requirements.yml

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

Actions #6

Updated by Anonymous over 3 years ago

  • Status changed from POST to MODIFIED
Actions #7

Updated by fao89 over 3 years ago

  • Sprint/Milestone set to 0.3.0
Actions #8

Updated by pulpbot over 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF