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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ee-specific-lines-check42
-rw-r--r--scripts/ee_specific_check/ee_specific_check.rb16
2 files changed, 50 insertions, 8 deletions
diff --git a/scripts/ee-specific-lines-check b/scripts/ee-specific-lines-check
new file mode 100755
index 00000000000..4114575168c
--- /dev/null
+++ b/scripts/ee-specific-lines-check
@@ -0,0 +1,42 @@
+#!/usr/bin/env ruby
+
+require_relative 'ee_specific_check/ee_specific_check'
+
+include EESpecificCheck # rubocop:disable Style/MixinUsage
+git_version
+
+base = find_compare_base
+
+current_numstat = updated_diff_numstat(base.ce_base, base.ee_base)
+updated_numstat = updated_diff_numstat(base.ce_head, base.ee_head)
+
+offenses = updated_numstat.select do |file, updated_delta|
+ current_delta = current_numstat[file]
+
+ more_lines = updated_delta > current_delta
+
+ more_lines &&
+ !WHITELIST.any? { |pattern| Dir.glob(pattern, File::FNM_DOTMATCH).include?(file) }
+end
+
+if offenses.empty?
+ say "🎉 All good, congrats! 🎉"
+else
+ puts
+
+ offenses.each do |(file, delta)|
+ puts "* 💥 #{file} has #{delta - current_numstat[file]} updated lines that differ between EE and CE! 💥"
+ end
+
+ say <<~MESSAGE
+ ℹ️ Make sure all lines in shared files have been updated in your backport merge request and the branch name includes #{minimal_ce_branch_name}.
+ ℹ️ Consider using an EE module to add the features you want.
+ ℹ️ See this for detail: https://docs.gitlab.com/ee/development/ee_features.html#ee-features-based-on-ce-features
+ MESSAGE
+end
+
+remove_remotes
+
+say "ℹ️ For more information on why, see https://gitlab.com/gitlab-org/gitlab/issues/2952"
+
+exit(offenses.size)
diff --git a/scripts/ee_specific_check/ee_specific_check.rb b/scripts/ee_specific_check/ee_specific_check.rb
index 98a4038ee09..cdb62f66e94 100644
--- a/scripts/ee_specific_check/ee_specific_check.rb
+++ b/scripts/ee_specific_check/ee_specific_check.rb
@@ -43,8 +43,8 @@ module EESpecificCheck
def setup_canonical_remotes
run_git_command(
- "remote add canonical-ee https://gitlab.com/gitlab-org/gitlab-ee.git",
- "remote add canonical-ce https://gitlab.com/gitlab-org/gitlab-ce.git",
+ "remote add canonical-ee https://gitlab.com/gitlab-org/gitlab.git",
+ "remote add canonical-ce https://gitlab.com/gitlab-org/gitlab-foss.git",
"fetch canonical-ee master --quiet --depth=9999",
"fetch canonical-ce master --quiet --depth=9999")
end
@@ -67,7 +67,7 @@ module EESpecificCheck
say <<~MESSAGE
💥 Unfortunately we cannot find the merge-base for #{left} and #{right},
💥 and we'll try to fix that in:
- https://gitlab.com/gitlab-org/gitlab-ee/issues/9120
+ https://gitlab.com/gitlab-org/gitlab/issues/9120
💥 Before that, please run this job locally as a workaround:
@@ -193,7 +193,7 @@ module EESpecificCheck
💥 Please rebase #{target_head} with CE master.
💥
💥 For more details, please read:
- 💥 https://gitlab.com/gitlab-org/gitlab-ee/issues/6038#note_86862115
+ 💥 https://gitlab.com/gitlab-org/gitlab/issues/6038#note_86862115
💥
💥 Git diff:
@@ -237,8 +237,8 @@ module EESpecificCheck
# Instead of waiting that populate over all the branches, we could
# just remove untracked files anyway, only on CI of course in case
# we're wiping people's data!
- # See https://gitlab.com/gitlab-org/gitlab-ee/issues/5912
- # Also see https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/68194333
+ # See https://gitlab.com/gitlab-org/gitlab/issues/5912
+ # Also see https://gitlab.com/gitlab-org/gitlab/-/jobs/68194333
run_git_command('clean -fd') if ENV['CI']
end
@@ -276,9 +276,9 @@ module EESpecificCheck
def ce_repo_url
@ce_repo_url ||=
begin
- repo_url = ENV.fetch('CI_REPOSITORY_URL', 'https://gitlab.com/gitlab-org/gitlab-ce.git')
+ repo_url = ENV.fetch('CI_REPOSITORY_URL', 'https://gitlab.com/gitlab-org/gitlab-foss.git')
# This workaround can be removed once we rename the dev CE project
- # https://gitlab.com/gitlab-org/gitlab-ce/issues/59107
+ # https://gitlab.com/gitlab-org/gitlab-foss/issues/59107
project_name = repo_url =~ /dev\.gitlab\.org/ ? 'gitlabhq' : 'gitlab-ce'
repo_url.sub('gitlab-ee', project_name)