Migrate usage of only/except to rules in our Terraform templates
Problem to solve
Accordingly to our only / exception
docs we should favor the usage of rules
instead, which is more powerful and flexible.
/cc @hartzell who noticed this.
Proposal
Stop using only / exception
and migrate to use rules
.
Further details
rules
can't be used in conjunction with only
. So this might be a breaking change for one that is customizing their usage of the Terraform base templates.
Therefore this could probably be changed on latest
templates but not on stable ones. For those we should aim to communicate and change on our yearly major version.
Documentation
The documentation for the template usage lives here. Though, we don't say much about its implementation.
Availability & Testing
Some tests might need to be updated: https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/lib/gitlab/ci/templates/terraform_latest_gitlab_ci_yaml_spec.rb
What does success look like, and how can we measure that?
All the template feature still work with their default configuration. We should use existing example terraform projects and test them on our environments.