diff --git a/templates/full-pipeline.yml b/templates/full-pipeline.yml index 78ccb43a487d5e714f695d05fd4907c6d2bf540e..fb3ad85e4bce3d63722bbad012b11350928be635 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 f060425c883aabf10ff3ab3493e257c7eb09d5a3..e433a001479e066ff8fdd6a17e54f1546171fc28 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 c286d6b11999ac8fdc5cac299d1db62a4d475054..81e3229a544d903849d652dab2ca63fc52545d67 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 a5748ff94dc2f456a5026c435c775cd5d1602053..6894293cc9efbce95c1696a943ce5e85b5b8d04f 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 fead8d0532c73423bbcfa40ffddaff73ca90930c..00f39afb0be07543c00984d39a160935a182bcfc 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 db33ead60c5d927b6118b0094fe43230eac19062..481d7feabcb24a5ab4ac667a971a7db4b4f16331 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 1c3fbf5ef9d2685d28aa2c98dcf00e97d09fddfa..38c4b3fec0f9c161a656b67586a485813a0ecb38 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 90e8bc1b7a8208b7f188b652a19aefd0f3d04204..0ab3012b403e9fd5da57ceb087ccbf99259aded1 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