This is done now for core +10.1.x and all contrib. This is a follow up for D7.
Problem/Motivation
When testing an updated version of the gitlab-runner on selected issues, some jobs would fail due to composer being run as root (https://getcomposer.org/root).
The current runners don't seem to have a problem with that, but rather than leaving this option unchecked and dependant on the runner, we should make clear via an environment variable.
Whether we change this behaviour in the future or not (ie: run commands as root or not) is out of the scope of this issue for now, but adding this fix will ensure that everything works as expected in the current and the new gitlab-runner.
Steps to reproduce
This is from core, using the new runner, but both core and contrib should have this variable set: https://git.drupalcode.org/issue/drupal-3022876/-/jobs/1305555
Proposed resolution
For now, setting COMPOSER_ALLOW_SUPERUSER=1 should be enough.
Remaining tasks
MR
Issue fork drupal-3441050
Show commands
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:
- 3441050-gitlab-d.o-infra
compare
- 3441050-add-needed-variable
changes, plain diff MR !7503
Comments
Comment #3
fjgarlin commentedSame fix as core D10+ #3440421: [GitLab d.o infra] Allow superuser to call composer on jobs and all contrib #3440420: [GitLab d.o infra] Allow superuser to call composer on jobs.
MR: https://git.drupalcode.org/project/drupal/-/merge_requests/7503/diffs
Comment #4
drummLooks good!
Comment #6
poker10 commentedI have compared this to D10+ code and it looks the same. Do not see any issue with it, so let's not hold this. Committed and pushed to 7.x, thanks!