Support variable expansion in services:variables: keyword

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Variables are not propagated from Project-level definitions to CI Services

Steps to reproduce

  • Define a variable in a Gitlab project via the UI
  • Make a .gitlab-ci.yml file that starts a service that references that variable (I used docker:dind and DOCKER_TLS_CERTDIR)
  • See that the service doesn't get the variable value from the project
  • As a workaround, define the variable in the service definition, eg:
default:
  services:
    - name: docker:25.0.2-dind
      variables:
        DOCKER_TLS_CERTDIR: $DOCKER_TLS_CERTDIR
  • Now see that the service is provided the variable.

What is the current bug behavior?

Project variables are not passed to CI services.

What is the expected correct behavior?

Project variables are passed to CI services.

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖