diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /danger | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'danger')
-rw-r--r-- | danger/plugins/stable_branch.rb | 9 | ||||
-rw-r--r-- | danger/plugins/user_types.rb | 9 | ||||
-rw-r--r-- | danger/product_intelligence/Dangerfile | 2 | ||||
-rw-r--r-- | danger/qa_selector/Dangerfile | 42 | ||||
-rw-r--r-- | danger/specs/Dangerfile | 2 | ||||
-rw-r--r-- | danger/stable_branch_patch/Dangerfile | 3 | ||||
-rw-r--r-- | danger/user_types/Dangerfile | 3 |
7 files changed, 70 insertions, 0 deletions
diff --git a/danger/plugins/stable_branch.rb b/danger/plugins/stable_branch.rb new file mode 100644 index 00000000000..81dae35ff24 --- /dev/null +++ b/danger/plugins/stable_branch.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require_relative '../../tooling/danger/stable_branch' + +module Danger + class StableBranch < ::Danger::Plugin + include Tooling::Danger::StableBranch + end +end diff --git a/danger/plugins/user_types.rb b/danger/plugins/user_types.rb new file mode 100644 index 00000000000..4f7dd572224 --- /dev/null +++ b/danger/plugins/user_types.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require_relative '../../tooling/danger/user_types' + +module Danger + class UserTypes < ::Danger::Plugin + include Tooling::Danger::UserTypes + end +end diff --git a/danger/product_intelligence/Dangerfile b/danger/product_intelligence/Dangerfile index c38d87604cc..1be549f139f 100644 --- a/danger/product_intelligence/Dangerfile +++ b/danger/product_intelligence/Dangerfile @@ -1,3 +1,5 @@ # frozen_string_literal: true product_intelligence.check! + +product_intelligence.check_affected_scopes! diff --git a/danger/qa_selector/Dangerfile b/danger/qa_selector/Dangerfile new file mode 100644 index 00000000000..a20e626c694 --- /dev/null +++ b/danger/qa_selector/Dangerfile @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +def filter_changed_lines(files) + lines = [] + files.each do |file| + qa_selector_changed_lines = helper.changed_lines(file).select { |line| line =~ /qa_selector|data-qa-selector/ } + next unless qa_selector_changed_lines.any? + + lines += ["file `#{file}`:", qa_selector_changed_lines] + end + lines +end + +changed_code_files = helper.changed_files(/\.(vue|haml|js|rb)$/) + +return if changed_code_files.empty? + +lines_with_qa_selectors = filter_changed_lines(changed_code_files) + +return if lines_with_qa_selectors.empty? + +markdown(<<~MARKDOWN) + ## QA Selectors + +MARKDOWN + +if lines_with_qa_selectors.any? + markdown(<<~MARKDOWN) + The following changed lines in this MR contain QA selectors: + + * #{lines_with_qa_selectors.join("\n* ")} + + Please ensure `e2e:package-and-test` job is run and the tests are passing. + + For the list of known failures please refer to [the latest pipeline triage issue](https://gitlab.com/gitlab-org/quality/pipeline-triage/-/issues). + + If your changes are under a feature flag, please check our [Testing with feature flags](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/feature_flags.html#automatic-test-execution-when-a-feature-flag-definition-changes) documentation for instructions. + + MARKDOWN + + warn "This merge request contains lines with QA selectors. Please ensure `e2e:package-and-test` job is run." +end diff --git a/danger/specs/Dangerfile b/danger/specs/Dangerfile index 145f7237458..d17c17bc545 100644 --- a/danger/specs/Dangerfile +++ b/danger/specs/Dangerfile @@ -2,6 +2,7 @@ NO_SPECS_LABELS = [ 'maintenance::pipelines', + 'maintenance::refactor', 'maintenance::workflow', 'documentation', 'QA' @@ -56,4 +57,5 @@ end specs.changed_specs_files.each do |filename| specs.add_suggestions_for_match_with_array(filename) specs.add_suggestions_for_project_factory_usage(filename) + specs.add_suggestions_for_feature_category(filename) end diff --git a/danger/stable_branch_patch/Dangerfile b/danger/stable_branch_patch/Dangerfile new file mode 100644 index 00000000000..b3326e82020 --- /dev/null +++ b/danger/stable_branch_patch/Dangerfile @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +stable_branch.check! diff --git a/danger/user_types/Dangerfile b/danger/user_types/Dangerfile new file mode 100644 index 00000000000..4b7ab1dbe39 --- /dev/null +++ b/danger/user_types/Dangerfile @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +user_types.bot_user_types_change_warning |