From fb1a16b4236495a843a0bf2e11af43c6af303056 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 17 Mar 2019 11:51:09 +0530 Subject: [PATCH 1/8] Add link to gitlab page on Debian wiki --- debian/README.Debian | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/README.Debian b/debian/README.Debian index 2aced34490..1093592e1c 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -145,3 +145,8 @@ The steps involve dropping into rails console as gitlab user for production envi irb(main):001:0> user = User.find_by(email: 'useraddress@domain') irb(main):003:0> user.admin=true irb(main):004:0> user.save + +Latest information regarding supported versions +=============================================== +Subscribe to https://wiki.debian.org/gitlab to get updates about new package +versions in unofficial repositories. From 1acd00dc1e5af1598d895333ea2be0be3b5de580 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 17 Mar 2019 12:45:20 +0530 Subject: [PATCH 2/8] Set minimum version of ruby to 1:2.5~ and add conflict with libruby2.3 --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 9f61806a98..5d19ea99fc 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, gitlab-common (= ${source:Version}), - ruby | ruby-interpreter, + ruby (>= 1:2.5~), lsb-base (>= 3.0-6), rake (>= 12.3.0~), bundler, @@ -349,6 +349,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, # node-katex Recommends: certbot, gitaly (>= 1.20~) +Conflicts: libruby2.3 Description: git powered software platform to collaborate on code (non-omnibus) gitlab provides web based interface to host source code and track issues. It allows anyone for fork a repository and send merge requests. Code review From a233316a77e84e4cc505e34e2fa822002ab4700a Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 17 Mar 2019 12:51:53 +0530 Subject: [PATCH 3/8] Tighten dependency on ruby-lograge --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 5d19ea99fc..fc8c7c3e48 100644 --- a/debian/control +++ b/debian/control @@ -298,7 +298,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ruby-flipper-active-record (>= 0.13~), ruby-flipper-active-support-cache-store (>= 0.13~), # Structured logging - ruby-lograge (>= 0.5~), + ruby-lograge (>= 0.10~), ruby-grape-logging (>= 1.7~), # Vendored js files # Keeping this to ease backporting as it is in contrib anyway From afa3a914fd5c661503007d53629a292e41870d1b Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 17 Mar 2019 17:00:45 +0530 Subject: [PATCH 4/8] Remove obsolete config files --- debian/maintscript | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/maintscript b/debian/maintscript index 8018353f27..0ada2bf38a 100644 --- a/debian/maintscript +++ b/debian/maintscript @@ -7,4 +7,10 @@ rm_conffile /etc/gitlab/initializers/additional_headers_interceptor.rb 11.2.8+ rm_conffile /etc/gitlab/initializers/asset_sync.rb 11.5.3+dfsg-1 gitlab rm_conffile /etc/gitlab/initializers/email_template_interceptor.rb 11.2.8+dfsg-1 gitlab rm_conffile /etc/gitlab/initializers/active_record_verbose_query_logs.rb 11.6.0+dfsg-1 gitlab +rm_conffile /etc/gitlab/initializers/active_record_array_type_casting.rb 11.8.2-3 gitlab +rm_conffile /etc/gitlab/initializers/active_record_avoid_type_casting_in_uniqueness_validator.rb 11.8.2-3 gitlab +rm_conffile /etc/gitlab/initializers/active_record_locking.rb 11.8.2-3 gitlab +rm_conffile /etc/gitlab/initializers/application_controller_renderer.rb 11.8.2-3 gitlab +rm_conffile /etc/gitlab/initializers/ar5_batching.rb 11.8.2-3 gitlab +rm_conffile /etc/gitlab/initializers/ar5_pg_10_support.rb 11.8.2-3 gitlab dir_to_symlink /usr/share/gitlab/app/assets/javascripts/locale /var/lib/gitlab/locale 9.5.4+dfsg-5 gitlab From 4c65ba56e1403788fe7426c636db0aed535ed791 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 17 Mar 2019 12:48:13 +0530 Subject: [PATCH 5/8] Update changelog --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0b07125cee..6cb9b3a45e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +gitlab (11.8.2-3) UNRELEASED; urgency=medium + + * Add link to gitlab page on Debian wiki in README.Debian + * Set minimum version of ruby to 1:2.5~ and add conflict with libruby2.3 + (to support smooth upgrading from stretch-backports) + * Tighten dependency on ruby-lograge + * Remove obsolete config files + + -- Pirate Praveen Sun, 17 Mar 2019 17:01:44 +0530 + gitlab (11.8.2-2) unstable; urgency=medium [ Sruthi Chandran ] From 094e4083851e7c89f9f7682f2d9e27afe8a135e1 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 17 Mar 2019 17:22:59 +0530 Subject: [PATCH 6/8] Drop patch which expected rails 5.2 --- debian/patches/0680-rails-5_2.patch | 61 ----------------------------- debian/patches/series | 1 - 2 files changed, 62 deletions(-) delete mode 100644 debian/patches/0680-rails-5_2.patch diff --git a/debian/patches/0680-rails-5_2.patch b/debian/patches/0680-rails-5_2.patch deleted file mode 100644 index 2b7a96e8bc..0000000000 --- a/debian/patches/0680-rails-5_2.patch +++ /dev/null @@ -1,61 +0,0 @@ -This monkey patch is not require with rails 5.2 - ---- a/config/initializers/active_record_verbose_query_logs.rb -+++ /dev/null -@@ -1,56 +0,0 @@ --# frozen_string_literal: true -- --# This is backport of https://github.com/rails/rails/pull/26815/files --# Enabled by default for every non-production environment -- --module ActiveRecord -- class LogSubscriber -- module VerboseQueryLogs -- def debug(progname = nil, &block) -- return unless super -- -- log_query_source -- end -- -- def log_query_source -- source_line, line_number = extract_callstack(caller_locations) -- -- if source_line -- if defined?(::Rails.root) -- app_root = "#{::Rails.root}/".freeze -- source_line = source_line.sub(app_root, "") -- end -- -- logger.debug(" ↳ #{source_line}:#{line_number}") -- end -- end -- -- def extract_callstack(callstack) -- line = callstack.find do |frame| -- frame.absolute_path && !ignored_callstack(frame.absolute_path) -- end -- -- offending_line = line || callstack.first -- [ -- offending_line.path, -- offending_line.lineno, -- offending_line.label -- ] -- end -- -- LOG_SUBSCRIBER_FILE = ActiveRecord::LogSubscriber.method(:logger).source_location.first -- RAILS_GEM_ROOT = File.expand_path("../../../..", LOG_SUBSCRIBER_FILE) + "/" -- APP_CONFIG_ROOT = File.expand_path("..", __dir__) + "/" -- -- def ignored_callstack(path) -- path.start_with?(APP_CONFIG_ROOT, RAILS_GEM_ROOT, RbConfig::CONFIG["rubylibdir"]) -- end -- end -- -- if Rails.version.start_with?("5.2") -- raise "Remove this monkey patch: #{__FILE__}" -- else -- prepend(VerboseQueryLogs) unless Rails.env.production? -- end -- end --end diff --git a/debian/patches/series b/debian/patches/series index d60a177c8e..12fd9d7795 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -22,7 +22,6 @@ 0660-fix-gitlab-yml-path.patch 0670-allow-doorkeepr-4_3.patch 0680-rails-5_1.patch -0680-rails-5_2.patch 0685-bump-fog.patch 0686-rails-5.1-embed.patch 0687-opentracing-embed.patch From 4cd14ed1c254d03a42e35226a83b297e4212ab63 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 17 Mar 2019 18:06:09 +0530 Subject: [PATCH 7/8] Handle migration from rails 4.2 --- debian/patches/0680-rails-5-migrations.patch | 20 ++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 21 insertions(+) create mode 100644 debian/patches/0680-rails-5-migrations.patch diff --git a/debian/patches/0680-rails-5-migrations.patch b/debian/patches/0680-rails-5-migrations.patch new file mode 100644 index 0000000000..f4d5239b55 --- /dev/null +++ b/debian/patches/0680-rails-5-migrations.patch @@ -0,0 +1,20 @@ +--- a/db/migrate/20181027114222_add_first_day_of_week_to_user_preferences.rb ++++ b/db/migrate/20181027114222_add_first_day_of_week_to_user_preferences.rb +@@ -1,6 +1,6 @@ + # frozen_string_literal: true + +-class AddFirstDayOfWeekToUserPreferences < ActiveRecord::Migration ++class AddFirstDayOfWeekToUserPreferences < ActiveRecord::Migration[4.2] + DOWNTIME = false + + def change +--- a/db/migrate/20181028120717_add_first_day_of_week_to_application_settings.rb ++++ b/db/migrate/20181028120717_add_first_day_of_week_to_application_settings.rb +@@ -1,6 +1,6 @@ + # frozen_string_literal: true + +-class AddFirstDayOfWeekToApplicationSettings < ActiveRecord::Migration ++class AddFirstDayOfWeekToApplicationSettings < ActiveRecord::Migration[4.2] + include Gitlab::Database::MigrationHelpers + disable_ddl_transaction! + diff --git a/debian/patches/series b/debian/patches/series index 12fd9d7795..563e8b99ca 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -22,6 +22,7 @@ 0660-fix-gitlab-yml-path.patch 0670-allow-doorkeepr-4_3.patch 0680-rails-5_1.patch +0680-rails-5-migrations.patch 0685-bump-fog.patch 0686-rails-5.1-embed.patch 0687-opentracing-embed.patch From b954a1adb5545b0c91513b82d9f7a2c38888f7cf Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 17 Mar 2019 18:34:51 +0530 Subject: [PATCH 8/8] Update changelog --- debian/changelog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6cb9b3a45e..1f337272c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,14 @@ -gitlab (11.8.2-3) UNRELEASED; urgency=medium +gitlab (11.8.2-3) unstable; urgency=medium * Add link to gitlab page on Debian wiki in README.Debian * Set minimum version of ruby to 1:2.5~ and add conflict with libruby2.3 (to support smooth upgrading from stretch-backports) * Tighten dependency on ruby-lograge * Remove obsolete config files + * Drop patch which expected rails 5.2 + * Handle migration from rails 4.2 - -- Pirate Praveen Sun, 17 Mar 2019 17:01:44 +0530 + -- Pirate Praveen Sun, 17 Mar 2019 18:34:25 +0530 gitlab (11.8.2-2) unstable; urgency=medium