From 31f80eb64b798121c0bd433a217fed2906666495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cunha?= Date: Thu, 22 Jun 2023 17:26:10 -0300 Subject: [PATCH 1/5] Adds more modern danger and roulette We were using a very old danger bot, which was introduced 2 years ago. Since then, the danger bot has evolved and its now simpler to configure and with more features. With this new approach: - we don't need to maintain the Dangerfile image. - we can use the same Danger that's been envisioned to work across gitlab-org projects. - specifying a danger token is not anymore needed for project inside the gitlab-org group. - we can easily import new danger rules, like the reviewer roulette. --- .gitlab-ci.yml | 41 ++++++++++++++++++++---------------- Dangerfile | 17 ++++++++++++--- Gemfile | 4 ++++ Gemfile.lock | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fe49ff8be..8191a88737 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -77,6 +77,11 @@ include: - template: Jobs/Secret-Detection.latest.gitlab-ci.yml - template: Jobs/SAST.latest.gitlab-ci.yml - template: Jobs/SAST-IaC.latest.gitlab-ci.yml + - project: 'gitlab-org/quality/pipeline-common' + file: + - '/ci/danger-review.yml' + rules: + - if: $CI_SERVER_HOST == "gitlab.com" dependency_scanning: needs: [] before_script: [] @@ -458,24 +463,24 @@ debug_review_gke122: - if: '$PIPELINE_TYPE =~ /STABLE_BRANCH_PIPELINE$/' - if: '$PIPELINE_TYPE =~ /FEATURE_BRANCH_PIPELINE$/' -danger-review: - image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger - stage: prepare - cache: {} - script: - - git version - - danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10) - - | - if [ ! -v DANGER_GITLAB_API_TOKEN ] && [ "${PIPELINE_TYPE}" = "FORK_MR_PIPELINE" ]; then - echo "Danger token not configured. As this is from a fork, failing danger gracefully." - exit 202 - fi - - danger --fail-on-errors=true --verbose --danger_id=${danger_id} - allow_failure: - exit_codes: 202 - rules: - - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/' - - if: '$PIPELINE_TYPE == "DOCS_PIPELINE"' +# danger-review: +# image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger +# stage: prepare +# cache: {} +# script: +# - git version +# - danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10) +# - | +# if [ ! -v DANGER_GITLAB_API_TOKEN ] && [ "${PIPELINE_TYPE}" = "FORK_MR_PIPELINE" ]; then +# echo "Danger token not configured. As this is from a fork, failing danger gracefully." +# exit 202 +# fi +# - danger --fail-on-errors=true --verbose --danger_id=${danger_id} +# allow_failure: +# exit_codes: 202 +# rules: +# - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/' +# - if: '$PIPELINE_TYPE == "DOCS_PIPELINE"' rubocop: image: ruby:3.0-alpine diff --git a/Dangerfile b/Dangerfile index e119761617..acb19f5acb 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,3 +1,14 @@ -danger.import_dangerfile(path: 'scripts/support/changelog') -danger.import_dangerfile(path: 'scripts/support/metadata') -danger.import_dangerfile(path: 'scripts/support/reviewers') +require "gitlab-dangerfiles" + +# Documentation reference: https://gitlab.com/gitlab-org/ruby/gems/gitlab-dangerfiles +Gitlab::Dangerfiles.for_project(self, 'gitlab-chart') do |dangerfiles| + # Import all plugins from the gem + dangerfiles.import_plugins + + # Import a defined set of danger rules + dangerfiles.import_dangerfiles(only: %w[simple_roulette type_label subtype_label changes_size z_retry_link]) +end + +# danger.import_dangerfile(path: 'scripts/support/changelog') +# danger.import_dangerfile(path: 'scripts/support/metadata') +# danger.import_dangerfile(path: 'scripts/support/reviewers') \ No newline at end of file diff --git a/Gemfile b/Gemfile index 483cfd11a3..86013a15a9 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,10 @@ group :development, :test do gem 'pry' end +group :development, :test, :danger do + gem 'gitlab-dangerfiles', '~> 3.11', require: false +end + group :development do gem 'solargraph' end diff --git a/Gemfile.lock b/Gemfile.lock index 8cbba4574b..e5be456c4a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,11 +50,35 @@ GEM capybara (>= 1.0, < 4) launchy childprocess (3.0.0) + claide (1.1.0) + claide-plugins (0.9.2) + cork + nap + open4 (~> 1.3) coderay (1.1.3) + colored2 (3.1.2) concord (0.1.6) adamantium (~> 0.2.0) equalizer (~> 0.0.9) concurrent-ruby (1.1.10) + cork (0.3.0) + colored2 (~> 3.1) + danger (9.2.0) + claide (~> 1.0) + claide-plugins (>= 0.9.2) + colored2 (~> 3.1) + cork (~> 0.1) + faraday (>= 0.9.0, < 3.0) + faraday-http-cache (~> 2.0) + git (~> 1.7) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.0) + no_proxy_fix + octokit (~> 5.0) + terminal-table (>= 1, < 4) + danger-gitlab (8.0.0) + danger + gitlab (~> 4.2, >= 4.2.0) debug_inspector (1.1.0) diff-lcs (1.5.0) docker-api (1.34.2) @@ -63,6 +87,21 @@ GEM e2mmap (0.1.0) equalizer (0.0.11) excon (0.62.0) + faraday (2.7.7) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-http-cache (2.5.0) + faraday (>= 0.8) + faraday-net_http (3.0.2) + git (1.11.0) + rchardet (~> 1.8) + gitlab (4.19.0) + httparty (~> 0.20) + terminal-table (>= 1.5.1) + gitlab-dangerfiles (3.11.0) + danger (>= 8.4.5) + danger-gitlab (>= 8.0.0) + rake gitlab-styles (9.0.0) rubocop (~> 1.36.0) rubocop-gitlab-security (~> 0.1.1) @@ -71,6 +110,9 @@ GEM rubocop-rails (~> 2.15) rubocop-rspec (~> 2.12) hash-deep-merge (0.1.1) + httparty (0.21.0) + mini_mime (>= 1.0.0) + multi_xml (>= 0.5.2) i18n (1.12.0) concurrent-ruby (~> 1.0) ice_nine (0.11.2) @@ -100,9 +142,16 @@ GEM ice_nine (~> 0.11.1) procto (~> 0.0.2) multi_json (1.13.1) + multi_xml (0.6.0) + nap (1.1.0) + no_proxy_fix (0.1.2) nokogiri (1.13.8) mini_portile2 (~> 2.8.0) racc (~> 1.4) + octokit (5.6.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + open4 (1.3.4) parallel (1.20.1) parser (3.2.2.0) ast (~> 2.4.1) @@ -121,6 +170,7 @@ GEM rack (>= 1.3) rainbow (3.0.0) rake (13.0.1) + rchardet (1.8.0) regexp_parser (1.8.2) reverse_markdown (2.1.1) nokogiri @@ -177,7 +227,11 @@ GEM rubocop-rspec (2.13.1) rubocop (~> 1.33) ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) rubyzip (2.3.0) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) @@ -195,6 +249,8 @@ GEM thor (~> 1.0) tilt (~> 2.0) yard (~> 0.9, >= 0.9.24) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) thor (1.2.1) thread_safe (0.3.6) tilt (2.0.11) @@ -226,6 +282,7 @@ DEPENDENCIES capybara capybara-screenshot docker-api + gitlab-dangerfiles (~> 3.11) gitlab-styles (~> 9.0) hash-deep-merge knapsack -- GitLab From 90ad1257d64d9edba3e80aa3c9d1242c7365ea2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cunha?= Date: Thu, 22 Jun 2023 18:44:17 -0300 Subject: [PATCH 2/5] Clean up dependencies --- .gitlab-ci.yml | 27 ++++--------- Dangerfile | 16 +++++--- Gemfile | 4 -- Gemfile.lock | 57 ---------------------------- scripts/support/reviewers/Dangerfile | 8 ++-- 5 files changed, 21 insertions(+), 91 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8191a88737..b6967e4eb4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -80,8 +80,7 @@ include: - project: 'gitlab-org/quality/pipeline-common' file: - '/ci/danger-review.yml' - rules: - - if: $CI_SERVER_HOST == "gitlab.com" + dependency_scanning: needs: [] before_script: [] @@ -463,24 +462,12 @@ debug_review_gke122: - if: '$PIPELINE_TYPE =~ /STABLE_BRANCH_PIPELINE$/' - if: '$PIPELINE_TYPE =~ /FEATURE_BRANCH_PIPELINE$/' -# danger-review: -# image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger -# stage: prepare -# cache: {} -# script: -# - git version -# - danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10) -# - | -# if [ ! -v DANGER_GITLAB_API_TOKEN ] && [ "${PIPELINE_TYPE}" = "FORK_MR_PIPELINE" ]; then -# echo "Danger token not configured. As this is from a fork, failing danger gracefully." -# exit 202 -# fi -# - danger --fail-on-errors=true --verbose --danger_id=${danger_id} -# allow_failure: -# exit_codes: 202 -# rules: -# - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/' -# - if: '$PIPELINE_TYPE == "DOCS_PIPELINE"' +danger-review: + rules: + - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/ && $PIPELINE_TYPE != "FORK_MR_PIPELINE"' + - if: '$PIPELINE_TYPE == "DOCS_PIPELINE"' + before_script: + - bundle add gitlab-dangerfiles rubocop: image: ruby:3.0-alpine diff --git a/Dangerfile b/Dangerfile index acb19f5acb..5026390864 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,14 +1,18 @@ require "gitlab-dangerfiles" -# Documentation reference: https://gitlab.com/gitlab-org/ruby/gems/gitlab-dangerfiles +# Documentation reference: https://gitlab.com/gitlab-org/ruby/gems/gitlab-dangerfiles Gitlab::Dangerfiles.for_project(self, 'gitlab-chart') do |dangerfiles| # Import all plugins from the gem dangerfiles.import_plugins # Import a defined set of danger rules - dangerfiles.import_dangerfiles(only: %w[simple_roulette type_label subtype_label changes_size z_retry_link]) -end + dangerfiles.import_dangerfiles(only: %w[simple_roulette z_retry_link]) -# danger.import_dangerfile(path: 'scripts/support/changelog') -# danger.import_dangerfile(path: 'scripts/support/metadata') -# danger.import_dangerfile(path: 'scripts/support/reviewers') \ No newline at end of file + # These custom files have the potential to be either discarded or simplified, + # as the default rules available to us already provide much if not all of + # of our customization. Still, let's investigate this in a follow-up. + # For now, we can simply introduce the simple_roulette. + danger.import_dangerfile(path: 'scripts/support/changelog') + danger.import_dangerfile(path: 'scripts/support/metadata') + danger.import_dangerfile(path: 'scripts/support/reviewers') +end diff --git a/Gemfile b/Gemfile index 86013a15a9..483cfd11a3 100644 --- a/Gemfile +++ b/Gemfile @@ -23,10 +23,6 @@ group :development, :test do gem 'pry' end -group :development, :test, :danger do - gem 'gitlab-dangerfiles', '~> 3.11', require: false -end - group :development do gem 'solargraph' end diff --git a/Gemfile.lock b/Gemfile.lock index e5be456c4a..8cbba4574b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,35 +50,11 @@ GEM capybara (>= 1.0, < 4) launchy childprocess (3.0.0) - claide (1.1.0) - claide-plugins (0.9.2) - cork - nap - open4 (~> 1.3) coderay (1.1.3) - colored2 (3.1.2) concord (0.1.6) adamantium (~> 0.2.0) equalizer (~> 0.0.9) concurrent-ruby (1.1.10) - cork (0.3.0) - colored2 (~> 3.1) - danger (9.2.0) - claide (~> 1.0) - claide-plugins (>= 0.9.2) - colored2 (~> 3.1) - cork (~> 0.1) - faraday (>= 0.9.0, < 3.0) - faraday-http-cache (~> 2.0) - git (~> 1.7) - kramdown (~> 2.3) - kramdown-parser-gfm (~> 1.0) - no_proxy_fix - octokit (~> 5.0) - terminal-table (>= 1, < 4) - danger-gitlab (8.0.0) - danger - gitlab (~> 4.2, >= 4.2.0) debug_inspector (1.1.0) diff-lcs (1.5.0) docker-api (1.34.2) @@ -87,21 +63,6 @@ GEM e2mmap (0.1.0) equalizer (0.0.11) excon (0.62.0) - faraday (2.7.7) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-http-cache (2.5.0) - faraday (>= 0.8) - faraday-net_http (3.0.2) - git (1.11.0) - rchardet (~> 1.8) - gitlab (4.19.0) - httparty (~> 0.20) - terminal-table (>= 1.5.1) - gitlab-dangerfiles (3.11.0) - danger (>= 8.4.5) - danger-gitlab (>= 8.0.0) - rake gitlab-styles (9.0.0) rubocop (~> 1.36.0) rubocop-gitlab-security (~> 0.1.1) @@ -110,9 +71,6 @@ GEM rubocop-rails (~> 2.15) rubocop-rspec (~> 2.12) hash-deep-merge (0.1.1) - httparty (0.21.0) - mini_mime (>= 1.0.0) - multi_xml (>= 0.5.2) i18n (1.12.0) concurrent-ruby (~> 1.0) ice_nine (0.11.2) @@ -142,16 +100,9 @@ GEM ice_nine (~> 0.11.1) procto (~> 0.0.2) multi_json (1.13.1) - multi_xml (0.6.0) - nap (1.1.0) - no_proxy_fix (0.1.2) nokogiri (1.13.8) mini_portile2 (~> 2.8.0) racc (~> 1.4) - octokit (5.6.1) - faraday (>= 1, < 3) - sawyer (~> 0.9) - open4 (1.3.4) parallel (1.20.1) parser (3.2.2.0) ast (~> 2.4.1) @@ -170,7 +121,6 @@ GEM rack (>= 1.3) rainbow (3.0.0) rake (13.0.1) - rchardet (1.8.0) regexp_parser (1.8.2) reverse_markdown (2.1.1) nokogiri @@ -227,11 +177,7 @@ GEM rubocop-rspec (2.13.1) rubocop (~> 1.33) ruby-progressbar (1.11.0) - ruby2_keywords (0.0.5) rubyzip (2.3.0) - sawyer (0.9.2) - addressable (>= 2.3.5) - faraday (>= 0.17.3, < 3) selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) @@ -249,8 +195,6 @@ GEM thor (~> 1.0) tilt (~> 2.0) yard (~> 0.9, >= 0.9.24) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) thor (1.2.1) thread_safe (0.3.6) tilt (2.0.11) @@ -282,7 +226,6 @@ DEPENDENCIES capybara capybara-screenshot docker-api - gitlab-dangerfiles (~> 3.11) gitlab-styles (~> 9.0) hash-deep-merge knapsack diff --git a/scripts/support/reviewers/Dangerfile b/scripts/support/reviewers/Dangerfile index debd97807a..37ea097486 100644 --- a/scripts/support/reviewers/Dangerfile +++ b/scripts/support/reviewers/Dangerfile @@ -1,13 +1,13 @@ # frozen_string_literal: true MESSAGE = <` to request the first review to someone. It's recommended that you pick the one suggested by the reviewre roulette. But you can ignore it and assign it to someone else if you see fit. -Merge requests are handled according to the workflow documented in our [handbook](https://about.gitlab.com/handbook/engineering/development/enablement/systems/distribution/merge_requests.html) and should receive a response within the limit documented in our [First-response SLO](https://about.gitlab.com/handbook/engineering/workflow/code-review/#first-response-slo). +Merge requests are handled according to the workflow documented in our [handbook](https://about.gitlab.com/handbook/engineering/development/enablement/systems/distribution/merge_requests.html#experimental-workflow) and should receive a response within the limit documented in our [First-response SLO](https://about.gitlab.com/handbook/engineering/workflow/code-review/#first-response-slo). -If you don't receive a response, please mention `@gitlab-org\/distribution`, or one of our [Project Maintainers](https://about.gitlab.com/handbook/engineering/projects/#gitlab-chart) +If you don't receive a response from the reviewer within the SLO, please mention `@gitlab-org\/distribution`, or one of our [Project Maintainers](https://about.gitlab.com/handbook/engineering/projects/#gitlab-chart) REV_EOF # Print maintainers message -- GitLab From a171914eea7b9173c32e5aa56ae5fd9cb25dbf6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cunha?= Date: Fri, 4 Aug 2023 12:02:22 -0300 Subject: [PATCH 3/5] Include danger helper calls --- scripts/support/changelog/Dangerfile | 2 +- scripts/support/metadata/Dangerfile | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/support/changelog/Dangerfile b/scripts/support/changelog/Dangerfile index d2d4175b40..abf4b12ee2 100644 --- a/scripts/support/changelog/Dangerfile +++ b/scripts/support/changelog/Dangerfile @@ -78,7 +78,7 @@ labels is available in #{SEE_DOC_WORKTYPE}. MSG -changelog_needed = (gitlab.mr_labels & NO_CHANGELOG_LABELS).empty? +changelog_needed = (helper.mr_labels & NO_CHANGELOG_LABELS).empty? if changelog_needed checked = 0 diff --git a/scripts/support/metadata/Dangerfile b/scripts/support/metadata/Dangerfile index 40fe9ca27b..e325a76cb6 100644 --- a/scripts/support/metadata/Dangerfile +++ b/scripts/support/metadata/Dangerfile @@ -13,43 +13,43 @@ WORKTYPE_LABELS = [ 'documentation' ].freeze -if gitlab.mr_body.size < 5 +if helper.mr_description.size < 5 fail "Please provide a proper merge request description." end -if gitlab.mr_labels.empty? +if helper.mr_labels.empty? fail "Please add labels to this merge request." end -warn "You may want to add ~group::distribution label to this MR for gitlab-insights" unless gitlab.mr_labels.include?("group::distribution") +warn "You may want to add ~group::distribution label to this MR for gitlab-insights" unless helper.mr_labels.include?("group::distribution") -unless gitlab.mr_json["assignee"] +if helper.mr_assignees.empty? warn "This merge request does not have any assignee yet. Setting an assignee clarifies who needs to take action on the merge request at any given time." end -has_milestone = !gitlab.mr_json["milestone"].nil? +has_milestone = !helper.mr_milestone.nil? unless has_milestone warn "This merge request does not refer to an existing milestone.", sticky: false end -has_pick_into_stable_label = gitlab.mr_labels.find { |label| label.start_with?('Pick into') } +has_pick_into_stable_label = helper.mr_labels.find { |label| label.start_with?('Pick into') } -if gitlab.branch_for_base != "master" && !has_pick_into_stable_label +if helper.mr_target_branch != "master" && !has_pick_into_stable_label warn "Most of the time, all merge requests should target `master`. Otherwise, please set the relevant `Pick into X.Y` label." end -has_qa_verified_label = gitlab.mr_labels.find { |label| label.start_with?('QA:verified') } -is_docs_only_branch = gitlab.branch_for_head =~ /(^docs[\/-].*|.*-docs$)/ +has_qa_verified_label = helper.mr_labels.find { |label| label.start_with?('QA:verified') } +is_docs_only_branch = helper.mr_source_branch =~ /(^docs[\/-].*|.*-docs$)/ unless has_qa_verified_label || is_docs_only_branch warn "Please check the QA job and compare with builds on master. If no new failures are reported in QA job, add 'QA:verified' label." end -if (gitlab.mr_labels & WORKTYPE_LABELS).empty? +if (helper.mr_labels & WORKTYPE_LABELS).empty? warn "This merge request is missing any [Work Type Classification labels](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification)." end -unless gitlab.mr_json["force_remove_source_branch"] +if helper.ci? && !gitlab.mr_json["force_remove_source_branch"] warn "If the source branch can be safely removed after this merge request is accepted, please consider setting the '[delete source branch when merge request is accepted](https://docs.gitlab.com/ee/user/project/merge_requests/getting_started.html#deleting-the-source-branch)' option." end -- GitLab From 7a2698f198f9e8fc1c7cd5c13c3b7f23d0f748ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cunha?= Date: Fri, 4 Aug 2023 12:04:42 -0300 Subject: [PATCH 4/5] Reallow default danger rules --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b6967e4eb4..f87f769005 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -463,9 +463,9 @@ debug_review_gke122: - if: '$PIPELINE_TYPE =~ /FEATURE_BRANCH_PIPELINE$/' danger-review: - rules: - - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/ && $PIPELINE_TYPE != "FORK_MR_PIPELINE"' - - if: '$PIPELINE_TYPE == "DOCS_PIPELINE"' +# rules: +# - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/ && $PIPELINE_TYPE != "FORK_MR_PIPELINE"' +# - if: '$PIPELINE_TYPE == "DOCS_PIPELINE"' before_script: - bundle add gitlab-dangerfiles -- GitLab From 9e9d2f548d5613676cbf36a4ae9b9c8352514d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cunha?= Date: Fri, 4 Aug 2023 14:00:18 -0300 Subject: [PATCH 5/5] Rely on the default merge request rule This rule is defined by gitlab-org/quality/pipeline-common/ci/danger-review.yml This rule enables the Dangerbot to every MR including forks. This is ok for forks, as with the use of `helper` object instead of `gitlab`, the danger dry-run will execute in local mode and mock empty responses for all calls like helper.mr_labels, helper.mr_description, even if the user has not token set. So, it won't break the dangerbot execution. --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f87f769005..a914329b23 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -80,6 +80,8 @@ include: - project: 'gitlab-org/quality/pipeline-common' file: - '/ci/danger-review.yml' + rules: + - if: $CI_SERVER_HOST == "gitlab.com" dependency_scanning: needs: [] @@ -463,9 +465,6 @@ debug_review_gke122: - if: '$PIPELINE_TYPE =~ /FEATURE_BRANCH_PIPELINE$/' danger-review: -# rules: -# - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/ && $PIPELINE_TYPE != "FORK_MR_PIPELINE"' -# - if: '$PIPELINE_TYPE == "DOCS_PIPELINE"' before_script: - bundle add gitlab-dangerfiles -- GitLab