Commit 1d8ab59e authored by Sean McGivern's avatar Sean McGivern

Merge branch '40463-ee-compatibility-check-job-fails-unexpectedly' into 'master'

Resolve "EE Compatibility Check Job Fails Unexpectedly"

Closes #40463

See merge request gitlab-org/gitlab-ce!15555
parents 7084c096 3262378e
...@@ -91,7 +91,7 @@ module Gitlab ...@@ -91,7 +91,7 @@ module Gitlab
step( step(
"Generating the patch against #{remote}/master in #{patch_path}", "Generating the patch against #{remote}/master in #{patch_path}",
%W[git diff --binary #{remote}/master...#{branch}] %W[git diff --binary #{remote}/master...origin/#{branch}]
) do |output, status| ) do |output, status|
throw(:halt_check, :ko) unless status.zero? throw(:halt_check, :ko) unless status.zero?
...@@ -102,7 +102,7 @@ module Gitlab ...@@ -102,7 +102,7 @@ module Gitlab
end end
def ce_branch_compat_check! def ce_branch_compat_check!
if check_patch(ce_patch_full_path, remote: 'canonical-ce').zero? if check_patch(ce_patch_full_path).zero?
puts applies_cleanly_msg(ce_branch) puts applies_cleanly_msg(ce_branch)
throw(:halt_check) throw(:halt_check)
end end
...@@ -129,7 +129,7 @@ module Gitlab ...@@ -129,7 +129,7 @@ module Gitlab
end end
def ee_branch_compat_check! def ee_branch_compat_check!
unless check_patch(ee_patch_full_path, remote: 'canonical-ee').zero? unless check_patch(ee_patch_full_path).zero?
puts puts
puts ee_branch_doesnt_apply_cleanly_msg puts ee_branch_doesnt_apply_cleanly_msg
...@@ -140,9 +140,9 @@ module Gitlab ...@@ -140,9 +140,9 @@ module Gitlab
puts applies_cleanly_msg(ee_branch_found) puts applies_cleanly_msg(ee_branch_found)
end end
def check_patch(patch_path, remote:) def check_patch(patch_path)
step("Checking out master", %w[git checkout master]) step("Checking out master", %w[git checkout master])
step("Resetting to latest master", %W[git reset --hard #{remote}/master]) step("Resetting to latest master", %w[git reset --hard canonical-ee/master])
step( step(
"Checking if #{patch_path} applies cleanly to EE/master", "Checking if #{patch_path} applies cleanly to EE/master",
# Don't use --check here because it can result in a 0-exit status even # Don't use --check here because it can result in a 0-exit status even
...@@ -182,7 +182,7 @@ module Gitlab ...@@ -182,7 +182,7 @@ module Gitlab
def merge_base_found?(master_remote:, branch:) def merge_base_found?(master_remote:, branch:)
step( step(
"Finding merge base with #{master_remote}/master", "Finding merge base with #{master_remote}/master",
%W[git merge-base #{master_remote}/master #{branch}] %W[git merge-base #{master_remote}/master origin/#{branch}]
) do |output, status| ) do |output, status|
if status.zero? if status.zero?
puts "Merge base was found: #{output}" puts "Merge base was found: #{output}"
......
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