Skip to content

Commit 36076c3

Browse files
Merge branch 'alexandermeindl-devel'
2 parents c27352b + e8d97f9 commit 36076c3

File tree

373 files changed

+5372
-11781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

373 files changed

+5372
-11781
lines changed

Diff for: .github/workflows/brakeman.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Run Brakeman
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Install package dependencies
14+
run: >
15+
sudo apt-get install --yes --quiet
16+
pandoc
17+
18+
- name: Set up Ruby 2.6
19+
uses: actions/setup-ruby@v1
20+
with:
21+
ruby-version: 2.6.x
22+
23+
- name: Setup gems
24+
run: |
25+
echo "source 'https://rubygems.org'" > Gemfile
26+
echo "group :test do" >> Gemfile
27+
echo " gem 'brakeman', require: false" >> Gemfile
28+
echo " gem 'pandoc-ruby', require: false" >> Gemfile
29+
echo "end">> Gemfile
30+
gem install bundler
31+
bundle install --jobs 4 --retry 3
32+
33+
- name: Run Brakeman
34+
run: |
35+
bundle exec brakeman -5

Diff for: .github/workflows/linters.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run Linters
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Install package dependencies
14+
run: >
15+
sudo apt-get install --yes --quiet
16+
pandoc
17+
18+
- name: Set up Ruby 2.6
19+
uses: actions/setup-ruby@v1
20+
with:
21+
ruby-version: 2.6.x
22+
23+
- name: Setup gems
24+
run: |
25+
echo "source 'https://rubygems.org'" > Gemfile
26+
echo "group :test do" >> Gemfile
27+
echo " gem 'pandoc-ruby', require: false" >> Gemfile
28+
echo " gem 'rubocop', require: false" >> Gemfile
29+
echo " gem 'rubocop-performance', require: false" >> Gemfile
30+
echo " gem 'rubocop-rails', require: false" >> Gemfile
31+
echo " gem 'rubocop-rspec', require: false" >> Gemfile
32+
echo " gem 'slim_lint', require: false" >> Gemfile
33+
echo "end" >> Gemfile
34+
gem install bundler
35+
bundle install --jobs 4 --retry 3
36+
37+
- name: Run RuboCop
38+
run: |
39+
bundle exec rubocop -S
40+
41+
- name: Run Slim-Lint
42+
run: |
43+
bundle exec slim-lint app/views
44+
if: always()

Diff for: .github/workflows/test.yml

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: Test
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
name: ${{ matrix.redmine }} ${{ matrix.db }} ruby-${{ matrix.ruby }}
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
ruby: ['2.6', '2.4']
14+
redmine: ['4.1-stable', 'master']
15+
db: ['postgres', 'mysql']
16+
fail-fast: false
17+
18+
services:
19+
postgres:
20+
image: postgres:13
21+
env:
22+
POSTGRES_USER: postgres
23+
POSTGRES_PASSWORD: postgres
24+
ports:
25+
- 5432:5432
26+
27+
options: >-
28+
--health-cmd pg_isready
29+
--health-interval 10s
30+
--health-timeout 5s
31+
--health-retries 5
32+
33+
mysql:
34+
image: mysql:5.7
35+
env:
36+
MYSQL_USER: root
37+
MYSQL_PASSWORD: ''
38+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
39+
ports:
40+
- 3306:3306
41+
options: >-
42+
--health-cmd="mysqladmin ping"
43+
--health-interval=10s
44+
--health-timeout=5s
45+
--health-retries=3
46+
47+
steps:
48+
- name: Verify MySQL connection from host
49+
run: |
50+
mysql --host 127.0.0.1 --port 3306 -uroot -e "SHOW DATABASES"
51+
if: matrix.db == 'mysql'
52+
53+
- name: Checkout Redmine
54+
uses: actions/checkout@v2
55+
with:
56+
repository: redmine/redmine
57+
ref: ${{ matrix.redmine }}
58+
path: redmine
59+
60+
- name: Checkout redmine_git_hosting
61+
uses: actions/checkout@v2
62+
with:
63+
path: redmine/plugins/redmine_git_hosting
64+
65+
- name: Checkout additionals
66+
uses: actions/checkout@v2
67+
with:
68+
repository: AlphaNodes/additionals
69+
path: redmine/plugins/additionals
70+
71+
- name: Checkout redmine_sidekiq
72+
uses: actions/checkout@v2
73+
with:
74+
repository: ogom/redmine_sidekiq
75+
path: redmine/plugins/redmine_sidekiq
76+
77+
- name: Checkout gitolite
78+
uses: actions/checkout@v2
79+
with:
80+
repository: sitaramc/gitolite
81+
path: gitolite
82+
83+
- name: Update package archives
84+
run: sudo apt-get update --yes --quiet
85+
86+
- name: Install package dependencies
87+
run: >
88+
sudo apt-get install --yes --quiet
89+
build-essential
90+
cmake
91+
libgpg-error-dev
92+
libicu-dev
93+
libpq-dev
94+
libmysqlclient-dev
95+
libssh2-1
96+
libssh2-1-dev
97+
subversion
98+
99+
- name: Setup Ruby
100+
uses: actions/setup-ruby@v1
101+
with:
102+
ruby-version: ${{ matrix.ruby }}
103+
104+
- name: Setup Cache
105+
uses: actions/cache@v1
106+
with:
107+
path: vendor
108+
key: v1-ruby-${{ matrix.ruby }}-redmine-${{ matrix.redmine }}
109+
110+
- name: Setup Bundler
111+
run: |
112+
gem install bundler -v '~> 1.0'
113+
bundle config path "$(pwd)/vendor/bundle"
114+
115+
- name: Prepare Redmine source
116+
working-directory: redmine
117+
run: |
118+
sed -i '/rubocop/d' Gemfile
119+
rm -f .rubocop*
120+
cp plugins/redmine_git_hosting/contrib/github/database-${{ matrix.db }}.yml config/database.yml
121+
122+
- name: Install admin ssh key
123+
working-directory: redmine
124+
run: |
125+
ssh-keygen -N '' -f plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa
126+
127+
- name: Install Gitolite
128+
working-directory: redmine
129+
run: |
130+
sudo useradd --create-home git
131+
sudo -n -u git -i mkdir bin
132+
sudo -n -u git -i $GITHUB_WORKSPACE/gitolite/install -to /home/git/bin
133+
sudo cp plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa.pub /home/git/
134+
sudo chown git.git /home/git/redmine_gitolite_admin_id_rsa.pub
135+
sudo -n -u git -i bin/gitolite setup -pk redmine_gitolite_admin_id_rsa.pub
136+
137+
- name: Install Ruby dependencies
138+
working-directory: redmine
139+
run: |
140+
bundle install --jobs=4 --retry=3 --without development
141+
142+
- name: Run Redmine rake tasks
143+
env:
144+
RAILS_ENV: test
145+
working-directory: redmine
146+
run: |
147+
bundle exec rake generate_secret_token
148+
bundle exec rake db:create db:migrate redmine:plugins:migrate
149+
bundle exec rake db:test:prepare
150+
151+
- name: Install rspec file
152+
working-directory: redmine
153+
run: |
154+
mkdir spec
155+
cp plugins/redmine_git_hosting/spec/root_spec_helper.rb spec/spec_helper.rb
156+
157+
- name: Run tests
158+
env:
159+
RAILS_ENV: test
160+
REDMINE_VERSION: ${{ matrix.redmine }}
161+
working-directory: redmine
162+
run: bundle exec rake redmine_git_hosting:ci:all

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ settings.yml
66
/coverage
77
/junit
88
custom_hooks.rb
9+
/ssh_keys/redmine_gitolite_admin_id_rsa*
10+
.DS_Store
11+
coverage/

Diff for: .rubocop.yml

+36-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
inherit_from: .rubocop_todo.yml
2+
13
require:
2-
- rubocop-rspec
34
- rubocop-performance
5+
- rubocop-rails
46

57
Rails:
68
Enabled: true
79

810
AllCops:
9-
TargetRubyVersion: 2.5
11+
TargetRubyVersion: 2.4
1012
TargetRailsVersion: 5.2
13+
NewCops: enable
1114
Include:
1215
- '**/*.ruby'
1316
- '**/*.rake'
@@ -17,44 +20,65 @@ AllCops:
1720
- '**/Gemfile'
1821

1922
Metrics/AbcSize:
20-
Max: 65
23+
Enabled: false
2124

2225
Metrics/BlockLength:
23-
Max: 60
26+
Enabled: false
2427

2528
Metrics/ClassLength:
2629
Enabled: false
2730

2831
Metrics/CyclomaticComplexity:
29-
Max: 20
32+
Enabled: false
3033

31-
Metrics/LineLength:
34+
Layout/LineLength:
3235
Max: 140
3336

3437
Metrics/MethodLength:
35-
Max: 60
38+
Enabled: false
3639

3740
Metrics/ModuleLength:
3841
Enabled: false
3942

4043
Metrics/PerceivedComplexity:
41-
Max: 25
44+
Max: 45
4245

43-
Rails/SkipsModelValidations:
46+
Rails/ApplicationJob:
47+
Enabled: false
48+
49+
Rails/ApplicationRecord:
4450
Enabled: false
4551

4652
Rails/CreateTableWithTimestamps:
4753
Enabled: false
4854

49-
# app/model/application_record.rb is missing in redmine, we can't use ApplicationRecord
50-
Rails/ApplicationRecord:
55+
Rails/HelperInstanceVariable:
5156
Enabled: false
5257

53-
Style/FrozenStringLiteralComment:
58+
Rails/SkipsModelValidations:
5459
Enabled: false
5560

61+
Performance/ChainArrayAllocation:
62+
Enabled: true
63+
5664
Style/AutoResourceCleanup:
5765
Enabled: true
5866

67+
Style/FrozenStringLiteralComment:
68+
Enabled: false
69+
5970
Style/Documentation:
6071
Enabled: false
72+
73+
# required for travis/ci (symbolic links problem)
74+
Style/ExpandPathArguments:
75+
Enabled: false
76+
77+
Style/HashTransformKeys:
78+
Enabled: false
79+
80+
Style/HashTransformValues:
81+
Enabled: false
82+
83+
Naming/VariableNumber:
84+
Enabled: false

0 commit comments

Comments
 (0)