Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/brakeman.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Brakeman

on:
pull_request:
push:
branches:
master
- main
- next-release/*

jobs:
brakeman:

runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

# Will run Brakeman checks on dependencies
# https://github.com/marketplace/actions/brakeman-action
- name: Brakeman
uses: artplan1/brakeman-action@v1.2.1
with:
flags: "--color"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Will run Brakeman checks on dependencies
# https://github.com/marketplace/actions/brakeman-action
- name: Brakeman
uses: artplan1/brakeman-action@v1.2.1
with:
flags: "--color"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
- name: 'Install Ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}

- name: 'Bundle Install'
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
# Install Ruby and run bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true

# Install Node
Expand Down
171 changes: 85 additions & 86 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tests - PostgreSQL

on: [pull_request]
on: [push, pull_request]

jobs:
postgresql:
Expand All @@ -16,7 +16,7 @@ jobs:
# variable to bypass this changes:
# https://github.com/docker-library/postgres/issues/681
POSTGRES_HOST_AUTH_METHOD: trust
ports: ['5432:5432']
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
Expand All @@ -30,87 +30,86 @@ jobs:
DISABLE_SPRING: 1

steps:
# Checkout the repo
- uses: actions/checkout@v3

# Install Ruby and run bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true

## - run: echo 'NODE_OPTIONS="--openssl-legacy-provider"' >> $GITHUB_ENV
## /home/runner/runners/2.301.1/externals/node12/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

# Install Node
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

# Install the Postgres developer packages
- name: 'Install Postgresql Packages'
run: |
sudo apt-get update
sudo apt-get install libpq-dev

# Install ImageMagick (for `identify` command)
- name: 'Install ImageMagick'
run: |
sudo apt-get install -y imagemagick

# Copy all of the example configs over
- name: 'Setup Default Configuration'
run: |
cp config/database.yml.sample config/database.yml
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
cp .env.postgresql .env

# Stub out the Rails credentials file so that we can start the Rails app
- name: 'Setup Credentials'
run: |
# generate a default credential file and key
EDITOR="sh -c 'echo \"$(cat config/credentials.yml.postgresql)\" > \$1' --" bundle exec rails credentials:edit

# Set the path to the wkhtmltopdf executable
- name: 'Determine wkhtmltopdf location'
run: echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV

# Run yarn install for JS dependencies
- name: 'Yarn Install'
run: |
yarn install

# TEMPORARY WORKAROUND FOR THE FOLLOWING ISSUE: https://github.com/DMPRoadmap/roadmap/issues/3485
# Remove this once our tests are compatible with the new version of Chrome
# Source: https://github.com/teamcapybara/capybara/issues/2800#issuecomment-2731100953
- name: Remove image-bundled Chrome
run: sudo apt-get purge google-chrome-stable
- name: Setup stable Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: 128
install-chromedriver: true
install-dependencies: true

# Initialize the DB
- name: 'Setup Test DB'
run: |
bundle exec rails db:setup
bundle exec rails db:migrate

# Prebuild the CSS, JS and image assets
- name: 'Compile Assets'
run: bundle exec rails assets:precompile

# Run the unit and functional tests
- name: 'Run Rspec Unit and Functional Tests'
run: |
bundle exec rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bundle exec rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bundle exec rspec spec/mixins/

# Run the time consuming integration tests (using Chrome headless browser)
- name: 'Run Integration Tests'
run: bundle exec rspec spec/features/
# Checkout the repo
- uses: actions/checkout@v3

# Install Ruby and run bundler
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

## - run: echo 'NODE_OPTIONS="--openssl-legacy-provider"' >> $GITHUB_ENV
## /home/runner/runners/2.301.1/externals/node12/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

# Install Node
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

# Install the Postgres developer packages
- name: "Install Postgresql Packages"
run: |
sudo apt-get update
sudo apt-get install libpq-dev

# Install ImageMagick (for `identify` command)
- name: "Install ImageMagick"
run: |
sudo apt-get install -y imagemagick

# Copy all of the example configs over
- name: "Setup Default Configuration"
run: |
cp config/database.yml.sample config/database.yml
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
cp .env.postgresql .env

# Stub out the Rails credentials file so that we can start the Rails app
- name: "Setup Credentials"
run: |
# generate a default credential file and key
EDITOR="sh -c 'echo \"$(cat config/credentials.yml.postgresql)\" > \$1' --" bundle exec rails credentials:edit

# Set the path to the wkhtmltopdf executable
- name: "Determine wkhtmltopdf location"
run: echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV

# Run yarn install for JS dependencies
- name: "Yarn Install"
run: |
yarn install

# TEMPORARY WORKAROUND FOR THE FOLLOWING ISSUE: https://github.com/DMPRoadmap/roadmap/issues/3485
# Remove this once our tests are compatible with the new version of Chrome
# Source: https://github.com/teamcapybara/capybara/issues/2800#issuecomment-2731100953
- name: Remove image-bundled Chrome
run: sudo apt-get purge google-chrome-stable
- name: Setup stable Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: 128
install-chromedriver: true
install-dependencies: true

# Initialize the DB
- name: "Setup Test DB"
run: |
bundle exec rails db:setup
bundle exec rails db:migrate

# Prebuild the CSS, JS and image assets
- name: "Compile Assets"
run: bundle exec rails assets:precompile

# Run the unit and functional tests
- name: "Run Rspec Unit and Functional Tests"
run: |
bundle exec rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bundle exec rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bundle exec rspec spec/mixins/

# Run the time consuming integration tests (using Chrome headless browser)
- name: "Run Integration Tests"
run: bundle exec rspec spec/features/
1 change: 0 additions & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
# Install Ruby and run bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true

# Run the Rubocop linter checks
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Ignore rbenv files
.ruby-version

# Ignore bundler config
/.bundle

Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.4
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v5.0.2
- Bump Ruby to v3.1.4 and use `.ruby-version` in CI [#3566](https://github.com/DMPRoadmap/roadmap/pull/3566)
- Enable session timeout after 90 minutes of inactivity [#3568](https://github.com/DMPRoadmap/roadmap/pull/3568)
- Validate CSV Separator [#3569](https://github.com/DMPRoadmap/roadmap/pull/3569)
- Fix rendering of `confirm_merge` partial [#3567](https://github.com/DMPRoadmap/roadmap/pull/3567)
- Improve CI configuration [#3551](https://github.com/DMPRoadmap/roadmap/issues/3551)

## v5.0.1
- Updated seeds.rb file for identifier_schemes to include context value and removed logo_url and idenitifier_prefix for Shibboleth (as it was causing issues with SSO). [#3525](https://github.com/DMPRoadmap/roadmap/pull/3525)
- Adjustments to style of select tags and plan download layout [#3509](https://github.com/DMPRoadmap/roadmap/pull/3509)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

ruby '>= 3.0'
ruby '3.1.4'

# ===========#
# CORE RAILS #
Expand Down
5 changes: 3 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ GEM
faraday (>= 0.8)
faraday-net_http (3.4.0)
net-http (>= 0.5.0)
ffi (1.17.1)
ffi (1.17.1-arm64-darwin)
ffi (1.17.1-x86_64-linux-gnu)
flag_shih_tzu (0.3.23)
fog-aws (3.30.0)
base64 (~> 0.2.0)
Expand Down Expand Up @@ -696,7 +697,7 @@ DEPENDENCIES
yard-tomdoc

RUBY VERSION
ruby 3.0.4p208
ruby 3.1.4p223

BUNDLED WITH
2.4.17
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
## DMP Roadmap

[![Actions Status](https://github.com/DMPRoadmap/roadmap/workflows/Brakeman/badge.svg)](https://github.com/DMPRoadmap/roadmap/actions)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/workflows/Rubocop/badge.svg)](https://github.com/DMPRoadmap/roadmap/actions)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/workflows/ESLint/badge.svg)](https://github.com/DMPRoadmap/roadmap/actions)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/workflows/Tests%20-%20PostgreSQL/badge.svg)](https://github.com/DMPRoadmap/roadmap/actions)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/workflows/Tests%20-%20MySQL/badge.svg)](https://github.com/DMPRoadmap/roadmap/actions)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/actions/workflows/brakeman.yml/badge.svg?branch=main)](https://github.com/DMPRoadmap/roadmap/actions/workflows/brakeman.yml)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/actions/workflows/rubocop.yml/badge.svg?branch=main)](https://github.com/DMPRoadmap/roadmap/actions/workflows/rubocop.yml)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/actions/workflows/eslint.yml/badge.svg?branch=main)](https://github.com/DMPRoadmap/roadmap/actions/workflows/eslint.yml)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/actions/workflows/postgres.yml/badge.svg?branch=main)](https://github.com/DMPRoadmap/roadmap/actions/workflows/postgres.yml)
[![Actions Status](https://github.com/DMPRoadmap/roadmap/actions/workflows/danger.yml/badge.svg?branch=main)](https://github.com/DMPRoadmap/roadmap/actions/workflows/danger.yml)

<!-- [![Actions Status](https://github.com/DMPRoadmap/roadmap/actions/workflows/mysql.yml/badge.svg?branch=main)](https://github.com/DMPRoadmap/roadmap/actions/mysql.yml) -->

DMP Roadmap is a Data Management Planning tool. Management and development of DMP Roadmap is jointly provided by the Digital Curation Centre (DCC), http://www.dcc.ac.uk/, and the University of California Curation Center (UC3), http://www.cdlib.org/services/uc3/.

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/plans_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def show
@default_orgs = Org.default_orgs
@all_ggs_grouped_by_org.each do |org, ggs|
# @default_orgs and already selected guidance groups are important.
if (@default_orgs.include?(org) || (ggs & @selected_guidance_groups).any?) && !@important_ggs.include?([org, ggs])
if (@default_orgs.include?(org) || ggs.intersect?(@selected_guidance_groups)) && !@important_ggs.include?([org,
ggs])
@important_ggs << [org, ggs]
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/super_admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def search
# WHAT TO RETURN!?!?!
if @users.present? # found a user, or Users, submit for merge
render json: {
form: render_to_string(partial: 'super_admin/users/confirm_merge.html.erb')
form: render_to_string(partial: 'confirm_merge')
}
else # NO USER, re-render w/error?
flash.now[:alert] = 'Unable to find user'
Expand Down
9 changes: 7 additions & 2 deletions app/controllers/usage_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,14 @@ def parse_filtered
params[:filtered].present? && params[:filtered] == 'true'
end

# set the csv separator or default to comma
# This sets the csv separator
# Ensures separator is either a comma or a safe separator
def sep_param
params['sep'] || ','
safe_csv_separators = Rails.configuration.x.application.csv_separators
sep = params['sep'].to_s
return sep if safe_csv_separators.include?(sep)

','
end

def min_max_dates(args:)
Expand Down
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class User < ApplicationRecord
# Devise
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
# :lockable and :omniauthable
devise :invitable, :database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable, :omniauthable,
:rememberable, :trackable, :validatable, :omniauthable, :timeoutable,
omniauth_providers: %i[shibboleth orcid]

# default user language to the default language
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
config.timeout_in = 3.hours
config.timeout_in = 90.minutes

# If true, expires auth token on session timeout.
# config.expire_auth_token_on_timeout = false
Expand Down