summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /scripts
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_assets_image7
-rw-r--r--scripts/frontend/extract_gettext_all.js2
-rwxr-xr-xscripts/frontend/startup_css/startup_css_changed.sh19
-rw-r--r--scripts/frontend/stylelint/stylelint-utility-classes.js2
-rwxr-xr-xscripts/lint-doc.sh4
-rwxr-xr-xscripts/merge-html-reports85
-rwxr-xr-xscripts/review_apps/automated_cleanup.rb10
-rw-r--r--scripts/review_apps/base-config.yaml1
-rwxr-xr-xscripts/review_apps/review-apps.sh69
-rwxr-xr-xscripts/setup-test-env68
-rwxr-xr-xscripts/static-analysis5
-rwxr-xr-xscripts/trigger-build27
-rwxr-xr-xscripts/used-feature-flags22
-rw-r--r--scripts/utils.sh9
-rwxr-xr-xscripts/verify-tff-mapping4
15 files changed, 152 insertions, 182 deletions
diff --git a/scripts/build_assets_image b/scripts/build_assets_image
index 12beddfa184..60bd9190b74 100755
--- a/scripts/build_assets_image
+++ b/scripts/build_assets_image
@@ -19,7 +19,12 @@ cp -r public/assets assets_container.build/public/
cp Dockerfile.assets assets_container.build/
COMMIT_REF_SLUG_DESTINATION=${ASSETS_IMAGE_PATH}:${CI_COMMIT_REF_SLUG}
-COMMIT_SHA_DESTINATION=${ASSETS_IMAGE_PATH}:${CI_COMMIT_SHA}
+# Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA (MR HEAD commit) so that the image is in sync with Omnibus/CNG images.
+# Background: Due to the fact that we cannot retrieve the Merged Commit in the downstream omnibus/CNG pipelines,
+# we're building the Omnibus/CNG images for the MR HEAD commit.
+# In turn, the assets image also needs to be built from the MR HEAD commit, so that everything is build from the same commit.
+# For non-MR commits, we fallback to $CI_COMMIT_SHA.
+COMMIT_SHA_DESTINATION=${ASSETS_IMAGE_PATH}:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA:-$CI_COMMIT_SHA}
COMMIT_REF_NAME_DESTINATION=${ASSETS_IMAGE_PATH}:${CI_COMMIT_REF_NAME}
DESTINATIONS="--destination=$COMMIT_REF_SLUG_DESTINATION --destination=$COMMIT_SHA_DESTINATION"
diff --git a/scripts/frontend/extract_gettext_all.js b/scripts/frontend/extract_gettext_all.js
index 896790a73bb..0a5e2b06971 100644
--- a/scripts/frontend/extract_gettext_all.js
+++ b/scripts/frontend/extract_gettext_all.js
@@ -6,7 +6,7 @@ const {
decorateExtractorWithHelpers,
} = require('gettext-extractor-vue');
const vue2TemplateCompiler = require('vue-template-compiler');
-const ensureSingleLine = require('../../app/assets/javascripts/locale/ensure_single_line.js');
+const ensureSingleLine = require('../../app/assets/javascripts/locale/ensure_single_line');
const args = argumentsParser
.option('-f, --file <file>', 'Extract message from one single file')
diff --git a/scripts/frontend/startup_css/startup_css_changed.sh b/scripts/frontend/startup_css/startup_css_changed.sh
index f214e61cdfb..2713d752974 100755
--- a/scripts/frontend/startup_css/startup_css_changed.sh
+++ b/scripts/frontend/startup_css/startup_css_changed.sh
@@ -10,10 +10,10 @@ echo "-----------------------------------------------------------"
startup_glob="*stylesheets/startup*"
echo "Staging changes to '${startup_glob}' so we can check for untracked files..."
-git add ${startup_glob}
+git add "${startup_glob}"
-if [ -n "$(git diff HEAD --name-only -- ${startup_glob})" ]; then
- diff=$(git diff HEAD -- ${startup_glob})
+if [ -n "$(git diff HEAD --name-only -- "${startup_glob}")" ]; then
+ diff=$(git diff HEAD -- "${startup_glob}")
cat <<EOF
Startup CSS changes detected!
@@ -21,14 +21,19 @@ Startup CSS changes detected!
It looks like there have been recent changes which require
regenerating the Startup CSS files.
-**What should I do now?**
+IMPORTANT:
-IMPORTANT: Please make sure to update your MR title with "[RUN AS-IF-FOSS]" and start a new MR pipeline
+ - If you are making changes to any Startup CSS file, it is very likely that
+ **both** the CE and EE Startup CSS files will need to be updated.
+ - Changing any Startup CSS file will trigger the "as-if-foss" job to also run.
+
+HOW TO FIX:
To fix this job, consider one of the following options:
- 1. Regenerating locally with "yarn run generate:startup_css".
- 2. Copy and apply the following diff:
+ 1. (Strongly recommended) Copy and apply the diff below:
+ 2. Regenerate locally with "yarn run generate:startup_css".
+ You may need to set "FOSS_ONLY=1" if you are trying to generate for CE.
----- start diff -----
$diff
diff --git a/scripts/frontend/stylelint/stylelint-utility-classes.js b/scripts/frontend/stylelint/stylelint-utility-classes.js
index 420fe82d826..14827145b54 100644
--- a/scripts/frontend/stylelint/stylelint-utility-classes.js
+++ b/scripts/frontend/stylelint/stylelint-utility-classes.js
@@ -1,6 +1,6 @@
const stylelint = require('stylelint');
const utils = require('./stylelint-utils');
-const utilityClasses = require('./utility-classes-map.js');
+const utilityClasses = require('./utility-classes-map');
const ruleName = 'stylelint-gitlab/utility-classes';
diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh
index 7156488bfc8..33a46e73ee2 100755
--- a/scripts/lint-doc.sh
+++ b/scripts/lint-doc.sh
@@ -68,8 +68,8 @@ then
fi
# Do not use 'README.md', instead use 'index.md'
-# Number of 'README.md's as of 2020-10-13
-NUMBER_READMES=28
+# Number of 'README.md's as of 2021-06-21
+NUMBER_READMES=15
FIND_READMES=$(find doc/ -name "README.md" | wc -l)
echo '=> Checking for new README.md files...'
echo
diff --git a/scripts/merge-html-reports b/scripts/merge-html-reports
deleted file mode 100755
index de300851990..00000000000
--- a/scripts/merge-html-reports
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-require 'nokogiri'
-
-main_report_file = ARGV.shift
-unless main_report_file
- puts 'usage: merge-html-reports <main-report> <base-artifact-url> [parallel reports...]'
- exit 1
-end
-
-base_artifact_url = ARGV.shift
-unless base_artifact_url
- puts 'usage: merge-html-reports <main-report> <base-artifact-url> [parallel reports...]'
- exit 1
-end
-
-# Create the base report with empty body tag
-new_report = Nokogiri::HTML.parse(File.read(ARGV[0]))
-new_report.at_css('body').remove
-empty_body = Nokogiri::XML::Node.new('body', new_report)
-new_report.at_css('head').add_next_sibling(empty_body)
-
-ARGV.each do |report_file|
- report = Nokogiri::HTML.parse(File.read(report_file))
-
- report.css('a').each do |link|
- link_suffix = link['href'].slice(19..-1)
- link['href'] = base_artifact_url + link_suffix
- end
-
- header = report.css('div #rspec-header')
- tests = report.css('dt[id^="example_group_"]')
-
- tests.each do |test|
- title = test.parent
- group = title.parent
- script = title.css('script')
-
- if script.inner_html.include? 'makeYellow'
- test.remove_class('passed')
- test.add_class('not_implemented')
-
- group.remove_class('passed')
- group.add_class('not_implemented')
- header.add_class('not_implemented')
-
- script.remove
- test.next_sibling.remove
- test.next_sibling.remove
-
- elsif script.inner_html.include? 'makeRed'
- test.remove_class('passed')
- test.add_class('failed')
-
- group.remove_class('passed')
- group.add_class('failed')
- header.add_class('failed')
-
- script.remove
- test.next_sibling.remove
- test.next_sibling.remove
- end
- end
-
- duration = report.at_css('p#duration')
- totals = report.at_css('p#totals')
-
- duration_script = report.css('div.results script')[-2]
- totals_script = report.css('div.results script')[-1]
-
- duration_text = duration_script.text.slice(49..-3)
- totals_text = totals_script.text.slice(47..-3)
-
- duration.inner_html = duration_text
- totals.inner_html = totals_text
-
- duration_script.remove
- totals_script.remove
-
- # Add the new result after the last one to keep the test order
- new_report.css('body')[-1].add_next_sibling(report.at_css('body'))
-end
-
-File.write(main_report_file, new_report)
diff --git a/scripts/review_apps/automated_cleanup.rb b/scripts/review_apps/automated_cleanup.rb
index 0927481070b..5707f02d3f0 100755
--- a/scripts/review_apps/automated_cleanup.rb
+++ b/scripts/review_apps/automated_cleanup.rb
@@ -116,6 +116,12 @@ class AutomatedCleanup
delete_helm_releases(releases_to_delete)
end
+ def perform_stale_namespace_cleanup!(days:)
+ kubernetes_client = Tooling::KubernetesClient.new(namespace: nil)
+
+ kubernetes_client.cleanup_review_app_namespaces(created_before: threshold_time(days: days), wait: false)
+ end
+
def perform_stale_pvc_cleanup!(days:)
kubernetes.cleanup_by_created_at(resource_type: 'pvc', created_before: threshold_time(days: days), wait: false)
end
@@ -203,6 +209,10 @@ timed('Helm releases cleanup') do
automated_cleanup.perform_helm_releases_cleanup!(days: 7)
end
+timed('Stale Namespace cleanup') do
+ automated_cleanup.perform_stale_namespace_cleanup!(days: 14)
+end
+
timed('Stale PVC cleanup') do
automated_cleanup.perform_stale_pvc_cleanup!(days: 30)
end
diff --git a/scripts/review_apps/base-config.yaml b/scripts/review_apps/base-config.yaml
index bb4d5392b3b..981a8b51674 100644
--- a/scripts/review_apps/base-config.yaml
+++ b/scripts/review_apps/base-config.yaml
@@ -23,6 +23,7 @@ gitlab:
memory: 1500M
persistence:
size: 10G
+ storageClass: ssd
gitlab-exporter:
enabled: false
mailroom:
diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh
index 6fb83e79f7f..a799f8cd925 100755
--- a/scripts/review_apps/review-apps.sh
+++ b/scripts/review_apps/review-apps.sh
@@ -48,7 +48,9 @@ function delete_release() {
return
fi
- delete_k8s_release_namespace
+ if deploy_exists "${namespace}" "${release}"; then
+ helm uninstall --namespace="${namespace}" "${release}"
+ fi
}
function delete_failed_release() {
@@ -66,7 +68,7 @@ function delete_failed_release() {
# Cleanup and previous installs, as FAILED and PENDING_UPGRADE will cause errors with `upgrade`
if previous_deploy_failed "${namespace}" "${release}" ; then
echoinfo "Review App deployment in bad state, cleaning up namespace ${release}"
- delete_release
+ delete_k8s_release_namespace
else
echoinfo "Review App deployment in good state"
fi
@@ -166,68 +168,9 @@ function label_namespace() {
local label="${2}"
echoinfo "Labeling the ${namespace} namespace with ${label}" true
+ echoinfo "We should pass the --overwrite option!"
- kubectl label namespace "${namespace}" "${label}"
-}
-
-function install_external_dns() {
- local namespace="${KUBE_NAMESPACE}"
- local release="dns-gitlab-review-app-helm3"
- local domain
- domain=$(echo "${REVIEW_APPS_DOMAIN}" | awk -F. '{printf "%s.%s", $(NF-1), $NF}')
- echoinfo "Installing external DNS for domain ${domain}..." true
-
- if ! deploy_exists "${namespace}" "${release}" || previous_deploy_failed "${namespace}" "${release}" ; then
- echoinfo "Installing external-dns Helm chart"
- helm repo add bitnami https://charts.bitnami.com/bitnami
- helm repo update
-
- # Default requested: CPU => 0, memory => 0
- helm install "${release}" bitnami/external-dns \
- --namespace "${namespace}" \
- --version '2.13.3' \
- --set provider="aws" \
- --set aws.credentials.secretKey="${REVIEW_APPS_AWS_SECRET_KEY}" \
- --set aws.credentials.accessKey="${REVIEW_APPS_AWS_ACCESS_KEY}" \
- --set aws.zoneType="public" \
- --set aws.batchChangeSize=400 \
- --set domainFilters[0]="${domain}" \
- --set txtOwnerId="${namespace}" \
- --set rbac.create="true" \
- --set policy="sync" \
- --set resources.requests.cpu=50m \
- --set resources.limits.cpu=100m \
- --set resources.requests.memory=100M \
- --set resources.limits.memory=200M
- else
- echoinfo "The external-dns Helm chart is already successfully deployed."
- fi
-}
-
-# This script is used to install cert-manager in the cluster
-# The installation steps are documented in
-# https://gitlab.com/gitlab-org/quality/team-tasks/snippets/1990286
-function install_certmanager() {
- local namespace="${KUBE_NAMESPACE}"
- local release="cert-manager-review-app-helm3"
-
- echoinfo "Installing cert-manager..." true
-
- if ! deploy_exists "${namespace}" "${release}" || previous_deploy_failed "${namespace}" "${release}" ; then
- kubectl apply \
- -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.10/deploy/manifests/00-crds.yaml
-
- echoinfo "Installing cert-manager Helm chart"
- helm repo add jetstack https://charts.jetstack.io
- helm repo update
-
- helm install "${release}" jetstack/cert-manager \
- --namespace "${namespace}" \
- --version v0.15.1 \
- --set installCRDS=true
- else
- echoinfo "The cert-manager Helm chart is already successfully deployed."
- fi
+ kubectl label --overwrite namespace "${namespace}" "${label}"
}
function create_application_secret() {
diff --git a/scripts/setup-test-env b/scripts/setup-test-env
new file mode 100755
index 00000000000..ebd3a48ae15
--- /dev/null
+++ b/scripts/setup-test-env
@@ -0,0 +1,68 @@
+#!/usr/bin/env ruby
+
+# frozen_string_literal: true
+
+require 'bundler/setup'
+
+require 'request_store'
+require 'rake'
+require 'active_support/dependencies'
+require 'active_support/dependencies/autoload'
+require 'active_support/core_ext/numeric'
+require 'active_support/string_inquirer'
+
+ENV['SKIP_RAILS_ENV_IN_RAKE'] = 'true'
+
+module Rails
+ extend self
+
+ def root
+ Pathname.new(File.expand_path('..', __dir__))
+ end
+
+ def env
+ @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
+ end
+end
+
+ActiveSupport::Dependencies.autoload_paths << 'lib'
+
+load File.expand_path('../lib/tasks/gitlab/helpers.rake', __dir__)
+load File.expand_path('../lib/tasks/gitlab/gitaly.rake', __dir__)
+
+# Required for config/0_inject_enterprise_edition_module.rb, lib/gitlab/access.rb
+require_dependency File.expand_path('../lib/gitlab', __dir__)
+
+require_dependency File.expand_path('../config/initializers/0_inject_enterprise_edition_module', __dir__)
+
+# Require for lib/gitlab/gitaly_client/storage_settings.rb and config/initializers/1_settings.rb
+require 'active_support/hash_with_indifferent_access'
+
+# Required for lib/gitlab/visibility_level.rb and lib/gitlab/safe_request_store.rb
+require 'active_support/concern'
+require 'active_support/core_ext/module/delegation'
+
+# Required for lib/system_check/helpers.rb
+require_dependency File.expand_path('../lib/gitlab/task_helpers', __dir__)
+
+# Required for lib/tasks/gitlab/helpers.rake
+require_dependency File.expand_path('../lib/system_check/helpers', __dir__)
+
+# Required for config/initializers/1_settings.rb
+require 'omniauth'
+require 'omniauth-github'
+require 'etc'
+require_dependency File.expand_path('../lib/gitlab/access', __dir__)
+
+require_dependency File.expand_path('../config/initializers/1_settings', __dir__)
+
+Gitlab.ee do
+ load File.expand_path('../ee/lib/tasks/gitlab/indexer.rake', __dir__)
+
+ require_dependency File.expand_path('../ee/lib/gitlab/elastic/indexer', __dir__)
+ require_dependency File.expand_path('../lib/gitlab/utils/override', __dir__)
+end
+
+require_dependency File.expand_path('../spec/support/helpers/test_env', __dir__)
+
+TestEnv.init
diff --git a/scripts/static-analysis b/scripts/static-analysis
index 7aa2fbf1594..fc917f1b975 100755
--- a/scripts/static-analysis
+++ b/scripts/static-analysis
@@ -24,7 +24,10 @@ class StaticAnalysis
(Gitlab.ee? ? %w[bin/rake gettext:updated_check] : nil) => 410,
# Most of the time, RuboCop finishes in 30 seconds, but sometimes it can take around 1200 seconds so we set a
# duration of 300 to lower the likelihood that it will run in the same job as another long task...
- %w[bundle exec rubocop --parallel] => 300,
+ %w[bundle exec rubocop --parallel --except Gitlab/MarkUsedFeatureFlags] => 300,
+ # We need to disable the cache for this cop since it creates files under tmp/feature_flags/*.used,
+ # the cache would prevent these files from being created.
+ %w[bundle exec rubocop --only Gitlab/MarkUsedFeatureFlags --cache false] => 600,
%w[yarn run lint:eslint:all] => 264,
%w[yarn run lint:prettier] => 134,
%w[bin/rake gettext:lint] => 81,
diff --git a/scripts/trigger-build b/scripts/trigger-build
index 23c9ebbe294..cb235677b5d 100755
--- a/scripts/trigger-build
+++ b/scripts/trigger-build
@@ -135,11 +135,11 @@ module Trigger
end
def extra_variables
- # Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA for omnibus checkouts due to pipeline for merged results
- # and fallback to CI_COMMIT_SHA for the non-MR pipelines.
+ # Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA (MR HEAD commit) so that the image is in sync with the assets and QA images.
# See https://docs.gitlab.com/ee/development/testing_guide/end_to_end/index.html#with-pipeline-for-merged-results.
# We also set IMAGE_TAG so the GitLab Docker image is tagged with that SHA.
source_sha = Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA']
+
{
'GITLAB_VERSION' => source_sha,
'IMAGE_TAG' => source_sha,
@@ -177,12 +177,14 @@ module Trigger
def extra_variables
edition = Trigger.ee? ? 'EE' : 'CE'
+ # Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA (MR HEAD commit) so that the image is in sync with the assets and QA images.
+ source_sha = Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA']
{
"ee" => Trigger.ee? ? "true" : "false",
- "GITLAB_VERSION" => ENV['CI_COMMIT_SHA'],
+ "GITLAB_VERSION" => source_sha,
"GITLAB_TAG" => ENV['CI_COMMIT_TAG'],
- "GITLAB_ASSETS_TAG" => ENV['CI_COMMIT_TAG'] ? ENV['CI_COMMIT_REF_NAME'] : ENV['CI_COMMIT_SHA'],
+ "GITLAB_ASSETS_TAG" => ENV['CI_COMMIT_TAG'] ? ENV['CI_COMMIT_REF_NAME'] : source_sha,
"FORCE_RAILS_IMAGE_BUILDS" => 'true',
"#{edition}_PIPELINE" => 'true'
}
@@ -311,27 +313,18 @@ module Trigger
comment = "<!-- #{IDENTIFIABLE_NOTE_TAG} --> \nStarted database testing [pipeline](https://ops.gitlab.net/#{downstream_project_path}/-/pipelines/#{pipeline.id}) " \
"(limited access). This comment will be updated once the pipeline has finished running."
- # Look for a note to update
+ # Look for an existing note
db_testing_notes = gitlab.merge_request_notes(project_path, merge_request_id).auto_paginate.select do |note|
note.body.include?(IDENTIFIABLE_NOTE_TAG)
end
- note = db_testing_notes.max_by { |note| Time.parse(note.created_at) }
-
- if note && note.type != 'DiscussionNote'
- # The latest note has not led to a discussion. Update it.
- gitlab.edit_merge_request_note(project_path, merge_request_id, note.id, comment)
-
- puts "Updated comment:\n"
- else
- # This is the first note or the latest note has been discussed on the MR.
- # Don't update, create new note instead.
+ if db_testing_notes.empty?
+ # This is the first note
note = gitlab.create_merge_request_note(project_path, merge_request_id, comment)
puts "Posted comment to:\n"
+ puts "https://gitlab.com/#{project_path}/-/merge_requests/#{merge_request_id}#note_#{note.id}"
end
-
- puts "https://gitlab.com/#{project_path}/-/merge_requests/#{merge_request_id}#note_#{note.id}"
end
private
diff --git a/scripts/used-feature-flags b/scripts/used-feature-flags
index aebd007dda9..07c022a4c1a 100755
--- a/scripts/used-feature-flags
+++ b/scripts/used-feature-flags
@@ -28,6 +28,16 @@ flags_paths = [
# For EE additionally process `ee/` feature flags
if File.exist?('ee/app/models/license.rb') && !%w[true 1].include?(ENV['FOSS_ONLY'].to_s)
flags_paths << 'ee/config/feature_flags/**/*.yml'
+
+ # Geo feature flags are constructed dynamically and there's no explicit checks in the codebase so we mark all
+ # the replicators' derived feature flags as used.
+ # See https://gitlab.com/gitlab-org/gitlab/-/blob/54e802e8fe76b6f93656d75ef9b566bf57b60f41/ee/lib/gitlab/geo/replicator.rb#L183-185
+ Dir.glob('ee/app/replicators/geo/*_replicator.rb').each_with_object(Set.new) do |path, memo|
+ replicator_name = File.basename(path, '.rb')
+ feature_flag_name = "geo_#{replicator_name.delete_suffix('_replicator')}_replication"
+
+ FileUtils.touch(File.join('tmp', 'feature_flags', "#{feature_flag_name}.used"))
+ end
end
all_flags = {}
@@ -41,7 +51,17 @@ flags_paths.each do |flags_path|
feature_flag_name = File.basename(path, '.yml')
# TODO: we need a better way of tracking use of Gitaly FF across Gitaly and GitLab
- next if feature_flag_name.start_with?('gitaly_')
+ if feature_flag_name.start_with?('gitaly_')
+ puts "Skipping the #{feature_flag_name} feature flag since it starts with 'gitaly_'."
+ next
+ end
+
+ # Dynamic feature flag names for redirect to latest CI templates
+ # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63144/diffs#fa2193ace3f6a02f7ef9995ef9bc519eca92c4ee_57_84
+ if feature_flag_name.start_with?('redirect_to_latest_template_')
+ puts "Skipping the #{feature_flag_name} feature flag since it starts with 'redirect_to_latest_template_'."
+ next
+ end
all_flags[feature_flag_name] = File.exist?(File.join('tmp', 'feature_flags', feature_flag_name + '.used'))
end
diff --git a/scripts/utils.sh b/scripts/utils.sh
index 529491c3a0d..700dad58779 100644
--- a/scripts/utils.sh
+++ b/scripts/utils.sh
@@ -40,7 +40,7 @@ function bundle_install_script() {
bundle config set path 'vendor'
bundle config set clean 'true'
- echo $BUNDLE_WITHOUT
+ echo "${BUNDLE_WITHOUT}"
bundle config
run_timed_command "bundle install ${BUNDLE_INSTALL_FLAGS} ${extra_install_args} && bundle check"
@@ -134,3 +134,10 @@ function fail_pipeline_early() {
scripts/api/cancel_pipeline.rb
fi
}
+
+function danger_as_local() {
+ # Force danger to skip CI source GitLab and fallback to "local only git repo".
+ unset GITLAB_CI
+ # We need to base SHA to help danger determine the base commit for this shallow clone.
+ bundle exec danger dry_run --fail-on-errors=true --verbose --base="${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
+}
diff --git a/scripts/verify-tff-mapping b/scripts/verify-tff-mapping
index 4555a9854dd..ca73d4f5f7a 100755
--- a/scripts/verify-tff-mapping
+++ b/scripts/verify-tff-mapping
@@ -90,8 +90,8 @@ tests = [
{
explanation: 'EE views should map to respective spec',
- source: 'ee/app/views/admin/licenses/show.html.haml',
- expected: ['ee/spec/views/admin/licenses/show.html.haml_spec.rb']
+ source: 'ee/app/views/subscriptions/new.html.haml',
+ expected: ['ee/spec/views/subscriptions/new.html.haml_spec.rb']
},
{