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

Stop appending '/api' to galaxy server url #63238

Merged
merged 8 commits into from
Oct 8, 2019
Merged

Stop appending '/api' to galaxy server url #63238

merged 8 commits into from
Oct 8, 2019

Conversation

alikins
Copy link
Contributor

@alikins alikins commented Oct 8, 2019

SUMMARY

Stop appending '/api' to configured galaxy server url. Since not all Galaxy REST api server URLs live at /api, the client can no longer blindly append /api to the URL found in the config.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ansible-galaxy

ADDITIONAL INFORMATION

Since not all galaxy REST api server URLs live
at '/api', stop always appending it to the
'url' value loaded from config.
@alikins alikins added galaxy collection Related to Ansible Collections work labels Oct 8, 2019
@chouseknecht chouseknecht changed the title Stop appending '/api' to new galaxy server url config [WIP] Stop appending '/api' to new galaxy server url config Oct 8, 2019
@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 8, 2019
@chouseknecht chouseknecht changed the title [WIP] Stop appending '/api' to new galaxy server url config Stop appending '/api' to galaxy server url Oct 8, 2019
@chouseknecht
Copy link
Contributor

All unit tests are passing. One test is marked as unstable but has nothing to do with this change.

@chouseknecht chouseknecht self-requested a review October 8, 2019 19:02
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. labels Oct 8, 2019
Copy link
Contributor

@s-hertel s-hertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shipit

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 8, 2019
@s-hertel
Copy link
Contributor

s-hertel commented Oct 8, 2019

@alikins Oh, I overlooked that this could use a changelog.

@abadger
Copy link
Contributor

abadger commented Oct 8, 2019

@alikins @chouseknecht Merged. Please add a changelog when you open the backport to stable-2.9 and then I'll get the backpotr merged tomorrow. Thanks!

abadger pushed a commit that referenced this pull request Oct 10, 2019
* Stop appending '/api' to galaxy server url (#63238)

* Stop appending '/api' to configured galaxy server url

Since not all galaxy REST api server URLs live
at '/api', stop always appending it to the
'url' value loaded from config.

* Add note about manually migrated galaxy configs and /api

* Add '/api/' to galaxy url and guessing if galaxy API

* Fix most unit tests (update to expect /api/)

* Fix test_initialise_unknown unit test

Since we retry now with an added /api/, mock it as well.

* Update fallback default avail_ver to new format

(cherry picked from commit bad7269)

* Add changelog fragment galaxy_api_config

* Fix galaxy url use everywhere when url is set in config. (#63286)

In addition to trying the configured url (for ex, a migrated
'https://galaxy.ansible.com/') there is an attempt at that
URL with '/api' postpended.

If the extended URL works, update GalaxyAPI.api_server to
use the extended URL. Previously it only used it for finding
the API root info ('available_versions', etc)

(cherry picked from commit ed203c5)
@ansible ansible locked and limited conversation to collaborators Nov 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. collection Related to Ansible Collections work galaxy shipit This PR is ready to be merged by Core support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants