git: 7040041239ce - main - www/gitlab: fix error uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger

From: Matthias Fechner <mfechner_at_FreeBSD.org>
Date: Wed, 05 Feb 2025 08:28:09 UTC
The branch main has been updated by mfechner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7040041239ce22d96504ce6e732b4f45eaedc875

commit 7040041239ce22d96504ce6e732b4f45eaedc875
Author:     Matthias Fechner <mfechner@FreeBSD.org>
AuthorDate: 2025-02-05 08:13:20 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2025-02-05 08:22:45 +0000

    www/gitlab: fix error uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
    
    The upgrade of gem concurrent-ruby to 1.3.5 made a bug in activesupport visible.
    The bug seems to be fixed for rails 7.1 and 7.2 but not 7.0 which gitlab uses.
    https://github.com/rails/rails/pull/49372
    https://github.com/rails/rails/issues/54260
    
    So we import the Logger to fix the error message:
    bundler: failed to load command: puma (/usr/local/bin/puma)
    /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
    
        Logger::Severity.constants.each do |severity|
              ^^^^^^^^^^
            from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:9:in `<module:ActiveSupport>'
            from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:8:in `<top (required)>'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_silence.rb:5:in `<top (required)>'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger.rb:3:in `<top (required)>'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support.rb:29:in `<top (required)>'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/all.rb:3:in `<top (required)>'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils.rb:4:in `<top (required)>'
            from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils/all.rb:3:in `require_relative'
            from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils/all.rb:3:in `<top (required)>'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
            from /usr/local/www/gitlab/lib/gitlab/cluster/lifecycle_events.rb:3:in `<top (required)>'
            from /usr/local/www/gitlab/config/puma.rb:38:in `require_relative'
            from /usr/local/www/gitlab/config/puma.rb:38:in `_load_from'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/dsl.rb:135:in `instance_eval'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/dsl.rb:135:in `_load_from'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `block in load'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `each'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `load'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/launcher.rb:56:in `initialize'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/cli.rb:66:in `new'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/cli.rb:66:in `initialize'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/bin/puma:8:in `new'
            from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/bin/puma:8:in `<top (required)>'
            from /usr/local/bin/puma:25:in `load'
            from /usr/local/bin/puma:25:in `<top (required)>'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `load'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `kernel_load'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:23:in `run'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:452:in `exec'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:35:in `dispatch'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:29:in `start'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/exe/bundle:28:in `block in <top (required)>'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
            from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/exe/bundle:20:in `<top (required)>'
            from /usr/local/bin/bundle:25:in `load'
            from /usr/local/bin/bundle:25:in `<main>'
---
 UPDATING                                      | 13 +++++++++++++
 www/gitlab/Makefile.common                    |  2 +-
 www/gitlab/files/patch-config_puma.rb.example | 17 +++++++++++++----
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/UPDATING b/UPDATING
index e73e235184eb..c8f2e8179190 100644
--- a/UPDATING
+++ b/UPDATING
@@ -5,6 +5,19 @@ they are unavoidable.
 You should get into the habit of checking this file for changes each time
 you update your ports collection, before attempting any port upgrades.
 
+20250205:
+  AFFECTS: users of www/gitlab
+  AUTHOR: mfechner@FreeBSD.org
+
+  Make sure you compare your /usr/local/www/gitlab/config/puma.rb with
+  /usr/local/www/gitlab/config/puma.rb.sample and make sure you have the:
+  require "logger"
+  line in your puma.rb.
+  This fixes an error:
+  /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
+
+    Logger::Severity.constants.each do |severity|
+
 20250203:
   AFFECTS: users of x11/kde5 and x11/kde6
   AUTHOR: arrowd@FreeBSD.org
diff --git a/www/gitlab/Makefile.common b/www/gitlab/Makefile.common
index e6c4bec98e92..0872936338d9 100644
--- a/www/gitlab/Makefile.common
+++ b/www/gitlab/Makefile.common
@@ -1,5 +1,5 @@
 GITLAB_VERSION=		17.8.1
-GITLAB_PORTREVISION=	0
+GITLAB_PORTREVISION=	1
 
 # Git version gitaly should use (from gitlab mirror)
 # Find current tag from Makefile and .gitlab-ci.yaml
diff --git a/www/gitlab/files/patch-config_puma.rb.example b/www/gitlab/files/patch-config_puma.rb.example
index a7cf2c2ced7e..b3218c5ffa71 100644
--- a/www/gitlab/files/patch-config_puma.rb.example
+++ b/www/gitlab/files/patch-config_puma.rb.example
@@ -1,6 +1,15 @@
---- config/puma.rb.example.orig	2024-04-09 16:46:13 UTC
+--- config/puma.rb.example.orig	2025-01-22 04:13:11 UTC
 +++ config/puma.rb.example
-@@ -5,11 +5,11 @@
+@@ -1,15 +1,20 @@
+ # frozen_string_literal: true
+ 
++# Required as rubygem-concurrent-ruby version 1.3.5 has remove logger, but is required by active_support
++# The fix has only applied to rails 7.1 and 7.2
++# https://github.com/rails/rails/pull/49372
++require "logger"
++
+ # Load "path" as a rackup file.
+ #
  # The default is "config.ru".
  #
  rackup 'config.ru'
@@ -16,7 +25,7 @@
    true
  
  # Configure "min" to be the minimum number of threads to use to answer
-@@ -31,11 +31,11 @@ queue_requests false
+@@ -31,11 +36,11 @@ queue_requests false
  
  # Bind the server to "url". "tcp://", "unix://" and "ssl://" are the only
  # accepted protocols.
@@ -30,7 +39,7 @@
  
  on_restart do
    # Signal application hooks that we're about to restart
-@@ -74,14 +74,14 @@ worker_timeout 60
+@@ -74,14 +79,14 @@ wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LES
  wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f
  
  # Use json formatter