diff --git a/danger/feature_flag/Dangerfile b/danger/feature_flag/Dangerfile index d44e83dbe537015030400bdf6a8f7a8e3a707a61..3ecd7541b142e836e28c5181d35bdfad504c03f4 100644 --- a/danger/feature_flag/Dangerfile +++ b/danger/feature_flag/Dangerfile @@ -1,17 +1,17 @@ # frozen_string_literal: true -SEE_DOC = "See the [feature flag documentation](https://docs.gitlab.com/ee/development/feature_flags#feature-flag-definition-and-validation)." +FF_SEE_DOC = "See the [feature flag documentation](https://docs.gitlab.com/ee/development/feature_flags#feature-flag-definition-and-validation)." FEATURE_FLAG_LABEL = "feature flag" FEATURE_FLAG_EXISTS_LABEL = "#{FEATURE_FLAG_LABEL}::exists" FEATURE_FLAG_SKIPPED_LABEL = "#{FEATURE_FLAG_LABEL}::skipped" DEVOPS_LABELS_REQUIRING_FEATURE_FLAG_REVIEW = ["devops::verify"] -SUGGEST_MR_COMMENT = <<~SUGGEST_COMMENT +FF_SUGGEST_MR_COMMENT = <<~SUGGEST_COMMENT ```suggestion group: "%<group>s" ``` -#{SEE_DOC} +#{FF_SEE_DOC} SUGGEST_COMMENT FEATURE_FLAG_ENFORCEMENT_WARNING = <<~WARNING_MESSAGE @@ -35,21 +35,21 @@ def check_feature_flag_yaml(feature_flag) end rescue Psych::Exception # YAML could not be parsed, fail the build. - fail "#{helper.html_link(feature_flag.path)} isn't valid YAML! #{SEE_DOC}" + fail "#{helper.html_link(feature_flag.path)} isn't valid YAML! #{FF_SEE_DOC}" rescue StandardError => e warn "There was a problem trying to check the Feature Flag file. Exception: #{e.class.name} - #{e.message}" end def message_for_feature_flag_missing_group!(feature_flag:, mr_group_label:) if mr_group_label.nil? - warn "Consider setting `group` in #{helper.html_link(feature_flag.path)}. #{SEE_DOC}" + warn "Consider setting `group` in #{helper.html_link(feature_flag.path)}. #{FF_SEE_DOC}" else mr_line = feature_flag.raw.lines.find_index("group:\n") if mr_line - markdown(format(SUGGEST_MR_COMMENT, group: mr_group_label), file: feature_flag.path, line: mr_line.succ) + markdown(format(FF_SUGGEST_MR_COMMENT, group: mr_group_label), file: feature_flag.path, line: mr_line.succ) else - warn %(Consider setting `group: "#{mr_group_label}"` in #{helper.html_link(feature_flag.path)}. #{SEE_DOC}) + warn %(Consider setting `group: "#{mr_group_label}"` in #{helper.html_link(feature_flag.path)}. #{FF_SEE_DOC}) end end end diff --git a/danger/saas_feature/Dangerfile b/danger/saas_feature/Dangerfile index 159201f8904cfd591c398df97c26f09d024c35c2..77c6362424ddf36fb912ae2f80e1dcfb991d9147 100644 --- a/danger/saas_feature/Dangerfile +++ b/danger/saas_feature/Dangerfile @@ -1,13 +1,13 @@ # frozen_string_literal: true -SEE_DOC = "see the [SaaS feature documentation](https://docs.gitlab.com/ee/development/ee_features.html#saas-only-feature)." +SF_SEE_DOC = "see the [SaaS feature documentation](https://docs.gitlab.com/ee/development/ee_features.html#saas-only-feature)." -SUGGEST_MR_COMMENT = <<~SUGGEST_COMMENT.freeze +SF_SUGGEST_MR_COMMENT = <<~SUGGEST_COMMENT.freeze ```suggestion group: "%<group>s" ``` - #{SEE_DOC.capitalize} + #{SF_SEE_DOC.capitalize} SUGGEST_COMMENT def check_yaml(saas_feature) @@ -20,7 +20,7 @@ def check_yaml(saas_feature) end rescue Psych::Exception # YAML could not be parsed, fail the build. - fail "#{helper.html_link(saas_feature.path)} isn't valid YAML! #{SEE_DOC.capitalize}" + fail "#{helper.html_link(saas_feature.path)} isn't valid YAML! #{SF_SEE_DOC.capitalize}" rescue StandardError => e warn "There was a problem trying to check the SaaS feature file. Exception: #{e.class.name} - #{e.message}" end @@ -31,13 +31,13 @@ def message_for_missing_group!(saas_feature:, mr_group_label:) end if mr_line - markdown(format(SUGGEST_MR_COMMENT, group: mr_group_label), file: saas_feature.path, line: mr_line.succ) + markdown(format(SF_SUGGEST_MR_COMMENT, group: mr_group_label), file: saas_feature.path, line: mr_line.succ) elsif mr_group_label warn %( - Consider setting `group: "#{mr_group_label}"` in #{helper.html_link(saas_feature.path)}. #{SEE_DOC.capitalize} + Consider setting `group: "#{mr_group_label}"` in #{helper.html_link(saas_feature.path)}. #{SF_SEE_DOC.capitalize} ) else - warn "Consider setting `group` in #{helper.html_link(saas_feature.path)}. #{SEE_DOC.capitalize}" + warn "Consider setting `group` in #{helper.html_link(saas_feature.path)}. #{SF_SEE_DOC.capitalize}" end end