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

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Read <eread@gitlab.com>2023-03-22 19:04:10 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2023-03-22 19:04:10 +0300
commit7a905a69d816a152493d5258eb37dec7f1e6e8e0 (patch)
tree709ec8eca8cc64eedee3f1808c350626db78eebc /lib
parentcbc7418b830fc21688807108b92970a2a6ade952 (diff)
Run RuboCop testing in pipelines and commit hooks
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/task_helpers.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/tasks/task_helpers.rb b/lib/tasks/task_helpers.rb
index 52445d2f..106a29f3 100644
--- a/lib/tasks/task_helpers.rb
+++ b/lib/tasks/task_helpers.rb
@@ -31,7 +31,7 @@ class TaskHelpers
# variable, and if not assigned, set to the default branch.
#
if stable_branch_name.nil?
- merge_request_iid = ENV["MERGE_REQUEST_IID_#{slug.upcase}"]
+ merge_request_iid = ENV.fetch("MERGE_REQUEST_IID_#{slug.upcase}", nil)
branch_name = ENV.fetch("BRANCH_#{slug.upcase}", default_branch(products[slug].fetch('repo')))
return branch_name, "heads/#{branch_name}" if merge_request_iid.nil?
@@ -42,26 +42,26 @@ class TaskHelpers
#
# Check the project slug to determine the branch name
#
- stable_branch = case slug
+ stable_branch = stable_branch_for(slug)
+ [stable_branch, "heads/#{stable_branch}"]
+ end
+
+ def stable_branch_for(slug)
+ case slug
when 'ee'
"#{stable_branch_name}-ee"
-
when 'omnibus', 'runner'
stable_branch_name
-
# Charts don't use the same version scheme as GitLab, we need to
# deduct their version from the GitLab equivalent one.
when 'charts'
charts_stable_branch
-
# If the upstream product doesn't follow a stable branch scheme, set the
# branch to the default
else
default_branch(products[slug].fetch('repo'))
end
-
- return stable_branch, "heads/#{stable_branch}"
end
def git_workdir_dirty?