- Issue created by @murz
- πͺπΈSpain fjgarlin
Right now, we only have one development branch and we are not thinking about creating a new one or maintaining two versions of the templates (https://project.pages.drupalcode.org/gitlab_templates/help/contributing/). There are many improvements or things that we would have done differently if we were to start again, but I think the templates are stable enough for all contrib.
With the related issue, if it goes through, we'll have the ability to run tests as root or not, and that would solve problems like the environment variables.
I'm going to mark this as postponed as it'll either be a breaking change or might require maintaining multiple branches/versions, which we don't want at the moment.
- πΊπΈUnited States cmlara
I believe switching the container itself would actually be a drupalci_environments changes not a gitlab-templates change wouldn't it? in quick reading some runner configs can control the run-user so might even be a drupal-infra issue.
However before this goes over to another project I want to ask, what is your goal in doing so? Is it you want to provide your own alternative to the drupalci images and your images do not run as root? if so that is actually something we could do today, by adding sudo to EVERY command. The before_script and after_script impacts are on the individual contrib project at that point and are back within not being an api break.
If this is solely just because of the issues with sudo -H -E for run-tests.sh that issue will be solved. Switching the images to run as www-data just to fix run-tests.sh is as much a workaround as is using the --php flag or trying to run the tests as root. It was been known for a year that it wasn't a sudo issue it was a run-tests.sh bug, no sure why effort was expended in avoiding the root cause.
Not using root by default isn't really obviously better or worse in the context of these disposable containers, if the running user can gain root seurity risks exist,. In some ways it is actually safer to use root for the 'safe' commands (templates controls and doesn't allow loading 3rd party libraries) and prohibit www-data from having sudo to root (an exploit in a 3rd party library downloaded by composer would not be able to sudo out of the www-data barrier acting as a hindrance to a container escape exploit).