From 9336f64b232694ea91135b478bb8813ef47343e6 Mon Sep 17 00:00:00 2001 From: Timo Furrer <tfurrer@gitlab.com> Date: Wed, 6 Nov 2024 14:41:50 +0100 Subject: [PATCH] Rename `warning_on_none_empty_plan` to `warning_on_non_empty_plan` Changelog: changed --- templates/full-pipeline.yml | 4 ++-- templates/job-templates.yml | 4 ++-- templates/plan.yml | 12 ++++++------ templates/validate-plan-apply.yml | 4 ++-- templates/validate-plan-destroy.yml | 4 ++-- templates/validate-plan.yml | 4 ++-- ...ab-ci.yml => WarningOnNonEmptyPlan.gitlab-ci.yml} | 2 +- tests/integration.gitlab-ci.yml | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) rename tests/integration-tests/{WarningOnNoneEmptyPlan.gitlab-ci.yml => WarningOnNonEmptyPlan.gitlab-ci.yml} (96%) diff --git a/templates/full-pipeline.yml b/templates/full-pipeline.yml index 78ccb43..fb3ad85 100644 --- a/templates/full-pipeline.yml +++ b/templates/full-pipeline.yml @@ -149,7 +149,7 @@ spec: - when: manual type: array description: 'Defines the `rules` of the `delete-state` job.' - warning_on_none_empty_plan: + warning_on_non_empty_plan: default: false type: boolean description: 'Whether to mark the job with a warning if the plan contains a diff.' @@ -218,7 +218,7 @@ include: artifacts_access: $[[ inputs.plan_artifacts_access ]] var_file: $[[ inputs.var_file ]] rules: $[[ inputs.plan_rules ]] - warning_on_none_empty_plan: $[[ inputs.warning_on_none_empty_plan ]] + warning_on_non_empty_plan: $[[ inputs.warning_on_non_empty_plan ]] - local: '/templates/apply.yml' inputs: as: '$[[ inputs.job_name_prefix ]]apply' diff --git a/templates/job-templates.yml b/templates/job-templates.yml index f060425..e433a00 100644 --- a/templates/job-templates.yml +++ b/templates/job-templates.yml @@ -95,7 +95,7 @@ spec: default: '' type: string description: 'Path to a variables files relative to root_dir.' - warning_on_none_empty_plan: + warning_on_non_empty_plan: default: false type: boolean description: 'Whether to mark the job with a warning if the plan contains a diff.' @@ -165,7 +165,7 @@ include: state_name: $[[ inputs.state_name ]] plan_name: $[[ inputs.plan_name ]] var_file: $[[ inputs.var_file ]] - warning_on_none_empty_plan: $[[ inputs.warning_on_none_empty_plan ]] + warning_on_non_empty_plan: $[[ inputs.warning_on_non_empty_plan ]] - local: '/templates/apply.yml' inputs: as: '$[[ inputs.job_name_prefix ]]apply' diff --git a/templates/plan.yml b/templates/plan.yml index c286d6b..81e3229 100644 --- a/templates/plan.yml +++ b/templates/plan.yml @@ -93,7 +93,7 @@ spec: default: pull-push type: string description: 'Defines the cache policy of the job.' - warning_on_none_empty_plan: + warning_on_non_empty_plan: default: false type: boolean description: 'Whether to mark the job with a warning if the plan contains a diff.' @@ -101,7 +101,7 @@ spec: --- # NOTE: the two following jobs are necessary to implement the abstraction logic -# required for the `warning_on_none_empty_plan` input. +# required for the `warning_on_non_empty_plan` input. # Without any kind of flow control support for the GitLab CI YAML we cannot infer # another value from the input. However, we can clearly apply "inheritance" to # customize behavior related to the CI keywords that have otherwise nothing @@ -116,8 +116,8 @@ spec: '$[[ inputs.as ]]': stage: $[[ inputs.stage ]] extends: - # NOTE: see the comment above. This is to support the `warning_on_none_empty_plan` input. - - '.$[[ inputs.as ]]:detailed_exitcode:warning:$[[ inputs.warning_on_none_empty_plan ]]' + # NOTE: see the comment above. This is to support the `warning_on_non_empty_plan` input. + - '.$[[ inputs.as ]]:detailed_exitcode:warning:$[[ inputs.warning_on_non_empty_plan ]]' environment: name: $[[ inputs.state_name ]] action: prepare @@ -145,8 +145,8 @@ spec: TF_STATE_NAME: $[[ inputs.state_name ]] TF_PLAN_NAME: $[[ inputs.plan_name ]] OPENTOFU_COMPONENT_VAR_FILE: '$[[ inputs.var_file ]]' - OPENTOFU_COMPONENT_USE_DETAILED_EXITCODE: '$[[ inputs.warning_on_none_empty_plan ]]' - # NOTE: we rely on correct exitcode reporting behavior for the `warning_on_none_empty_plan` input + OPENTOFU_COMPONENT_USE_DETAILED_EXITCODE: '$[[ inputs.warning_on_non_empty_plan ]]' + # NOTE: we rely on correct exitcode reporting behavior for the `warning_on_non_empty_plan` input # behavior. However, when using bash the runner does not work properly without setting # the feature flag below to `true`. FF_USE_NEW_BASH_EVAL_STRATEGY: 'true' diff --git a/templates/validate-plan-apply.yml b/templates/validate-plan-apply.yml index a5748ff..6894293 100644 --- a/templates/validate-plan-apply.yml +++ b/templates/validate-plan-apply.yml @@ -119,7 +119,7 @@ spec: when: manual type: array description: 'Defines the `rules` of the `apply` job.' - warning_on_none_empty_plan: + warning_on_non_empty_plan: default: false type: boolean description: 'Whether to mark the job with a warning if the plan contains a diff.' @@ -172,7 +172,7 @@ include: var_file: $[[ inputs.var_file ]] rules: $[[ inputs.plan_rules ]] cache_policy: pull - warning_on_none_empty_plan: $[[ inputs.warning_on_none_empty_plan ]] + warning_on_non_empty_plan: $[[ inputs.warning_on_non_empty_plan ]] - local: '/templates/apply.yml' inputs: as: '$[[ inputs.job_name_prefix ]]apply' diff --git a/templates/validate-plan-destroy.yml b/templates/validate-plan-destroy.yml index fead8d0..00f39af 100644 --- a/templates/validate-plan-destroy.yml +++ b/templates/validate-plan-destroy.yml @@ -124,7 +124,7 @@ spec: - when: manual type: array description: 'Defines the `rules` of the `delete-state` job.' - warning_on_none_empty_plan: + warning_on_non_empty_plan: default: false type: boolean description: 'Whether to mark the job with a warning if the plan contains a diff.' @@ -178,7 +178,7 @@ include: var_file: $[[ inputs.var_file ]] rules: $[[ inputs.plan_rules ]] cache_policy: pull - warning_on_none_empty_plan: $[[ inputs.warning_on_none_empty_plan ]] + warning_on_non_empty_plan: $[[ inputs.warning_on_non_empty_plan ]] - local: '/templates/destroy.yml' inputs: as: '$[[ inputs.job_name_prefix ]]destroy' diff --git a/templates/validate-plan.yml b/templates/validate-plan.yml index db33ead..481d7fe 100644 --- a/templates/validate-plan.yml +++ b/templates/validate-plan.yml @@ -105,7 +105,7 @@ spec: - if: $CI_COMMIT_BRANCH # If there's no open merge request, add it to a *branch* pipeline instead. type: array description: 'Defines the `rules` of the `plan` job.' - warning_on_none_empty_plan: + warning_on_non_empty_plan: default: false type: boolean description: 'Whether to mark the job with a warning if the plan contains a diff.' @@ -158,4 +158,4 @@ include: var_file: $[[ inputs.var_file ]] rules: $[[ inputs.plan_rules ]] cache_policy: pull - warning_on_none_empty_plan: $[[ inputs.warning_on_none_empty_plan ]] + warning_on_non_empty_plan: $[[ inputs.warning_on_non_empty_plan ]] diff --git a/tests/integration-tests/WarningOnNoneEmptyPlan.gitlab-ci.yml b/tests/integration-tests/WarningOnNonEmptyPlan.gitlab-ci.yml similarity index 96% rename from tests/integration-tests/WarningOnNoneEmptyPlan.gitlab-ci.yml rename to tests/integration-tests/WarningOnNonEmptyPlan.gitlab-ci.yml index 1c3fbf5..38c4b3f 100644 --- a/tests/integration-tests/WarningOnNoneEmptyPlan.gitlab-ci.yml +++ b/tests/integration-tests/WarningOnNonEmptyPlan.gitlab-ci.yml @@ -7,7 +7,7 @@ include: opentofu_version: $OPENTOFU_VERSION root_dir: $TEST_TF_ROOT state_name: $TEST_TF_STATE_NAME - warning_on_none_empty_plan: true + warning_on_non_empty_plan: true # For CI Terraform state cleanup - component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/delete-state@$CI_COMMIT_SHA diff --git a/tests/integration.gitlab-ci.yml b/tests/integration.gitlab-ci.yml index 90e8bc1..0ab3012 100644 --- a/tests/integration.gitlab-ci.yml +++ b/tests/integration.gitlab-ci.yml @@ -16,7 +16,7 @@ component: - ModuleRelease - Destroy - VarFile - - WarningOnNoneEmptyPlan + - WarningOnNonEmptyPlan GITLAB_OPENTOFU_BASE_IMAGE_OS: - alpine - debian -- GitLab