Use auth for GitLab private repos, and fix GitLab failover behavior#157
Conversation
drzraf
commented
Oct 6, 2022
- When retrieving a ZIP from a private repository, use authentication, if provided
- Fix the GitLab failover behavior (used to bail-out on private GitLab repositories without trying to use a token if one was provided)
64999f6 to
4e53a5d
Compare
danielbachhuber
left a comment
There was a problem hiding this comment.
@drzraf Should we support GITHUB_TOKEN too? Also, can you fix the PHP issues?
|
An even better way would be to rely upon Note that composer just provided a download-only flag (and public method) in composer/composer#11041 which would allow fetching packages (using authentication) and still install them the way we want. NB: |
|
The PHPCS warning is unrelated to this patch and the suggested indentation change seems wrong. But committed a "fix" anyway. |
@drzraf Cool. Just to clarify, |
|
I considered GITLAB_TOKEN (necessary for private GitLab repo) in the initial implementation. But it was buggy. GITLAB_TOKEN was either:
|
|
ping ? |
|
@drzraf Is there a good way to test this? |
|
|
|
@drzraf Sorry for the delay! Here's what I tried: Is there something obvious I'm missing? My private repo is https://gitlab.com/danielbachhuber/wp-cli-test-package |
…, if provided - Fix the GitLab failover behavior (used to bail-out on private GitLab repositories without trying to use a token if one was provided)
59e7186 to
e71b3e3
Compare
… precision about Git hosting
|
I just added a couple of commits fix two aspects:
|
|
@drzraf Cool, sounds good. Can you fix up the PHPCS issues and then we can land it? |