Skip to content

Commit 7d9a1d5

Browse files
authored
Merge pull request #3309 from DMPRoadmap/development
v4.1.0 - release candidate
2 parents 9ead17b + 6dd914a commit 7d9a1d5

File tree

216 files changed

+4794
-8575
lines changed

Some content is hidden

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

216 files changed

+4794
-8575
lines changed

.github/workflows/eslint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- uses: actions/setup-node@v2
1616
with:
1717
cache: 'yarn'
18+
node-version: 16
1819

1920
# Run yarn install for JS dependencies
2021
- name: 'Yarn Install'

.github/workflows/mysql.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ jobs:
1919
# Install Ruby and run bundler
2020
- uses: ruby/setup-ruby@v1
2121
with:
22-
ruby-version: 2.7.6
22+
ruby-version: '3.0'
2323
bundler-cache: true
24-
24+
2525
# Install Node
2626
- uses: actions/setup-node@v3
2727
with:
2828
node-version: '16.6.0'
2929
cache: 'yarn'
30+
node-version: 16
3031

3132
# Copy all of the example configs over
3233
- name: 'Setup the application'

.github/workflows/postgres.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,18 @@ jobs:
3535
# Install Ruby and run bundler
3636
- uses: ruby/setup-ruby@v1
3737
with:
38-
ruby-version: 2.7.6
38+
ruby-version: '3.0'
3939
bundler-cache: true
40-
40+
41+
## - run: echo 'NODE_OPTIONS="--openssl-legacy-provider"' >> $GITHUB_ENV
42+
## /home/runner/runners/2.301.1/externals/node12/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
43+
4144
# Install Node
4245
- uses: actions/setup-node@v3
4346
with:
4447
node-version: '16.6.0'
4548
cache: 'yarn'
49+
node-version: 16
4650

4751
# Install the Postgres developer packages
4852
- name: 'Install Postgresql Packages'

.github/workflows/rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
# Install Ruby and run bundler
1414
- uses: ruby/setup-ruby@v1
1515
with:
16-
ruby-version: 2.7.6
16+
ruby-version: '3.0'
1717
bundler-cache: true
1818

1919
# Run the Rubocop linter checks

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ yarn-debug.log*
112112
/yarn-error.log
113113
yarn-debug.log*
114114
.yarn-integrity
115+
/app/assets/builds/*
116+
!/app/assets/builds/.keep
115117

116118
# Ignore briley AWS cloud9 script to start the application
117-
cloud9-start.sh
119+
cloud9-start.sh

.rubocop.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#
2424
# Try to place any new Cops under their relevant section and in alphabetical order
2525

26+
require:
27+
# - rubocop-rails
28+
# - rubocop-rspec
29+
- rubocop-performance
30+
2631
AllCops:
2732
# Show the name of the cops being voilated in the feedback
2833
DisplayCopNames: true
@@ -104,6 +109,12 @@ Lint/UnexpectedBlockArity: # new in 1.5
104109
Enabled: true
105110
Lint/UnmodifiedReduceAccumulator: # new in 1.1
106111
Enabled: true
112+
Lint/Debugger: # new in 1.45.0
113+
Description: 'Check for debugger calls.'
114+
Enabled: true
115+
Exclude:
116+
- 'lib/tasks/**/*'
117+
107118

108119
# -----------
109120
# - METRICS -

CHANGELOG.md

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,95 @@
11
# Changelog
22

3-
### Added
3+
## v4.1.0
4+
5+
**Note this upgrade is a migration from Ruby v2.7.6 to v3.0.5.** Note that this could have an impact on any customizations you may have made to your fork of this project. Please see https://www.fastruby.io/blog/ruby/upgrades/upgrade-ruby-from-2.7-to-3.0.html for further information on what to check. In particular, please note the changes to the way [Ruby 3 handles keyword arguments](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/)
6+
7+
**Note that the Webpacker gem has been removed in favor of jsbundling-rails.** This was done in preparation for the future migration to Rails 7. See [issue #3185](https://github.com/DMPRoadmap/roadmap/issues/3185) for more details on this change. If, after migrating to this version, you see 'Sprockets' related errors in your application you will need to rebuild you asset library. To do this run `bin/rails assets:clobber && bin/rails assets:precompile` from the project directory.
8+
9+
All gem and JS dependencies were also updated via `bundle update && yarn upgrade`
10+
11+
### Upgrade to Ruby 3
12+
13+
- Upgrade to Ruby version 3.0.5 [#3225](https://github.com/DMPRoadmap/roadmap/issues/3225)
14+
- Bumped all Github actions to use ruby 3.0
15+
- Removed `.freeze` from Regex and Range constants since those types are already immutable
16+
- Fixed Rubocop complaint about redundancy of `r.nil? ? nil : r.user`, so changed it to `r&.user` in `app/models/plan.rb`
17+
- Fixed Rubocop complaint about redundant `::` in config.log_formatter = `::Logger::Formatter.new` in `config/environments/production.rb`
18+
- Froze `lib/deprecators/*.rb` constants that were Strings
19+
- Updated places that were incorrectly using keyword args. See [this article](https://makandracards.com/makandra/496481-changes-to-positional-and-keyword-args-in-ruby-3-0) for an overview
20+
21+
#### Upgraded TinyMCE to v6
22+
23+
- Upgraded TinyMCE to v6 (v5 EOL is April 20 2023)
24+
- Adjusted JS code to conform to new TinyMCE version
25+
- Adjusted views to work with the new version
26+
- Updated variables.scss file to fix issue with button text/background color contrast
27+
- Updated blocks/_tables.scss to fix issue with dropdown menu overlap against table
28+
- updated config/initializers/assets.rb to copy over the tinymce skins and bootstrap glyphicons to the public directory so that they are accessible by TinyMCE and Bootstrap code
29+
30+
#### Removed webpacker gem
31+
32+
As Webpacker is no longer maintained by the Rails community, we have replaced it by `jsbundling-rails` and `cssbundling-rails` for the Javascript & CSS compilation.
33+
34+
- Removed `webpacker` gem
35+
- Added `jsbundling-rails`
36+
- Updated webpack and its configuration to V5
37+
- Moved `app/javascript/packs/application.js` to `app/javascript/application.js`
38+
- Removed `ruby-sass` gem
39+
- Added `cssbundling-rails` gem and DartSass JS library
40+
- Updated SASS stylesheets following the migration to the latest version of the `sass` package (See below).
41+
- Removed `font-awesome-sass` gem and used `@fortawesome/fontawesome-free` npm package
42+
- Issue with `@import 'font-awesome-sprockets';` line in `app/assets/stylesheets/application.scss`. Removed that line after referring to the latest font-awesome install/setup guide which no longer includes it.
43+
44+
With the removal of Webpacker, the Javascript/SASS code is no longer automaticaly compiled when using the `rails server` command. It has been replaced by the `bin/dev` command that launch the rails server and the processes that watch for changes in the SASS and Javascript code.
45+
46+
#### SASS update : removal of the `@import` keyword
447

48+
With the removal of the webpacker gem, the DartSass package has been installed to ensure the compilation of the Sass stylesheet and with it, an update to the Sass version used by the code :
49+
- `@import` keyword for custom stylesheets has been removed (although we can still import stylesheets from externals packages) and has been replaced by `@use` and `@forward`
50+
- An `_index.scss` file have to be created in folders containing multiple sass files. Each file have to be included in the index with the `@use` or `@forward` keyword.
51+
- In most cases `@import` can be replaced by `@use` when importing a file.
52+
- `@forward` makes mixins, functions and variables available when a stylesheet is loaded.
53+
- When imported, Sass variables are now namespaced with the file name in which they are declared (ex : `color: colors.$red`). A namespace can be renamed (ex : `@use "colours" as c;`) or removed when included (ex : `@use "colours" as *;`)
54+
- Sass variables are no longer declared globally and have to be included in files where they are used.
55+
For more detailed explanation, please refer to this video : https://www.youtube.com/watch?v=CR-a8upNjJ0
56+
57+
### Introduction of RackAttack
58+
[Rack Attack](https://github.com/rack/rack-attack) is middleware that can be used to help protect the application from malicious activity. You can establish white/black lists for specific IP addresses and also define rate limits.
59+
60+
- Using Rack-attack address vulnerabilities pointed out in password reset and login: there was no request rate limit.[#3214](https://github.com/DMPRoadmap/roadmap/issues/3214)
61+
62+
### Cleanup of Capybara configuration
63+
- Cleaned up Gemfile by:
64+
- removing gems that were already commented out
65+
- removed selenium-webdriver and capybara-webmock
66+
- removing version restrictions on: danger, font-awesome-sass, webdrivers
67+
- Cleaned up `spec/rails_helper.rb` and `spec/spec_helper.rb`
68+
- Simplified the `spec/support/capybara.rb` helper to work with the latest version of Capybara and use its built in headless Chrome driver
69+
70+
### Rubocop updates
71+
- Installed rubocop-performance gem and made suggested changes
72+
- Added lib tasks as exclusive from debugger rubocop check after rubocop upgrading to >= v1.45 [#3291](https://github.com/DMPRoadmap/roadmap/issues/3291)
73+
74+
### GitHub actions updates
75+
- Added node version specification (v16) to eslint, PostgreSQL and MySQL github action to eliminate `digital routine enveloped` error [#319](https://github.com/portagenetwork/roadmap/issues/319)
76+
77+
### Enhancements
78+
- Added enum to the funding status attribute of plan model to make the dropdown of 'funding status' being translatable
79+
- Allow users to download both single phase and in PDF, TEXT and DOCX format. CSV file can only download single phase instead of all phases.
80+
81+
### Bug Fixes
82+
83+
## v4.0.2
84+
85+
### Added
586
- Added CHANGELOG.md and Danger Github Action [#3257](https://github.com/DMPRoadmap/roadmap/issues/3257)
687
- Added validation with custom error message in research_output.rb to ensure a user does not enter a very large value as 'Anticipated file size'. [#3161](https://github.com/DMPRoadmap/roadmap/issues/3161)
788
- Added popover for org profile page and added explanation for public plan
889

9-
### Fixed
90+
- Added rack-attack version 6.6.1 gem. https://rubygems.org/gems/rack-attack/versions/6.6.1
1091

92+
### Fixed
1193
- Fixed an issue that was preventing uses from leaving the research output byte_size field blank
1294
- Patched issue that was causing template visibility to default to organizationally visible after saving
1395
- Froze mail gem version [#3254](https://github.com/DMPRoadmap/roadmap/issues/3254)

Gemfile

Lines changed: 15 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source 'https://rubygems.org'
44

5-
ruby '>= 2.7'
5+
ruby '>= 3.0'
66

77
# ===========#
88
# CORE RAILS #
@@ -17,19 +17,16 @@ gem 'rails', '~> 6.1'
1717
# Analysis of the issue: https://www.theregister.com/2021/03/25/ruby_rails_code/
1818
gem 'mimemagic'
1919

20-
# Use sqlite3 as the database for Active Record
21-
# gem 'sqlite3', '~> 1.4'
22-
2320
# Use Puma as the app server
2421
gem 'puma', group: :puma, require: false
2522

26-
# Use SCSS for stylesheets
27-
# TODO : might need to move to cssbundling-rails
28-
# SEE: https://dev.to/kolide/how-to-migrate-a-rails-6-app-from-sass-rails-to-cssbundling-rails-4l41
29-
gem 'sass-rails'
23+
# Use esbuild, rollup.js, or Webpack to bundle your JavaScript, then deliver it via the asset pipeline in Rails
24+
# Read more: https://github.com/rails/jsbundling-rails
25+
gem 'jsbundling-rails'
3026

31-
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
32-
gem 'webpacker'
27+
# Use Tailwind CSS, Bootstrap, Bulma, PostCSS, or Dart Sass to bundle and process your CSS
28+
# Read more: https://github.com/rails/cssbundling-rails
29+
gem 'cssbundling-rails'
3330

3431
# Turbo gives you the speed of a single-page web application without having to write any JavaScript..
3532
# Read more: https://github.com/hotwired/turbo-rails
@@ -50,14 +47,6 @@ gem 'jbuilder'
5047
# Reduces boot times through caching; required in config/boot.rb
5148
gem 'bootsnap', require: false
5249

53-
# GEMS ADDED TO HELP HANDLE RAILS MIGRATION FROM 3.x to 4.2
54-
# THESE GEMS HELP SUPPORT DEPRACATED FUNCTIONALITY AND WILL LOSE SUPPORT IN
55-
# FUTURE VERSIONS WE SHOULD CONSIDER BRINGING THE CODE UP TO DATE INSTEAD
56-
57-
# A set of Rails responders to dry up your application
58-
# (http://github.com/plataformatec/responders)
59-
# gem "responders"
60-
6150
# ============== #
6251
# ERROR HANDLING #
6352
# ============== #
@@ -119,6 +108,9 @@ gem 'jwt'
119108
# OO authorization for Rails (https://github.com/elabs/pundit)
120109
gem 'pundit'
121110

111+
# Gem for throttling malicious attacks
112+
gem 'rack-attack', '~> 6.6', '>= 6.6.1'
113+
122114
# ========== #
123115
# UI / VIEWS #
124116
# ========== #
@@ -161,23 +153,10 @@ gem 'api-pagination'
161153
# STYLESHEETS #
162154
# =========== #
163155

164-
# Integrate SassC-Ruby into Rails. (https://github.com/sass/sassc-rails)
165-
gem 'sassc-rails'
166-
167-
# Font-Awesome SASS (https://github.com/FortAwesome/font-awesome-sass)
168-
gem 'font-awesome-sass', '~> 5'
169-
170-
# Use webpack to manage app-like JavaScript modules in Rails
171-
# (https://github.com/rails/webpacker)
172-
# gem "webpacker"
173-
174156
# Parse CSS and add vendor prefixes to CSS rules using values from the Can
175157
# I Use website. (https://github.com/ai/autoprefixer-rails)
176158
gem 'autoprefixer-rails'
177159

178-
# Minimal embedded v8 for Ruby (https://github.com/discourse/mini_racer)
179-
# gem "mini_racer"
180-
181160
# ========= #
182161
# EXPORTING #
183162
# ========= #
@@ -250,18 +229,10 @@ group :test do
250229
# Guard keeps an eye on your file modifications (https://github.com/guard/guard)
251230
gem 'guard'
252231

253-
# Guard gem for RSpec (https://github.com/guard/guard-rspec)
254-
# gem 'guard-rspec'
255-
256232
# Library for stubbing HTTP requests in Ruby.
257233
# (http://github.com/bblimke/webmock)
258234
gem 'webmock'
259235

260-
# Code coverage for Ruby 1.9+ with a powerful configuration library and
261-
# automatic merging of coverage across test suites
262-
# (http://github.com/colszowka/simplecov)
263-
# gem 'simplecov', require: false
264-
265236
# Strategies for cleaning databases. Can be used to ensure a clean state
266237
# for testing. (http://github.com/DatabaseCleaner/database_cleaner)
267238
gem 'database_cleaner', require: false
@@ -275,17 +246,9 @@ group :test do
275246

276247
# Adds support for Capybara system testing and selenium driver
277248
gem 'capybara'
278-
gem 'selenium-webdriver'
279-
# Easy installation and use of web drivers to run system tests with browsers
280-
gem 'webdrivers', '~> 5.2'
281249

282-
# Automatically create snapshots when Cucumber steps fail with Capybara
283-
# and Rails (http://github.com/mattheworiordan/capybara-screenshot)
284-
# gem 'capybara-screenshot'
285-
286-
# Browser integration tests are expensive. We can mock external requests
287-
# in our tests, but once a browser is involved, we lose control.
288-
gem 'capybara-webmock'
250+
# Easy installation and use of web drivers to run system tests with browsers
251+
gem 'webdrivers'
289252

290253
# RSpec::CollectionMatchers lets you express expected outcomes on
291254
# collections of an object in an example.
@@ -299,7 +262,7 @@ group :test do
299262
gem 'rails-controller-testing'
300263

301264
# automating code review
302-
gem 'danger', '~> 9.0', require: false
265+
gem 'danger'
303266
end
304267

305268
group :ci, :development do
@@ -319,23 +282,8 @@ group :ci, :development do
319282
# (gettext and rails-i18n)
320283
gem 'rubocop-i18n'
321284

322-
# A collection of RuboCop cops to check for performance optimizations in Ruby code.
323-
# gem 'rubocop-performance'
324-
325-
# Automatic Rails code style checking tool. A RuboCop extension focused on enforcing
326-
# Rails best practices and coding conventions.
327-
# gem 'rubocop-rails'
328-
329-
# A RuboCop plugin for Rake tasks
330-
# gem 'rubocop-rake'
331-
332-
# Code style checking for RSpec files. A plugin for the RuboCop code style enforcing
333-
# & linting tool.
334-
# gem 'rubocop-rspec'
335-
336-
# Thread-safety checks via static analysis. A plugin for the RuboCop code style
337-
# enforcing & linting tool.
338-
# gem 'rubocop-thread_safety'
285+
# Performance checks by Rubocop
286+
gem 'rubocop-performance', require: false
339287
end
340288

341289
group :development do

0 commit comments

Comments
 (0)