summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-10-24 15:21:36 +0000
committerRobert Speicher <robert@gitlab.com>2018-10-24 15:21:36 +0000
commit220b9d7b659698a64342a2bc13d41fde27086abd (patch)
tree93d4b2e85a01d66276319e64b2558f260b27b74b
parent821e3959071fa3730cc1cc8db54842bfddeb01f2 (diff)
parent0e616d71fb5a7a13da40767e0b48d3b4ca7b5a43 (diff)
downloadgitlab-ce-220b9d7b659698a64342a2bc13d41fde27086abd.tar.gz
Merge branch 'consider-added-specs-in-danger-checks' into 'master'
Also count specs in new files in Danger check See merge request gitlab-org/gitlab-ce!22543
-rw-r--r--danger/specs/Dangerfile6
1 files changed, 4 insertions, 2 deletions
diff --git a/danger/specs/Dangerfile b/danger/specs/Dangerfile
index 97188df8785..a526bb8adaa 100644
--- a/danger/specs/Dangerfile
+++ b/danger/specs/Dangerfile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
NO_SPECS_LABELS = %w[backstage Documentation QA].freeze
NO_NEW_SPEC_MESSAGE = <<~MSG.freeze
You've made some app changes, but didn't add any tests.
@@ -9,8 +11,8 @@ def presented_no_changelog_labels
NO_SPECS_LABELS.map { |label| "~#{label}" }.join(', ')
end
-has_app_changes = !git.modified_files.grep(%r{\A(ee/)?(app|lib|db/(geo/)?(post_)?migrate)/}).empty?
-has_spec_changes = !git.modified_files.grep(%r{\A(ee/)?spec/}).empty?
+has_app_changes = !helper.all_changed_files.grep(%r{\A(ee/)?(app|lib|db/(geo/)?(post_)?migrate)/}).empty?
+has_spec_changes = !helper.all_changed_files.grep(%r{\A(ee/)?spec/}).empty?
new_specs_needed = (gitlab.mr_labels & NO_SPECS_LABELS).empty?
if has_app_changes && !has_spec_changes && new_specs_needed