Closed (fixed)
Project:
Drupal core
Version:
12.0.x-dev
Component:
composer
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2026 at 14:54 UTC
Updated:
30 Oct 2026 at 18:35 UTC
Jump to comment: Most recent
Builds regularly fail because we reach GitHub rate limits. I've tried adding a GitHub PAT but they don't seem to be inherited by issue forks so that looks like a dead end.
Add a vendor cache similar to the lint cache.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
longwaveThe "Write lint caches" created a
vendorartifact and uploaded it: https://git.drupalcode.org/project/drupal/-/jobs/12919390The PHPCS on the next run downloaded it again and didn't need to touch GitHub: https://git.drupalcode.org/project/drupal/-/jobs/12919474
The PHPCS job took 60-69 seconds here if it has to do
composer install; with this additional caching it took 47 seconds.Bumping to critical as multiple CI pipelines are failing with the GitHub rate limit issue and this should solve them.
Comment #4
godotislateIs it possible to cache the vendor directory with a key based on composer.lock? That way all jobs within the same project that use the same composer.lock could reuse the vendor files?
Something like what's documented here: https://docs.gitlab.com/ci/caching/examples/#compute-the-cache-key-from-..., except using composer.lock?
Comment #5
longwaveNot with this artifact technique, but I don't think it's much of a problem. Unless something has changed on the DA side, GitLab caching is not really any use to us as it isn't shared between runners - as we have ephemeral k8s runners each cache expires when the runner is terminated.
This technique means that pushes to
mainbuild a cache*, then all subsequent MRs will download that cache from main. We can backport it to other branches if we need to and it will also work there the same way. As composer.lock is largely stable in branches unless we are actually testing dependency updates this should be fine for the majority of cases.(*) the cache was only built here because I used the special MR label to test it
Comment #6
godotislateSounds good.
I asked because the artifact URL looks to be built using the${CI_MERGE_REQUEST_IID}env variable, so my concern was whether other MRs or jobs would be able to access the same artifact.Edit: Actually that seems to apply only when testing the cache warming itself.
Comment #7
longwaveThis gave us a 4m16 pipeline run which is one of the fastest I have ever seen. On discussing with @catch I think we can improve this further by reusing the vendor cache in test jobs...
Comment #8
longwaveThis run was actually slower - 4m25 - due to test runner variance. Given that this also removes the fast-fail when phpcs or phpstan fail, which does probably save the DA some money, let's undo this.
Comment #9
longwaveAnalysing all the jobs run in this issue, the "composer setup" step takes about 8 seconds when it has to download from GitHub and about 3 seconds now when it doesn't.
This saves about 5 seconds wall clock time from each pipeline run - because the runs were all parallel before, it doesn't save any more unfortunately. But, as there were 7 jobs each running composer install in parallel before, this saves about 35 seconds of total runner time per pipeline, which should hopefully add up to some savings for the DA.
Comment #10
godotislateI see the vendor artifact being uploaded successfully in the Write lint caches job (such as https://git.drupalcode.org/project/drupal/-/jobs/12921005)
and downloaded successfully in the jobs like PHPCS: https://git.drupalcode.org/project/drupal/-/jobs/12921291
lgtm.
Comment #13
catchThis looks great to me, should mean less load during normal operation but also improve things when github itself is flaky.
We might want to open a gitlab templates issue to see if they could use the core vendor directory by branch once this lands?
edit: cross-posted with @godotislate's RTBC, but that means I can go ahead and commit this. Let's get the benefit for other MRs asap.
Committed/pushed to main and cherry-picked to 12.0.x, thanks!
Comment #15
longwaveThis broke the "Write lint caches" job in performance test, which negates the whole thing: https://git.drupalcode.org/project/drupal/-/jobs/12923864#L36
Will see if I can hotfix this...