diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-01 09:09:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-01 09:09:45 +0300 |
commit | 533ef6532ae5499b8ff2f886cbc677844c7b82e1 (patch) | |
tree | 26fdc7ca683c23bc2bc940b23fc3f11ded05fcae /danger/specs | |
parent | 7658b09b49ce4abfc402682d446ce263017f3a57 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'danger/specs')
-rw-r--r-- | danger/specs/Dangerfile | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/danger/specs/Dangerfile b/danger/specs/Dangerfile index 35476ae645d..7cc68407170 100644 --- a/danger/specs/Dangerfile +++ b/danger/specs/Dangerfile @@ -32,11 +32,12 @@ request specs (and/or feature specs). Please add request specs under See https://gitlab.com/groups/gitlab-org/-/epics/5076 for information. MSG -has_app_changes = helper.all_changed_files.grep(%r{\A(app|lib|db/(geo/)?(post_)?migrate)/}).any? -has_ee_app_changes = helper.all_changed_files.grep(%r{\Aee/(app|lib|db/(geo/)?(post_)?migrate)/}).any? -spec_changes = helper.all_changed_files.grep(%r{\Aspec/}) +all_changed_files = helper.all_changed_files +has_app_changes = all_changed_files.grep(%r{\A(app|lib|db/(geo/)?(post_)?migrate)/}).any? +has_ee_app_changes = all_changed_files.grep(%r{\Aee/(app|lib|db/(geo/)?(post_)?migrate)/}).any? +spec_changes = specs.changed_specs_files(ee: :exclude) has_spec_changes = spec_changes.any? -has_ee_spec_changes = helper.all_changed_files.grep(%r{\Aee/spec/}).any? +has_ee_spec_changes = specs.changed_specs_files(ee: :only).any? new_specs_needed = (gitlab.mr_labels & NO_SPECS_LABELS).empty? if (has_app_changes || has_ee_app_changes) && !(has_spec_changes || has_ee_spec_changes) && new_specs_needed @@ -49,6 +50,10 @@ if has_ee_app_changes && has_spec_changes && !(has_app_changes || has_ee_spec_ch end # Forbidding a new file addition under `/spec/controllers` or `/ee/spec/controllers` -if git.added_files.grep(%r{^(ee/)?spec/controllers/}).any? +if project_helper.changes.added.files.grep(%r{^(ee/)?spec/controllers/}).any? warn CONTROLLER_SPEC_DEPRECATION_MESSAGE end + +specs.changed_specs_files.each do |filename| + specs.add_suggestions_for_match_with_array(filename) +end |