Skip to content

Commit d95a1a9

Browse files
Merge pull request #3289 from DMPRoadmap/development
Development
2 parents a803f43 + 27c3c4a commit d95a1a9

File tree

58 files changed

+2535
-1883
lines changed

Some content is hidden

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

58 files changed

+2535
-1883
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ insert_final_newline = true
1111

1212
# Matches multiple files with brace expansion notation
1313
# Set default charset
14-
[*.{js,rb,erb}]
14+
[*.{js,scss,rb,erb}]
1515
charset = utf-8
1616
indent_style = space
17-
indent_size = 2
17+
indent_size = 2

.github/workflows/danger.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Danger
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
danger:
7+
runs-on: ubuntu-20.04
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
13+
run: |
14+
echo "RUBY_VERSION=`cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
15+
echo "BUNDLER_VERSION=`cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
16+
17+
# Install Ruby - using the version found in the Gemfile.lock
18+
- name: 'Install Ruby'
19+
uses: actions/setup-ruby@v1
20+
with:
21+
ruby-version: ${{ env.RUBY_VERSION }}
22+
23+
- name: 'Bundle Install'
24+
run: |
25+
gem install bundler -v ${{ env.BUNDLER_VERSION }}
26+
bundle config path vendor/bundle
27+
bundle install --jobs 4 --retry 3 --without pgsql rollbar aws
28+
29+
- name: 'Run Danger'
30+
env:
31+
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: bundle exec danger

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changelog
2+
3+
### Added
4+
5+
- Added CHANGELOG.md and Danger Github Action [#3257](https://github.com/DMPRoadmap/roadmap/issues/3257)
6+
- 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)
7+
- Added popover for org profile page and added explanation for public plan
8+
### Fixed
9+
10+
- Froze mail gem version [#3254](https://github.com/DMPRoadmap/roadmap/issues/3254)
11+
- Updated the CSV export so that it now includes research outputs
12+
- Updated sans-serif font used in PDF downloads to Roboto since Google API no longer offers Helvetica
13+
- Fixed discrepencies with default/max per_page values for API and UI pagination
14+
- Updated JS that used to call the TinyMCE `setMode()` function so that it now calls `mode.set()` because the former is now deprecated.
15+
- Patched an issue that was causing a template's visibility to change to 'organizationally_visible' when saving on the template details page.
16+
- Fixed an issue with the Rails 6 keyword arguments change that was causing the `paginable_sort_link` to fail
17+
18+
### Changed
19+
20+
- Added scss files to EditorConfig
21+
- Change csv file name for statistics from 'Completed' to 'Created'

Dangerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# frozen_string_literal: true
2+
3+
# Make sure non-trivial amounts of code changes come with corresponding tests
4+
has_app_changes = !git.modified_files.grep(/lib/).empty? || !git.modified_files.grep(/app/).empty?
5+
has_test_changes = !git.modified_files.grep(/spec/).empty?
6+
7+
if git.lines_of_code > 50 && has_app_changes && !has_test_changes
8+
warn('There are code changes, but no corresponding tests. ' \
9+
'Please include tests if this PR introduces any modifications in ' \
10+
'behavior. \n
11+
Ignore this warning if the PR ONLY contains translation.io synced updates.',
12+
sticky: false)
13+
end
14+
15+
# Mainly to encourage writing up some reasoning about the PR, rather than
16+
# just leaving a title
17+
warn('Please add a detailed summary in the description.') if github.pr_body.length < 3
18+
19+
# Warn when there is a big PR
20+
warn('This PR is too big! Consider breaking it down into smaller PRs.') if git.lines_of_code > 1000
21+
22+
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
23+
warn('PR is classed as Work in Progress') if github.pr_title.include? '[WIP]'
24+
25+
# Let people say that this isn't worth a CHANGELOG entry in the PR if they choose
26+
declared_trivial = (github.pr_title + github.pr_body).include?('#trivial') || !has_app_changes
27+
28+
if !git.modified_files.include?('CHANGELOG.md') && !declared_trivial
29+
failure(
30+
"Please include a CHANGELOG entry. \n
31+
You can find it at [CHANGELOG.md](https://github.com/DMPRoadmap/roadmap/blob/main/CHANGELOG.md).",
32+
sticky: false
33+
)
34+
end

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ gem 'dotenv-rails'
218218

219219
gem 'activerecord_json_validator'
220220

221+
# We need to freeze the mail gem version as the recently released 2.8.0 triggers an exception
222+
# We will need to check if it's fixed when we migrate to Ruby 3.0/3.1
223+
# See : https://github.com/DMPRoadmap/roadmap/issues/3254
224+
gem 'mail', '2.7.1'
225+
221226
# ================================= #
222227
# ENVIRONMENT SPECIFIC DEPENDENCIES #
223228
# ================================= #
@@ -292,6 +297,9 @@ group :test do
292297
# This gem brings back assigns to your controller tests as well as assert_template
293298
# to both controller and integration tests.
294299
gem 'rails-controller-testing'
300+
301+
# automating code review
302+
gem 'danger', '~> 9.0', require: false
295303
end
296304

297305
group :ci, :development do

0 commit comments

Comments
 (0)