Skip to content

Commit 44258e1

Browse files
committed
Merge branch 'release/1.2.1'
2 parents 5be8af2 + 4264cd0 commit 44258e1

24 files changed

+74
-250
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,6 @@
1-
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
2-
ARG VARIANT=2-bullseye
3-
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
4-
5-
# Install Rails
6-
RUN gem install rails webdrivers
7-
8-
# Default value to allow debug server to serve content over GitHub Codespace's port forwarding service
9-
# The value is a comma-separated list of allowed domains
10-
ENV RAILS_DEVELOPMENT_HOSTS=".githubpreview.dev"
11-
12-
# [Choice] Node.js version: lts/*, 16, 14, 12, 10
13-
ARG NODE_VERSION="lts/*"
14-
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"
15-
16-
# [Optional] Uncomment this section to install additional OS packages.
17-
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
18-
# && apt-get -y install --no-install-recommends <your-package-list-here>
19-
20-
# [Optional] Uncomment this line to install additional gems.
21-
# RUN gem install <your-gem-names-here>
22-
23-
# [Optional] Uncomment this line to install global node packages.
24-
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
25-
26-
RUN apt-get update
27-
RUN apt-get install -y imagemagick git-flow
28-
29-
WORKDIR /usr/local
1+
ARG RUBY_VERSION=3.2
302
ARG REDMINE_VERSION=master
31-
RUN git clone https://github.com/redmine/redmine.git -b ${REDMINE_VERSION}
32-
WORKDIR /usr/local/redmine
33-
COPY .devcontainer/database.yml /usr/local/redmine/config/database.yml
34-
35-
RUN rm -rf .git
36-
# RUN echo "gem 'ruby-debug-ide'" >> Gemfile
37-
RUN echo "gem 'debug'" >> Gemfile
38-
RUN echo "gem 'rufo'" >> Gemfile
39-
ENV DB=sqlite3
40-
RUN bundle install
41-
RUN bundle exec rake db:migrate
42-
RUN bundle exec rake db:migrate RAILS_ENV=test
43-
RUN bundle exec rake test:scm:setup:all
44-
COPY .devcontainer/launch.json /usr/local/redmine/.vscode/launch.json
45-
RUN chown -R vscode .
46-
RUN sed -i "s/^end/ config.hosts.clear\nend/" config/environments/development.rb
47-
3+
FROM haru/redmine_devcontainer:${REDMINE_VERSION}-ruby${RUBY_VERSION}
484
COPY .devcontainer/post-create.sh /post-create.sh
495

50-
WORKDIR /workspaces
6+

.devcontainer/database.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.devcontainer/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ services:
99
# Update 'VARIANT' to pick a version of Ruby: 3, 3.0, 2, 2.7, 2.6
1010
# Append -bullseye or -buster to pin to an OS version.
1111
# Use -bullseye variants on local arm64/Apple Silicon.
12-
VARIANT: "3.1"
12+
RUBY_VERSION: "3.2"
1313
# Optional Node.js version to install
1414
NODE_VERSION: "lts/*"
15-
REDMINE_VERSION: "5.0-stable"
15+
REDMINE_VERSION: "6.0-stable"
1616

1717
# Overrides default command so things don't shut down after the process ends.
1818
command: sleep infinity

.devcontainer/launch.json

Lines changed: 0 additions & 96 deletions
This file was deleted.

.devcontainer/post-create.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ then
77
cp plugins/${PLUGIN_NAME}/Gemfile_for_test plugins/${PLUGIN_NAME}/Gemfile
88
fi
99
cp plugins/${PLUGIN_NAME}/test/fixtures/*.yml test/fixtures
10+
ln -s /workspaces/${PLUGIN_NAME}/.devcontainer/launch.json .vscode/launch.json
1011

1112
bundle install
1213
bundle exec rake redmine:plugins:migrate
@@ -25,10 +26,20 @@ initdb() {
2526

2627
initdb
2728

28-
export DB=postgres
29+
export DB=mysql2
30+
export DB_NAME=redmine
31+
export DB_USERNAME=root
32+
export DB_PASSWORD=root
33+
export DB_HOST=mysql
34+
export DB_PORT=3306
2935

3036
initdb
3137

32-
export DB=mysql
38+
export DB=postgresql
39+
export DB_NAME=redmine
40+
export DB_USERNAME=postgres
41+
export DB_PASSWORD=postgres
42+
export DB_HOST=postgres
43+
export DB_PORT=5432
3344

3445
initdb

.github/workflows/build.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,27 @@ env:
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
# Supported Matrix:
9+
# Redmine 5.0-stable: Ruby 2.7, 3.0, 3.1
10+
# Redmine 5.1-stable: Ruby 2.7, 3.0, 3.1, 3.2
11+
# Redmine 6.0-stable: Ruby 3.1, 3.2, 3.3
12+
# Redmine master: Ruby 3.1, 3.2, 3.3
813
strategy:
914
matrix:
1015
db: [sqlite3, mysql, postgres]
11-
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
12-
redmine_version: [5.0-stable, master]
16+
ruby_version: ["3.0", "3.1", "3.2", "3.3"]
17+
redmine_version: [5.0-stable, 5.1-stable, 6.0-stable, master]
1318
exclude:
1419
- ruby_version: "3.2"
1520
redmine_version: 5.0-stable
21+
- ruby_version: "3.3"
22+
redmine_version: 5.0-stable
23+
- ruby_version: "3.3"
24+
redmine_version: 5.1-stable
25+
- ruby_version: "3.0"
26+
redmine_version: 6.0-stable
27+
- ruby_version: "3.0"
28+
redmine_version: master
1629
services:
1730
mysql:
1831
image: mysql:5.7
@@ -38,14 +51,14 @@ jobs:
3851
DB_HOST: ${{ matrix.db }}
3952
REDMINE_VER: ${{ matrix.redmine_version }}
4053
steps:
41-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v4
4255
- name: Install
4356
run: bash -x ./build-scripts/install.sh
4457
- name: Build
4558
run: bash -x ./build-scripts/build.sh
4659
- name: Clean
4760
run: bash -x ./build-scripts/cleanup.sh
48-
- uses: codecov/codecov-action@v2
61+
- uses: codecov/codecov-action@v3
4962
- name: Slack Notification on Failure
5063
uses: rtCamp/[email protected]
5164
if: failure()

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
echo ::set-output name=version::$VERSION
2020
echo ::set-output name=filename::$REPOSITORY-$VERSION
2121
echo ::set-output name=plugin::$REPOSITORY
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
- name: Archive
2424
run: |
2525
cd ..; zip -r ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/ -x "*.git*"; mv ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
coverage
22
Gemfile
33
Gemfile.lock
4+
test/tmp/*

app/controllers/code_review_controller.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Code Review plugin for Redmine
2-
# Copyright (C) 2009-2022 Haruyuki Iida
2+
# Copyright (C) 2009-2023 Haruyuki Iida
33
#
44
# This program is free software; you can redistribute it and/or
55
# modify it under the terms of the GNU General Public License
@@ -16,7 +16,6 @@
1616
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1717

1818
class CodeReviewController < ApplicationController
19-
unloadable
2019
before_action :find_project, :authorize, :find_user, :find_setting, :find_repository, :find_priorities
2120

2221
helper :sort
@@ -115,7 +114,6 @@ def new
115114
@review.save!
116115

117116
render partial: 'add_success', status: 200
118-
return
119117
else
120118
change_id = params[:change_id].to_i unless params[:change_id].blank?
121119
@review.change = Change.find(change_id) if change_id
@@ -138,8 +136,8 @@ def new
138136
break
139137
end
140138
} unless @default_version_id
139+
render partial: 'new_form', status: 200
141140
end
142-
render partial: 'new_form', status: 200
143141
}
144142
rescue ActiveRecord::RecordInvalid => e
145143
logger.error e
@@ -253,7 +251,7 @@ def show
253251
if action_name == 'attachment'
254252
attachment = target.attachment
255253
url = url_for(controller: 'attachments', action: 'show',
256-
id: attachment.id) + '/' + URI.encode(attachment.filename)
254+
id: attachment.id) + '/' + URI.encode_www_form_component(attachment.filename)
257255
url << '?review_id=' + @review.id.to_s if @review
258256
else
259257
path = nil if target.diff_all

app/controllers/code_review_settings_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Code Review plugin for Redmine
2-
# Copyright (C) 2010 Haruyuki Iida
2+
# Copyright (C) 2023 Haruyuki Iida
33
#
44
# This program is free software; you can redistribute it and/or
55
# modify it under the terms of the GNU General Public License
@@ -16,7 +16,6 @@
1616
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1717

1818
class CodeReviewSettingsController < ApplicationController
19-
unloadable
2019
layout 'base'
2120
menu_item :code_review
2221
include CodeReviewAutoAssignSettings

0 commit comments

Comments
 (0)