Skip to content

Commit

Permalink
Merge pull request #3289 from DMPRoadmap/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
benjaminfaure authored Feb 3, 2023
2 parents a803f43 + 27c3c4a commit d95a1a9
Show file tree
Hide file tree
Showing 58 changed files with 2,535 additions and 1,883 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,rb,erb}]
[*.{js,scss,rb,erb}]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 2
32 changes: 32 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Danger

on: [push, pull_request]

jobs:
danger:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
run: |
echo "RUBY_VERSION=`cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
echo "BUNDLER_VERSION=`cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
# Install Ruby - using the version found in the Gemfile.lock
- name: 'Install Ruby'
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}

- name: 'Bundle Install'
run: |
gem install bundler -v ${{ env.BUNDLER_VERSION }}
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without pgsql rollbar aws
- name: 'Run Danger'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

### Added

- Added CHANGELOG.md and Danger Github Action [#3257](https://github.com/DMPRoadmap/roadmap/issues/3257)
- 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)
- Added popover for org profile page and added explanation for public plan
### Fixed

- Froze mail gem version [#3254](https://github.com/DMPRoadmap/roadmap/issues/3254)
- Updated the CSV export so that it now includes research outputs
- Updated sans-serif font used in PDF downloads to Roboto since Google API no longer offers Helvetica
- Fixed discrepencies with default/max per_page values for API and UI pagination
- Updated JS that used to call the TinyMCE `setMode()` function so that it now calls `mode.set()` because the former is now deprecated.
- Patched an issue that was causing a template's visibility to change to 'organizationally_visible' when saving on the template details page.
- Fixed an issue with the Rails 6 keyword arguments change that was causing the `paginable_sort_link` to fail

### Changed

- Added scss files to EditorConfig
- Change csv file name for statistics from 'Completed' to 'Created'
34 changes: 34 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: true

# Make sure non-trivial amounts of code changes come with corresponding tests
has_app_changes = !git.modified_files.grep(/lib/).empty? || !git.modified_files.grep(/app/).empty?
has_test_changes = !git.modified_files.grep(/spec/).empty?

if git.lines_of_code > 50 && has_app_changes && !has_test_changes
warn('There are code changes, but no corresponding tests. ' \
'Please include tests if this PR introduces any modifications in ' \
'behavior. \n
Ignore this warning if the PR ONLY contains translation.io synced updates.',
sticky: false)
end

# Mainly to encourage writing up some reasoning about the PR, rather than
# just leaving a title
warn('Please add a detailed summary in the description.') if github.pr_body.length < 3

# Warn when there is a big PR
warn('This PR is too big! Consider breaking it down into smaller PRs.') if git.lines_of_code > 1000

# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn('PR is classed as Work in Progress') if github.pr_title.include? '[WIP]'

# Let people say that this isn't worth a CHANGELOG entry in the PR if they choose
declared_trivial = (github.pr_title + github.pr_body).include?('#trivial') || !has_app_changes

if !git.modified_files.include?('CHANGELOG.md') && !declared_trivial
failure(
"Please include a CHANGELOG entry. \n
You can find it at [CHANGELOG.md](https://github.com/DMPRoadmap/roadmap/blob/main/CHANGELOG.md).",
sticky: false
)
end
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ gem 'dotenv-rails'

gem 'activerecord_json_validator'

# We need to freeze the mail gem version as the recently released 2.8.0 triggers an exception
# We will need to check if it's fixed when we migrate to Ruby 3.0/3.1
# See : https://github.com/DMPRoadmap/roadmap/issues/3254
gem 'mail', '2.7.1'

# ================================= #
# ENVIRONMENT SPECIFIC DEPENDENCIES #
# ================================= #
Expand Down Expand Up @@ -292,6 +297,9 @@ group :test do
# This gem brings back assigns to your controller tests as well as assert_template
# to both controller and integration tests.
gem 'rails-controller-testing'

# automating code review
gem 'danger', '~> 9.0', require: false
end

group :ci, :development do
Expand Down
Loading

0 comments on commit d95a1a9

Please sign in to comment.