From 333c9a7fda7b76a8ded49e532aa01ef77211f86e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 06:50:25 +0000 Subject: [PATCH 01/15] Initial plan From 1ff327efca594988164d59091412073039d82621 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 06:57:22 +0000 Subject: [PATCH 02/15] Implement Redmine 6 compatibility changes Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 4 ++-- CHANGELOG.md | 18 ++++++++++++++++++ app/models/git_cache.rb | 2 +- app/models/github_comment.rb | 2 +- app/models/github_issue.rb | 2 +- app/models/gitolite_public_key.rb | 2 +- app/models/protected_branches_member.rb | 2 +- app/models/repository_deployment_credential.rb | 2 +- app/models/repository_git_config_key.rb | 2 +- app/models/repository_git_extra.rb | 5 +++-- app/models/repository_mirror.rb | 2 +- app/models/repository_post_receive_url.rb | 4 ++-- app/models/repository_protected_branche.rb | 2 +- ...3030100_migrate_protected_branches_users.rb | 2 +- init.rb | 2 +- lib/redmine_git_hosting.rb | 2 +- 16 files changed, 37 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3315ceda..0fa501a24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,8 +11,8 @@ jobs: strategy: matrix: - ruby: ['2.7', '3.0', '3.1'] - redmine: ['5.0-stable', 'master'] + ruby: ['3.0', '3.1', '3.2', '3.3'] + redmine: ['6.0-stable', 'master'] db: ['postgres', 'mysql'] fail-fast: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e765c5d4..e392a48aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 7.0.0 - TBD + +### Added + +- Support for Redmine 6.0 + +### Changed + +- Update all models to inherit from ApplicationRecord instead of ActiveRecord::Base +- Fix serialize syntax for Rails 7 compatibility using `type:` parameter +- Update minimum Ruby version requirement to 3.0+ + +### BREAKING CHANGE + +- Redmine 6.0+ is required +- Ruby 3.0+ is required +- Removed support for Redmine 5.x + ## 6.0.1 - 2022-11-04 ### Changed diff --git a/app/models/git_cache.rb b/app/models/git_cache.rb index efdbaf6ee..841959a91 100644 --- a/app/models/git_cache.rb +++ b/app/models/git_cache.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class GitCache < ActiveRecord::Base +class GitCache < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes CACHE_ADAPTERS = [%w[Database database], diff --git a/app/models/github_comment.rb b/app/models/github_comment.rb index ccc849ff1..1063111cc 100644 --- a/app/models/github_comment.rb +++ b/app/models/github_comment.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class GithubComment < ActiveRecord::Base +class GithubComment < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) ## Relations belongs_to :journal diff --git a/app/models/github_issue.rb b/app/models/github_issue.rb index 782f70b27..0028eecf1 100644 --- a/app/models/github_issue.rb +++ b/app/models/github_issue.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class GithubIssue < ActiveRecord::Base +class GithubIssue < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) ## Relations belongs_to :issue diff --git a/app/models/gitolite_public_key.rb b/app/models/gitolite_public_key.rb index 8bc94ee6c..e295ed88f 100644 --- a/app/models/gitolite_public_key.rb +++ b/app/models/gitolite_public_key.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class GitolitePublicKey < ActiveRecord::Base +class GitolitePublicKey < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes TITLE_LENGTH_LIMIT = 60 diff --git a/app/models/protected_branches_member.rb b/app/models/protected_branches_member.rb index 59b8043e9..f965cb556 100644 --- a/app/models/protected_branches_member.rb +++ b/app/models/protected_branches_member.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class ProtectedBranchesMember < ActiveRecord::Base +class ProtectedBranchesMember < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes ## Attributes diff --git a/app/models/repository_deployment_credential.rb b/app/models/repository_deployment_credential.rb index 0dde9e71e..b735a24b3 100644 --- a/app/models/repository_deployment_credential.rb +++ b/app/models/repository_deployment_credential.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class RepositoryDeploymentCredential < ActiveRecord::Base +class RepositoryDeploymentCredential < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes VALID_PERMS = ['R', 'RW+'].freeze diff --git a/app/models/repository_git_config_key.rb b/app/models/repository_git_config_key.rb index 430f6be22..8216bc46d 100644 --- a/app/models/repository_git_config_key.rb +++ b/app/models/repository_git_config_key.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class RepositoryGitConfigKey < ActiveRecord::Base +class RepositoryGitConfigKey < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes ## Attributes diff --git a/app/models/repository_git_extra.rb b/app/models/repository_git_extra.rb index fe6e3a37c..202c2c492 100644 --- a/app/models/repository_git_extra.rb +++ b/app/models/repository_git_extra.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true -class RepositoryGitExtra < ActiveRecord::Base +class RepositoryGitExtra < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes + include Redmine::I18n SMART_HTTP_OPTIONS = [[l(:label_disabled), '0'], [l(:label_http_only), '3'], @@ -33,7 +34,7 @@ class RepositoryGitExtra < ActiveRecord::Base validate :validate_urls_order ## Serializations - serialize :urls_order, Array + serialize :urls_order, type: Array ## Callbacks before_save :check_urls_order_consistency diff --git a/app/models/repository_mirror.rb b/app/models/repository_mirror.rb index d222a09ef..b4723dfdc 100644 --- a/app/models/repository_mirror.rb +++ b/app/models/repository_mirror.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class RepositoryMirror < ActiveRecord::Base +class RepositoryMirror < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes PUSHMODE_MIRROR = 0 diff --git a/app/models/repository_post_receive_url.rb b/app/models/repository_post_receive_url.rb index 8bfb858dc..a8b53ce7f 100644 --- a/app/models/repository_post_receive_url.rb +++ b/app/models/repository_post_receive_url.rb @@ -2,7 +2,7 @@ require 'uri' -class RepositoryPostReceiveUrl < ActiveRecord::Base +class RepositoryPostReceiveUrl < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes ## Attributes @@ -22,7 +22,7 @@ class RepositoryPostReceiveUrl < ActiveRecord::Base validates :mode, presence: true, inclusion: { in: %i[github get post] } ## Serializations - serialize :triggers, Array + serialize :triggers, type: Array ## Scopes scope :active, -> { where active: true } diff --git a/app/models/repository_protected_branche.rb b/app/models/repository_protected_branche.rb index f95911266..ea0e47594 100644 --- a/app/models/repository_protected_branche.rb +++ b/app/models/repository_protected_branche.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class RepositoryProtectedBranche < ActiveRecord::Base +class RepositoryProtectedBranche < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) include Redmine::SafeAttributes VALID_PERMS = ['RW+', 'RW', 'R', '-'].freeze DEFAULT_PERM = 'RW+' diff --git a/db/migrate/20150823030100_migrate_protected_branches_users.rb b/db/migrate/20150823030100_migrate_protected_branches_users.rb index 9c1b60c54..1315ce46d 100644 --- a/db/migrate/20150823030100_migrate_protected_branches_users.rb +++ b/db/migrate/20150823030100_migrate_protected_branches_users.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class RepositoryProtectedBrancheWrapped < RepositoryProtectedBranche - serialize :user_list, Array + serialize :user_list, type: Array end class MigrateProtectedBranchesUsers < ActiveRecord::Migration[4.2] diff --git a/init.rb b/init.rb index bc3ba946d..3c2633639 100644 --- a/init.rb +++ b/init.rb @@ -11,7 +11,7 @@ author_url 'settings/plugin/redmine_git_hosting/authors' settings partial: 'settings/redmine_git_hosting', default: RedmineGitHosting.settings - requires_redmine version_or_higher: '4.1.0' + requires_redmine version_or_higher: '6.0.0' permission :create_gitolite_ssh_key, gitolite_public_keys: %i[index create destroy], require: :loggedin diff --git a/lib/redmine_git_hosting.rb b/lib/redmine_git_hosting.rb index 63ba515e7..670b01666 100644 --- a/lib/redmine_git_hosting.rb +++ b/lib/redmine_git_hosting.rb @@ -6,7 +6,7 @@ module RedmineGitHosting extend self - VERSION = '6.0.1' + VERSION = '7.0.0' # Load RedminePluginLoader extend RedminePluginLoader From 46452f450b86ab2a8d579f22cfea740dcaa88e7a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 07:47:27 +0000 Subject: [PATCH 03/15] Revert unnecessary ApplicationRecord inheritance change for GitCache Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- app/models/git_cache.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/git_cache.rb b/app/models/git_cache.rb index 841959a91..efdbaf6ee 100644 --- a/app/models/git_cache.rb +++ b/app/models/git_cache.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class GitCache < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class GitCache < ActiveRecord::Base include Redmine::SafeAttributes CACHE_ADAPTERS = [%w[Database database], From 630c8a00420d87184f041d7cc1e35e7dc2f029dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 07:52:13 +0000 Subject: [PATCH 04/15] Remove Ruby 3.0 from CI matrix - not supported by Redmine 6.0 Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fa501a24..2dcafad49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - ruby: ['3.0', '3.1', '3.2', '3.3'] + ruby: ['3.1', '3.2', '3.3'] redmine: ['6.0-stable', 'master'] db: ['postgres', 'mysql'] fail-fast: false From 87a7b47b70513f2d4f1dca882636118398e27da0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 08:04:50 +0000 Subject: [PATCH 05/15] Revert unnecessary ApplicationRecord inheritance changes for utility models Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- app/models/github_comment.rb | 2 +- app/models/github_issue.rb | 2 +- app/models/gitolite_public_key.rb | 2 +- app/models/protected_branches_member.rb | 2 +- app/models/repository_deployment_credential.rb | 2 +- app/models/repository_git_config_key.rb | 2 +- app/models/repository_mirror.rb | 2 +- app/models/repository_post_receive_url.rb | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/github_comment.rb b/app/models/github_comment.rb index 1063111cc..ccc849ff1 100644 --- a/app/models/github_comment.rb +++ b/app/models/github_comment.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class GithubComment < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class GithubComment < ActiveRecord::Base ## Relations belongs_to :journal diff --git a/app/models/github_issue.rb b/app/models/github_issue.rb index 0028eecf1..782f70b27 100644 --- a/app/models/github_issue.rb +++ b/app/models/github_issue.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class GithubIssue < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class GithubIssue < ActiveRecord::Base ## Relations belongs_to :issue diff --git a/app/models/gitolite_public_key.rb b/app/models/gitolite_public_key.rb index e295ed88f..8bc94ee6c 100644 --- a/app/models/gitolite_public_key.rb +++ b/app/models/gitolite_public_key.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class GitolitePublicKey < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class GitolitePublicKey < ActiveRecord::Base include Redmine::SafeAttributes TITLE_LENGTH_LIMIT = 60 diff --git a/app/models/protected_branches_member.rb b/app/models/protected_branches_member.rb index f965cb556..59b8043e9 100644 --- a/app/models/protected_branches_member.rb +++ b/app/models/protected_branches_member.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class ProtectedBranchesMember < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class ProtectedBranchesMember < ActiveRecord::Base include Redmine::SafeAttributes ## Attributes diff --git a/app/models/repository_deployment_credential.rb b/app/models/repository_deployment_credential.rb index b735a24b3..0dde9e71e 100644 --- a/app/models/repository_deployment_credential.rb +++ b/app/models/repository_deployment_credential.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class RepositoryDeploymentCredential < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class RepositoryDeploymentCredential < ActiveRecord::Base include Redmine::SafeAttributes VALID_PERMS = ['R', 'RW+'].freeze diff --git a/app/models/repository_git_config_key.rb b/app/models/repository_git_config_key.rb index 8216bc46d..430f6be22 100644 --- a/app/models/repository_git_config_key.rb +++ b/app/models/repository_git_config_key.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class RepositoryGitConfigKey < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class RepositoryGitConfigKey < ActiveRecord::Base include Redmine::SafeAttributes ## Attributes diff --git a/app/models/repository_mirror.rb b/app/models/repository_mirror.rb index b4723dfdc..d222a09ef 100644 --- a/app/models/repository_mirror.rb +++ b/app/models/repository_mirror.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class RepositoryMirror < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class RepositoryMirror < ActiveRecord::Base include Redmine::SafeAttributes PUSHMODE_MIRROR = 0 diff --git a/app/models/repository_post_receive_url.rb b/app/models/repository_post_receive_url.rb index a8b53ce7f..5daad69b9 100644 --- a/app/models/repository_post_receive_url.rb +++ b/app/models/repository_post_receive_url.rb @@ -2,7 +2,7 @@ require 'uri' -class RepositoryPostReceiveUrl < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) +class RepositoryPostReceiveUrl < ActiveRecord::Base include Redmine::SafeAttributes ## Attributes From 57198b5da8e3fcd54daeafb9b700fc2f66367932 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 08:24:51 +0000 Subject: [PATCH 06/15] Add debugging commands to gitolite installation step Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2dcafad49..df76b1f00 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -120,6 +120,8 @@ jobs: working-directory: redmine run: | sudo useradd --create-home git + chmod -R 777 $GITHUB_WORKSPACE/gitolite + ls -l $GITHUB_WORKSPACE/gitolite/install sudo -n -u git -i mkdir bin sudo -n -u git -i $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin sudo cp plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa.pub /home/git/ From c2f53b963ba137e4cd2917112cc588a0b3fd920e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 08:50:08 +0000 Subject: [PATCH 07/15] Fix CI by making gitolite install script executable Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df76b1f00..a7a7ac38d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -120,8 +120,7 @@ jobs: working-directory: redmine run: | sudo useradd --create-home git - chmod -R 777 $GITHUB_WORKSPACE/gitolite - ls -l $GITHUB_WORKSPACE/gitolite/install + chmod +x $GITHUB_WORKSPACE/gitolite/install sudo -n -u git -i mkdir bin sudo -n -u git -i $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin sudo cp plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa.pub /home/git/ From 3fe38460403fb633cc0332e221d21921babfd838 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 09:07:48 +0000 Subject: [PATCH 08/15] Fix CI: Use bash interpreter for gitolite install script Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a7a7ac38d..f388a5d79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -120,9 +120,8 @@ jobs: working-directory: redmine run: | sudo useradd --create-home git - chmod +x $GITHUB_WORKSPACE/gitolite/install sudo -n -u git -i mkdir bin - sudo -n -u git -i $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin + sudo -n -u git -i bash $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin sudo cp plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa.pub /home/git/ sudo chown git.git /home/git/redmine_gitolite_admin_id_rsa.pub sudo -n -u git -i bin/gitolite setup -pk redmine_gitolite_admin_id_rsa.pub From c6bfcbbcc7d0476033b08a4c29a70b18136aa713 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 09:23:58 +0000 Subject: [PATCH 09/15] Fix CI: Use perl interpreter for gitolite install script instead of bash The gitolite install script is a Perl script and must be run with perl, not bash. Running it with bash was causing syntax errors as bash doesn't understand Perl syntax. This fix ensures the gitolite installation step works correctly in CI. Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f388a5d79..8c5841239 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,7 +121,7 @@ jobs: run: | sudo useradd --create-home git sudo -n -u git -i mkdir bin - sudo -n -u git -i bash $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin + sudo -n -u git -i perl $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin sudo cp plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa.pub /home/git/ sudo chown git.git /home/git/redmine_gitolite_admin_id_rsa.pub sudo -n -u git -i bin/gitolite setup -pk redmine_gitolite_admin_id_rsa.pub From 900e54fa45a5a98d82b64562ad9a6ed7fad3f425 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 11:16:28 +0000 Subject: [PATCH 10/15] Fix CI: Copy gitolite to git user home directory to resolve permission issues Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c5841239..ee78ae1d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,7 +121,9 @@ jobs: run: | sudo useradd --create-home git sudo -n -u git -i mkdir bin - sudo -n -u git -i perl $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin + sudo cp -r $GITHUB_WORKSPACE/gitolite /home/git/ + sudo chown -R git:git /home/git/gitolite + sudo -n -u git -i perl /home/git/gitolite/install -to /home/git/bin sudo cp plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa.pub /home/git/ sudo chown git.git /home/git/redmine_gitolite_admin_id_rsa.pub sudo -n -u git -i bin/gitolite setup -pk redmine_gitolite_admin_id_rsa.pub From fd07f62f9b975c26e70a3f43a0c7ae63115987d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 11:41:36 +0000 Subject: [PATCH 11/15] Fix CI: Switch to original redmine_sidekiq repository with Rails 6+ compatibility Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee78ae1d1..23e43e86f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,10 +71,7 @@ jobs: - name: Checkout redmine_sidekiq uses: actions/checkout@v3 with: - # TODO Switch back to the original repo, once https://github.com/ogom/redmine_sidekiq/pull/16 is released - # repository: ogom/redmine_sidekiq - repository: dosyfier/redmine_sidekiq - ref: fix-rails-6 + repository: ogom/redmine_sidekiq path: redmine/plugins/redmine_sidekiq - name: Checkout gitolite From 0b7cb581eab09cc8a918844d4fc5253d424cdb87 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Tue, 12 Aug 2025 11:49:38 +0900 Subject: [PATCH 12/15] Non-constrained sidekiq version --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 7d067916f..148f6b6ea 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ gem 'RedCloth' gem 'rack-parser', require: 'rack/parser' # temp autoloading fix -gem 'sidekiq', '<7' +gem 'sidekiq' gem 'sshkey' group :development, :test do From bb266c154a2979226a434cbb1e04ccdd6a9ffff6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 Aug 2025 03:53:40 +0000 Subject: [PATCH 13/15] Replace direct redcarpet usage with Redmine WikiFormatting system in redcarpet_filter.rb Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- lib/redmine_git_hosting/redcarpet_filter.rb | 39 ++++++++------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/lib/redmine_git_hosting/redcarpet_filter.rb b/lib/redmine_git_hosting/redcarpet_filter.rb index c49c5e48a..cd3ddf5bf 100644 --- a/lib/redmine_git_hosting/redcarpet_filter.rb +++ b/lib/redmine_git_hosting/redcarpet_filter.rb @@ -2,46 +2,35 @@ require 'html/pipeline/filter' require 'html/pipeline/text_filter' -require 'redcarpet' -require 'rouge' -require 'rouge/plugins/redcarpet' module RedmineGitHosting - class HTMLwithRouge < Redcarpet::Render::HTML - include Rouge::Plugins::Redcarpet - end - class RedcarpetFilter < HTML::Pipeline::TextFilter def initialize(text, context = nil, result = nil) super text, context, result @text = @text.delete "\r" end - # Convert Markdown to HTML using the best available implementation - # and convert into a DocumentFragment. + # Convert Markdown to HTML using Redmine's WikiFormatting system + # for consistency with Redmine's text formatting configuration. # def call - html = self.class.renderer.render @text + html = markdown_formatter.new(@text).to_html html.rstrip! html end - def self.renderer - @renderer ||= Redcarpet::Markdown.new HTMLwithRouge, markdown_options - end + private - def self.markdown_options - @markdown_options ||= { - fenced_code_blocks: true, - lax_spacing: true, - strikethrough: true, - autolink: true, - tables: true, - underline: true, - highlight: true - }.freeze + def markdown_formatter + # Find the markdown formatter from Redmine's WikiFormatting system + formatter_name = Redmine::WikiFormatting.format_names.find { |name| name =~ /markdown/i } + + if formatter_name + Redmine::WikiFormatting.formatter_for(formatter_name) + else + # Fallback to textile formatter if no markdown formatter is available + Redmine::WikiFormatting.formatter_for('textile') + end end - - private_class_method :markdown_options end end From 733371fde11a9edb01d95b97c63014e34d6819ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 Aug 2025 04:21:44 +0000 Subject: [PATCH 14/15] Fix CI: Remove Ruby 3.1 from matrix since plugin requires Ruby 3.2+ Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23e43e86f..c0e7ee59d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - ruby: ['3.1', '3.2', '3.3'] + ruby: ['3.2', '3.3'] redmine: ['6.0-stable', 'master'] db: ['postgres', 'mysql'] fail-fast: false From 57b34ee9eac779740d46f37baf8a563d154b8bbe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 Aug 2025 04:57:27 +0000 Subject: [PATCH 15/15] Revert last commit and fix Sidekiq::Extensions CI error by adding version constraint Co-authored-by: PowerKiKi <72603+PowerKiKi@users.noreply.github.com> --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 148f6b6ea..7d067916f 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ gem 'RedCloth' gem 'rack-parser', require: 'rack/parser' # temp autoloading fix -gem 'sidekiq' +gem 'sidekiq', '<7' gem 'sshkey' group :development, :test do