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 COMPOSER_AUTH env variable to workflows #200

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Potherca
Copy link
Member

@Potherca Potherca commented Jan 5, 2023

Proposed Changes

Because of the amount of GitHub API calls composer does, the CI runs into a rate limit. This causes jobs to fail or be aborted. Adding the GITHUB_TOKEN as auth method should avoid these rate limits.

Related Issues

Because of the amount of GitHub API calls composer does, the CI runs into a rate limit.
This causes jobs to fail or be aborted. By adding the GITHUB_TOKEN as auth method, this can be avoided.
@Potherca Potherca requested a review from jrfnl January 5, 2023 10:41
Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

Reviewed:

  1. While I'm not sure it will solve all the issues (the most recent ones point to an issue with powershell ?), I totally agree that this should help.
  2. Do we really need it in all workflows though ? Or only in the integrationtest.yml file ? (which is the only one which has been giving us trouble)
  3. Is setting it via env: COMPOSER_AUTH the right way to set this ? Or should we leverage the setup-php action for this ? (which can set the Composer authentication up persistently)
    Ref: https://github.com/shivammathur/setup-php#github-composer-authentication

@Potherca
Copy link
Member Author

Potherca commented Jan 5, 2023

Accidentaly pressed the "Request Review" button again. Sorry!

@Potherca Potherca added this to the Not Version Related milestone Jan 5, 2023
@Potherca
Copy link
Member Author

Potherca commented Jan 5, 2023

From what I could see, the error in the powershell were triggered by composer, caused by the rate limit:

Run shivammathur/setup-php@v2
"C:\Program Files\PowerShell\7\pwsh.exe" D:\a_actions\shivammathur\setup-php\v2\src\scripts\run.ps1

...
==> Setup Tools
✗ composer 403: rate limit exceeded
Error: The process 'C:\Program Files\PowerShell\7\pwsh.exe' failed with exit code 1

https://github.com/PHPCSStandards/composer-installer/actions/runs/3845986458/jobs/6550770322#step:3:27

The fix was proposed in ramsey/composer-install#182 (comment) but sadly this change does not seem to fix the rate limit issue so another approach seems needed. I'll take a look at the setup-php docs.

I just added it to all workflows that do a composer install/update just to be safe (as I have no idea how the rate limit between GitHub / Composer / GHA.

Leaving this for now.

@Potherca Potherca marked this pull request as draft January 5, 2023 11:13
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.

None yet

2 participants