Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/danger
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /danger
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'danger')
-rw-r--r--danger/documentation/Dangerfile2
-rw-r--r--danger/product_intelligence/Dangerfile2
-rw-r--r--danger/qa_selector/Dangerfile29
-rw-r--r--danger/stable_branch_patch/Dangerfile11
4 files changed, 39 insertions, 5 deletions
diff --git a/danger/documentation/Dangerfile b/danger/documentation/Dangerfile
index 1e94af391c8..150109eff51 100644
--- a/danger/documentation/Dangerfile
+++ b/danger/documentation/Dangerfile
@@ -40,6 +40,6 @@ markdown(<<~MARKDOWN)
The review does not need to block merging this merge request. See the:
- [Metadata for the `*.md` files](https://docs.gitlab.com/ee/development/documentation/#metadata) that you've changed. The first few lines of each `*.md` file identify the stage and group most closely associated with your docs change.
- - The [Technical Writer assigned](https://about.gitlab.com/handbook/engineering/technical-writing/#assignments) for that stage and group.
+ - The [Technical Writer assigned](https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments) for that stage and group.
- [Documentation workflows](https://docs.gitlab.com/ee/development/documentation/workflow.html) for information on when to assign a merge request for review.
MARKDOWN
diff --git a/danger/product_intelligence/Dangerfile b/danger/product_intelligence/Dangerfile
index 1be549f139f..86888fe542e 100644
--- a/danger/product_intelligence/Dangerfile
+++ b/danger/product_intelligence/Dangerfile
@@ -3,3 +3,5 @@
product_intelligence.check!
product_intelligence.check_affected_scopes!
+
+product_intelligence.check_usage_data_insertions!
diff --git a/danger/qa_selector/Dangerfile b/danger/qa_selector/Dangerfile
index a20e626c694..b781f390a1a 100644
--- a/danger/qa_selector/Dangerfile
+++ b/danger/qa_selector/Dangerfile
@@ -1,9 +1,13 @@
# frozen_string_literal: true
-def filter_changed_lines(files)
+data_qa_selectors = /qa_selector|data-qa-selector/
+
+deprecated_qa_selectors = /(?!.*\bdata-qa-)(?=class=.*qa-.*|class: .*qa-.*)/
+
+def filter_changed_lines(files, pattern)
lines = []
files.each do |file|
- qa_selector_changed_lines = helper.changed_lines(file).select { |line| line =~ /qa_selector|data-qa-selector/ }
+ qa_selector_changed_lines = helper.changed_lines(file).select { |line| line =~ pattern }
next unless qa_selector_changed_lines.any?
lines += ["file `#{file}`:", qa_selector_changed_lines]
@@ -15,9 +19,11 @@ 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)
+lines_with_qa_selectors = filter_changed_lines(changed_code_files, data_qa_selectors)
+
+deprecated_qa_class = filter_changed_lines(changed_code_files, deprecated_qa_selectors)
-return if lines_with_qa_selectors.empty?
+return if (lines_with_qa_selectors + deprecated_qa_class).empty?
markdown(<<~MARKDOWN)
## QA Selectors
@@ -40,3 +46,18 @@ if lines_with_qa_selectors.any?
warn "This merge request contains lines with QA selectors. Please ensure `e2e:package-and-test` job is run."
end
+
+if deprecated_qa_class.any?
+ markdown(<<~MARKDOWN)
+ ### Deprecated .qa-selector class
+
+ The following lines in this MR contain deprecated qa class selectors:
+
+ * #{deprecated_qa_class.join("\n* ")}
+
+ Please ensure all deprecated qa class selectors are replaced with data-qa-selectors in accordance with our [Testing Guide](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/page_objects.html#data-qa-selector-vs-qa-selector).
+
+ MARKDOWN
+
+ warn "This merge request contains deprecated .qa-selector CSS class. Please use data-qa-selector attribute instead."
+end
diff --git a/danger/stable_branch_patch/Dangerfile b/danger/stable_branch_patch/Dangerfile
index b3326e82020..258daa7d1fa 100644
--- a/danger/stable_branch_patch/Dangerfile
+++ b/danger/stable_branch_patch/Dangerfile
@@ -1,3 +1,14 @@
# frozen_string_literal: true
+if stable_branch.non_security_stable_branch?
+ markdown(<<~MARKDOWN)
+ ### QA `e2e:package-and-test`
+
+ **@#{helper.mr_author}, the `package-and-test` job must complete before merging this merge request.***
+
+ If there are failures on the `package-and-test` pipeline, ping your team's associated Software Engineer in Test (SET) to confirm
+ the failures are unrelated to the merge request. If there's no SET assigned, ask for assistance on the `#quality` Slack channel.
+ MARKDOWN
+end
+
stable_branch.check!