summaryrefslogtreecommitdiff
path: root/danger
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-15 09:09:35 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-15 09:09:35 +0000
commit32e53ae7d739e9457ef81ba4a441a3acb4446240 (patch)
tree33ddf07292cdbf9fb0be6b54e73360947bffe81a /danger
parent01ef10900ad5ce2efea5abe6bbbc6d118b9ee6f8 (diff)
downloadgitlab-ce-32e53ae7d739e9457ef81ba4a441a3acb4446240.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'danger')
-rw-r--r--danger/vue_shared_documentation/Dangerfile22
1 files changed, 22 insertions, 0 deletions
diff --git a/danger/vue_shared_documentation/Dangerfile b/danger/vue_shared_documentation/Dangerfile
new file mode 100644
index 00000000000..103ef3591af
--- /dev/null
+++ b/danger/vue_shared_documentation/Dangerfile
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+def has_matching_story?(file)
+ File.file?(file.dup.sub!(/\.vue$/, '.stories.js'))
+end
+
+def get_vue_shared_files(files)
+ files.select do |file|
+ file.end_with?('.vue') &&
+ file.include?('vue_shared/') &&
+ !has_matching_story?(file)
+ end
+end
+
+vue_shared_candidates = get_vue_shared_files(helper.all_changed_files)
+
+return if vue_shared_candidates.empty?
+
+documentation_url = 'https://docs.gitlab.com/ce/development/fe_guide/storybook'
+file_list = "- #{vue_shared_candidates.map { |path| "`#{path}`" }.join("\n- ")}"
+
+warn "This merge request changed undocumented Vue components in `vue_shared/`. Please consider [creating Stories](#{documentation_url}) for these components:\n#{file_list}"