Skip to content

Commit bad6fe7

Browse files
committed
Add support for Redmine 5.1/6.0/6.1
1 parent 4992940 commit bad6fe7

23 files changed

Lines changed: 149 additions & 48 deletions
Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,64 @@
1-
name: Test
1+
name: CI
22

33
on:
44
- push
55
- pull_request
66

77
jobs:
88
test:
9-
name: ${{ matrix.redmine }} ${{ matrix.db }} ruby-${{ matrix.ruby }}
9+
name: ${{ matrix.redmine[0] }} ${{ matrix.db }} ruby-${{ matrix.ruby }}
1010
runs-on: ubuntu-latest
1111

1212
strategy:
13-
matrix:
14-
ruby: ['2.7', '3.0', '3.1']
15-
redmine: ['5.0-stable', 'master']
16-
db: ['postgres', 'mysql']
1713
fail-fast: false
14+
matrix:
15+
ruby:
16+
- '3.4'
17+
- '3.3'
18+
- '3.2'
19+
- '3.1'
20+
- '3.0'
21+
redmine:
22+
# we must follow "additionals" Redmine plugin version constraints
23+
# see: https://github.com/alphanodes/additionals/blob/main/CHANGELOG.md
24+
# [redmine_version, additionals_version]
25+
- ['5.0-stable', '3.2.0']
26+
- ['5.1-stable', '3.4.0']
27+
- ['6.0-stable', '4.0.0']
28+
- ['6.1-stable', '4.3.0']
29+
db:
30+
- 'postgres'
31+
# - 'mysql'
32+
33+
exclude:
34+
- ruby: '3.4'
35+
redmine: ['5.0-stable', '3.2.0']
36+
- ruby: '3.4'
37+
redmine: ['5.1-stable', '3.4.0']
38+
- ruby: '3.4'
39+
redmine: ['6.0-stable', '4.0.0']
40+
41+
- ruby: '3.3'
42+
redmine: ['5.0-stable', '3.2.0']
43+
- ruby: '3.3'
44+
redmine: ['5.1-stable', '3.4.0']
45+
46+
- ruby: '3.2'
47+
redmine: ['5.0-stable', '3.2.0']
48+
49+
- ruby: '3.1'
50+
redmine: ['6.1-stable', '4.3.0']
51+
52+
- ruby: '3.0'
53+
redmine: ['5.1-stable', '3.4.0']
54+
- ruby: '3.0'
55+
redmine: ['6.0-stable', '4.0.0']
56+
- ruby: '3.0'
57+
redmine: ['6.1-stable', '4.3.0']
1858

1959
services:
2060
postgres:
21-
image: postgres:14
61+
image: postgres:18
2262
env:
2363
POSTGRES_USER: postgres
2464
POSTGRES_PASSWORD: postgres
@@ -32,7 +72,7 @@ jobs:
3272
--health-retries 5
3373
3474
mysql:
35-
image: mysql:8.0
75+
image: mysql:9.6
3676
env:
3777
MYSQL_ROOT_PASSWORD: 'BestPasswordEver'
3878
ports:
@@ -51,34 +91,32 @@ jobs:
5191
if: matrix.db == 'mysql'
5292

5393
- name: Checkout Redmine
54-
uses: actions/checkout@v3
94+
uses: actions/checkout@v6
5595
with:
5696
repository: redmine/redmine
57-
ref: ${{ matrix.redmine }}
5897
path: redmine
98+
ref: ${{ matrix.redmine[0] }}
5999

60100
- name: Checkout redmine_git_hosting
61-
uses: actions/checkout@v3
101+
uses: actions/checkout@v6
62102
with:
63103
path: redmine/plugins/redmine_git_hosting
64104

65105
- name: Checkout additionals
66-
uses: actions/checkout@v3
106+
uses: actions/checkout@v6
67107
with:
68108
repository: AlphaNodes/additionals
69109
path: redmine/plugins/additionals
110+
ref: ${{ matrix.redmine[1] }}
70111

71112
- name: Checkout redmine_sidekiq
72-
uses: actions/checkout@v3
113+
uses: actions/checkout@v6
73114
with:
74-
# TODO Switch back to the original repo, once https://github.com/ogom/redmine_sidekiq/pull/16 is released
75-
# repository: ogom/redmine_sidekiq
76-
repository: dosyfier/redmine_sidekiq
77-
ref: fix-rails-6
115+
repository: redmine-git-hosting/redmine_sidekiq
78116
path: redmine/plugins/redmine_sidekiq
79117

80118
- name: Checkout gitolite
81-
uses: actions/checkout@v3
119+
uses: actions/checkout@v6
82120
with:
83121
repository: sitaramc/gitolite
84122
path: gitolite
@@ -120,12 +158,20 @@ jobs:
120158
working-directory: redmine
121159
run: |
122160
sudo useradd --create-home git
161+
sudo chmod 755 /home/git /home/runner
123162
sudo -n -u git -i mkdir bin
124163
sudo -n -u git -i $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin
125164
sudo cp plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa.pub /home/git/
126165
sudo chown git.git /home/git/redmine_gitolite_admin_id_rsa.pub
127166
sudo -n -u git -i bin/gitolite setup -pk redmine_gitolite_admin_id_rsa.pub
128167
168+
- name: Setup Ruby dependencies
169+
working-directory: redmine
170+
if: matrix.redmine[0] == '6.0-stable' || matrix.redmine[0] == '6.1-stable'
171+
run: |
172+
echo "gem 'observer'" > Gemfile.local
173+
echo "gem 'redcarpet'" >> Gemfile.local
174+
129175
- name: Install Ruby dependencies
130176
working-directory: redmine
131177
run: |

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ gem 'RedCloth'
3232
gem 'rack-parser', require: 'rack/parser'
3333

3434
# temp autoloading fix
35-
gem 'sidekiq', '<7'
35+
# gem 'sidekiq', '<7'
3636
gem 'sshkey'
3737

3838
group :development, :test do

app/controllers/repository_mirrors_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ class RepositoryMirrorsController < RedmineGitHostingController
66

77
accept_api_auth :index, :show
88

9-
helper :additionals_clipboardjs
9+
if RedmineGitHosting.old_additionals?
10+
helper :additionals_clipboardjs
11+
else
12+
helper :additionals_clipboard
13+
end
1014

1115
def index
1216
@repository_mirrors = @repository.mirrors.sorted

app/models/git_cache.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
class GitCache < ActiveRecord::Base
3+
class GitCache < RedmineGitHosting.old_redmine? ? ActiveRecord::Base : ApplicationRecord
44
include Redmine::SafeAttributes
55

66
CACHE_ADAPTERS = [%w[Database database],

app/models/github_comment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
class GithubComment < ActiveRecord::Base
3+
class GithubComment < RedmineGitHosting.old_redmine? ? ActiveRecord::Base : ApplicationRecord
44
## Relations
55
belongs_to :journal
66

app/models/github_issue.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
class GithubIssue < ActiveRecord::Base
3+
class GithubIssue < RedmineGitHosting.old_redmine? ? ActiveRecord::Base : ApplicationRecord
44
## Relations
55
belongs_to :issue
66

app/models/gitolite_public_key.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
class GitolitePublicKey < ActiveRecord::Base
3+
class GitolitePublicKey < RedmineGitHosting.old_redmine? ? ActiveRecord::Base : ApplicationRecord
44
include Redmine::SafeAttributes
55

66
TITLE_LENGTH_LIMIT = 60

0 commit comments

Comments
 (0)