Skip to content

Define resource_group by default for deployment jobs

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

Summary

We've shipped Resource Group that can ensure that multiple deployment jobs are not running concurrently to the same environment. This is important to avoid messing up an environment and should be defined by default (opt-out) rather than manually typing it into .gitlab-ci.yml (opt-in).

Proposal

  • Define resource_group: $CI_ENVIRONMENT_NAME to the deployment jobs by default.
  • If user explicitly defines resrouce_group to a job, it overwrites the default.

e.g.

review:
  environment:
    name: review/$CI_COMMIT_REF_NAME
    resource_group: $CI_ENVIRONMENT_NAME # This is hidden and enabled by default. If user defines `resource_group` explicitly, it takes over the value.

NOTE: $CI_ENVIRONMENT_NAME is not currently supported for resource_group. We need to extend the variable expansion support.

review:
  environment:
    name: review/$CI_COMMIT_REF_NAME
    resource_group: none # This job doesn't use semaphore.

TODO

  • Support resource_group: none to override/ignore a default resource_group.
  • Add support for $CI_ENVIRONMENT_NAME in resource_group string expansion.
  • Add default resource_group to .gitlab-ci.yml. Default is resource_group: $CI_ENVIRONMENT_NAME. It's defined for jobs with environment:.
  • Release a feature (docs and FF removal). And probably we need a light-weight blogpost to communicate with users that we're changing the default behavior of deployment jobs.
Edited by 🤖 GitLab Bot 🤖