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-3440421

Command icon 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:

Comments

fjgarlin created an issue. See original summary.

fjgarlin’s picture

fjgarlin’s picture

Title: [GitLab d.o infra] Allow superuser on jobs » [GitLab d.o infra] Allow superuser to call composer on jobs
Status: Active » Needs review

Ready to review first by @drumm / @nnewton / @maxwhitehead.

drumm’s picture

Status: Needs review » Reviewed & tested by the community

We currently set COMPOSER_ALLOW_SUPERUSER=1 for all of GitLab CI since it is a requirement for the new cluster. It would be great to remove that, so it is in control of each project, in case tests are no longer running as root.

  • alexpott committed a04e10e6 on 10.1.x
    Issue #3440421 by fjgarlin, drumm: [GitLab d.o infra] Allow superuser to...

  • alexpott committed eb84573b on 10.2.x
    Issue #3440421 by fjgarlin, drumm: [GitLab d.o infra] Allow superuser to...

  • alexpott committed 4e9481d1 on 10.3.x
    Issue #3440421 by fjgarlin, drumm: [GitLab d.o infra] Allow superuser to...

  • alexpott committed e462324d on 11.x
    Issue #3440421 by fjgarlin, drumm: [GitLab d.o infra] Allow superuser to...
alexpott’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

I pushed this back all the way to 10.1.x just in case we have a security release and we need to run tests.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.