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

Add GITHUB_TOKEN and COMPOSER_AUTH handling. #47

Merged
merged 5 commits into from
Nov 2, 2017
Merged

Add GITHUB_TOKEN and COMPOSER_AUTH handling. #47

merged 5 commits into from
Nov 2, 2017

Conversation

gitlost
Copy link
Contributor

@gitlost gitlost commented Nov 1, 2017

Related #44 (comment)

Adds a Package_Command::set_composer_auth_env_var() function to set the COMPOSER_AUTH environment var used by Composer with the value of GITHUB_TOKEN if available, to avoid authorization failures, and calls it before each command. (There are undoubtedly other ways to achieve this, so other ideas might be better.)

Also adds GITHUB_TOKEN authorization to the http requests à la wp-cli/wp-cli#4281.

Also only sets the @github-api tag in utils/behat-tags.php if GITHUB_TOKEN not available - this is only temporary as will also do the same in the source of truth version wp-cli/wp-cli shortly with a PR there enabling @github-api tests on Travis.

Note I temporarily added my own GITHUB_TOKEN to https://travis-ci.org/wp-cli/package-command/settings to get the tests to run, but it would probably be best if one of the maintainers added it instead.

Also changes get_package_by_shortened_identifier() to return the https url rather than the ssh git@ version, as this is actually what is tested and seems to be the recommended protocol nowadays anyway (Which remote URL should I use?), and adapts the output checks in tests accordingly.

Also tags the tests involving schlessera/test-command as @require-php-5.5, as it's currently PHP 5.5.0 dependent - see wp-cli-test/test-command#1

Also clarifies the mismatch test a bit.

@danielbachhuber
Copy link
Member

Note I temporarily added my own GITHUB_TOKEN to https://travis-ci.org/wp-cli/package-command/settings to get the tests to run, but it would probably be best if one of the maintainers added it instead.

I've swapped yours out with one of mine.

Copy link
Member

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

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

💯 I've actually been meaning to do this:

image

You beat me to it :)

@gitlost gitlost merged commit 1c6e76e into master Nov 2, 2017
@gitlost gitlost deleted the github-api branch November 2, 2017 15:01
schlessera pushed a commit that referenced this pull request Jan 5, 2022
Add GITHUB_TOKEN and COMPOSER_AUTH handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants