Commit 05e35261 authored by Sean McGivern's avatar Sean McGivern
Browse files

Merge branch '38846-fix-ee_compat_check_for-forks' into 'master'

Fix the ee_compat_check task for forks

Closes #38846

See merge request gitlab-org/gitlab-ce!14727
......@@ -2,7 +2,7 @@
module Gitlab
# Checks if a set of migrations requires downtime or not.
class EeCompatCheck
CE_REPO = ''.freeze
DEFAULT_CE_REPO = ''.freeze
EE_REPO = ''.freeze
CHECK_DIR = Rails.root.join('ee_compat_check')
......@@ -20,7 +20,7 @@ class EeCompatCheck
attr_reader :ee_repo_dir, :patches_dir, :ce_repo, :ce_branch, :ee_branch_found
attr_reader :failed_files
def initialize(branch:, ce_repo: CE_REPO)
def initialize(branch:, ce_repo: DEFAULT_CE_REPO)
@ee_repo_dir = CHECK_DIR.join('ee-repo')
@patches_dir = CHECK_DIR.join('patches')
@ce_branch = branch
......@@ -132,7 +132,7 @@ def ee_branch_compat_check!
def check_patch(patch_path)
step("Checking out master", %w[git checkout master])
step("Resetting to latest master", %w[git reset --hard origin/master])
step("Fetching CE/#{ce_branch}", %W[git fetch #{CE_REPO} #{ce_branch}])
step("Fetching CE/#{ce_branch}", %W[git fetch #{ce_repo} #{ce_branch}])
"Checking if #{patch_path} applies cleanly to EE/master",
# Don't use --check here because it can result in a 0-exit status even
......@@ -4,7 +4,10 @@ namespace :gitlab do
task :ee_compat_check, [:branch] => :environment do |_, args|
opts =
if ENV['CI']
{ branch: ENV['CI_COMMIT_REF_NAME'] }
unless args[:branch]
puts "Must specify a branch as an argument".color(:red)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment