Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protect against nil owner after user merge #3065

Merged
merged 81 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4b92e19
updated rubocop and started editing .rubocop.yml
briri Oct 1, 2021
d7243e2
added rubocop-rails and rubocop-rspec
briri Oct 1, 2021
9b13616
added some additional rubocop helper gems
briri Oct 1, 2021
f6dfc66
added some additional rubocop helper gems
briri Oct 1, 2021
cf7ed3b
added some additional rubocop helper gems
briri Oct 1, 2021
3922375
ran Inspecting 529 files
briri Oct 4, 2021
282774e
Remove the the hardcoded word - DMPRoadmap
martaribeiro Oct 5, 2021
82cd991
Merge pull request #3046 from DMPRoadmap/remove_dmproadmap_from_terms
raycarrick-ed Oct 6, 2021
348414e
Fix views and remove any check on block length
martaribeiro Oct 6, 2021
ad551e0
Translation.io tags missing
martaribeiro Oct 8, 2021
497229a
Merge pull request #3050 from DMPRoadmap/translation_io_small_fixes
briri Oct 11, 2021
d8345f4
Merge pull request #3048 from DMPRoadmap/fix_rubocop_in_views
briri Oct 12, 2021
7a1a026
Merge branch 'master' into rubocop
briri Oct 12, 2021
2b481a1
Issue #629 - (DCC Bug) Fix for "Granting API use rights does not work if
Oct 13, 2021
b09dcf0
Merge branch 'development' into bug_629_granting_API_use_rights_not_w…
briri Oct 13, 2021
7e7e558
Issue #2955 - UserMailer#permissions_change_notification receives in…
Oct 25, 2021
06c65a0
Merge pull request #3052 from DMPRoadmap/bug_2955_usermailer_permissi…
briri Oct 25, 2021
825406a
Merge branch 'development' into bug_629_granting_API_use_rights_not_w…
briri Oct 25, 2021
69f085c
Merge pull request #3047 from DMPRoadmap/bug_629_granting_API_use_rig…
briri Oct 25, 2021
60164b9
Mark some strings for translation.
hbayindir Nov 1, 2021
e6dd4fe
fixed rubocop for helpers
briri Nov 1, 2021
1483c63
fixed rubocop for mailers
briri Nov 1, 2021
d8a6e46
update comment on ccontributor presenter
briri Nov 1, 2021
93e44cd
fixed rubocop for services
briri Nov 1, 2021
198e6ba
fixed rubocop issues for models
briri Nov 1, 2021
34bac40
fixed rubocop for lib
briri Nov 1, 2021
c63cbba
fixed rubocop for specs
briri Nov 1, 2021
6f30ff1
Issue #DCC649 - Fix for the contributor to fail to save on Contributor
Nov 3, 2021
43c5b03
Merge pull request #3060 from DMPRoadmap/bug_dcc_649-contributors_pag…
briri Nov 3, 2021
74e0c2f
finished up rubocop fixes
briri Nov 3, 2021
3feb121
tweaks to changes made for rubocop to fix broken tests
briri Nov 3, 2021
d4e2f6c
fix additional rubocop issues
briri Nov 3, 2021
34d5a80
updated brakeman
briri Nov 3, 2021
b76da31
rubocop fix
briri Nov 3, 2021
7485283
fix for rubocop for feature spec
briri Nov 3, 2021
1759f37
fix for rubocop for feature spec
briri Nov 3, 2021
86a6a6a
try to figure out how host is set for url_helpers in test
briri Nov 3, 2021
ece5a1b
removed StandardError rescue_from in application_controller because i…
briri Nov 3, 2021
9e252de
finished up rubocop changes and fixed broken tests
briri Nov 3, 2021
ab4aa06
updated translation files to use the format instead of
briri Nov 3, 2021
459555e
removed need to use single quotes in app/views
briri Nov 8, 2021
3c63517
protect against nil owner after user merge
raycarrick-ed Nov 16, 2021
632cbb1
use current user rather than form user id which can be spoofed
raycarrick-ed Dec 9, 2021
2d56030
get org creation to follow restrict_orgs
raycarrick-ed Dec 9, 2021
852b416
Merge pull request #3078 from DMPRoadmap/org_creation
briri Dec 9, 2021
88a7115
Merge pull request #3077 from DMPRoadmap/comment_user_fix
briri Dec 9, 2021
3e5a9f3
Fix a typo in the file after text marking.
hbayindir Dec 16, 2021
347b2fd
Merge pull request #3081 from TRUBA-HPC/translation_fixes
briri Dec 17, 2021
b03a24a
Merge branch 'master' into rubocop
raycarrick-ed Jan 12, 2022
d517061
Update org_selectable.rb
raycarrick-ed Jan 12, 2022
9dd79ec
Update MySQL version
raycarrick-ed Jan 25, 2022
ea07fa8
more rubocop fixes
raycarrick-ed Jan 25, 2022
5b4f127
Merge branch 'rubocop' of github.com:DMPRoadmap/roadmap into rubocop
raycarrick-ed Jan 25, 2022
45866c2
Remove --without param
raycarrick-ed Jan 25, 2022
ed7a539
sort ownership
raycarrick-ed Jan 25, 2022
e95b152
Update mysql.yml
raycarrick-ed Jan 25, 2022
de8e7c6
Update mysql.yml
raycarrick-ed Jan 25, 2022
9d009c3
Add apt-get clean
raycarrick-ed Jan 25, 2022
177b934
Explicitly add failing package
raycarrick-ed Jan 25, 2022
2b866d9
minor fix for a rubocop complaint
briri Jan 25, 2022
06e2e62
reverted change to mysql installation in github workflow
briri Jan 25, 2022
747845a
added change back to mysql installation in github workflow
briri Jan 25, 2022
490ded1
Added another package for mysql install in github workflow
briri Jan 25, 2022
8e34bd0
tweak to try and get mysql working in github workflow
briri Jan 25, 2022
f46cc17
Remove mysql install
raycarrick-ed Jan 26, 2022
ce780ce
Merge branch 'master' into rubocop
raycarrick-ed Jan 26, 2022
2109ea3
Try to fix yarn
raycarrick-ed Jan 26, 2022
c467613
added step to capture node version to github workflow
briri Jan 26, 2022
76c1d97
some changes to update our mysql github workflow
briri Jan 26, 2022
119c22a
update gem and js dependencies
briri Jan 26, 2022
2d965e1
trying to update webpacker
briri Jan 26, 2022
fc6db1b
further cleanup of the mysql github workflow
briri Jan 26, 2022
04750bc
further cleanup of the mysql github workflow
briri Jan 26, 2022
f628c3b
final cleanup for mysql github workflow - removed yarn build in favor…
briri Jan 26, 2022
54a0483
github workflow for mysql now working but failure on node post run cl…
briri Jan 26, 2022
b825d5b
updates to other github workflows to use the newer ruby and node builds
briri Jan 26, 2022
9bb023b
fixed an issue with the plan exports controller's policcy check
briri Jan 26, 2022
9a04a68
removed old commented out rules from rubocop config
briri Jan 26, 2022
823ed90
Merge pull request #3045 from DMPRoadmap/rubocop
raycarrick-ed Jan 27, 2022
c582667
protect against nil owner after user merge
raycarrick-ed Nov 16, 2021
1cde223
Merge branch 'protect_nil_owner' of github.com:DMPRoadmap/roadmap int…
raycarrick-ed Jan 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 11 additions & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ jobs:
runs-on: ubuntu-latest

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

# Will run ES Lint checks on javascript files
# Install Node
- uses: actions/setup-node@v2
with:
cache: 'yarn'

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

# Run the ES Lint checks on javascript files
# https://github.com/marketplace/actions/run-eslint
- name: 'ES Lint checks'
uses: stefanoeb/eslint-action@1.0.0
Expand Down
84 changes: 25 additions & 59 deletions .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
mysql:
runs-on: ubuntu-latest

# Define environment variables for MySQL and Rails
env:
DB_ADAPTER: mysql2
MYSQL_PWD: root
Expand All @@ -14,94 +15,59 @@ jobs:
steps:
# Checkout the repo
- uses: actions/checkout@v2
with:
fetch-depth: 1

- name: 'Install MySQL Packages'
run: |
sudo apt-get update
sudo apt-get install -y mysql-client libmysqlclient-dev

- 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 and run bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.3
bundler-cache: true

- name: 'Install Ruby'
uses: actions/setup-ruby@v1
# Install Node
- uses: actions/setup-node@v2
with:
ruby-version: ${{ env.RUBY_VERSION }}
cache: 'yarn'

# Copy all of the example configs over
- name: 'Setup Default Configuration'
run: |
# Make copies of all the example config files
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

# Try to retrieve the gems from the cache
- name: 'Cache Gems'
uses: actions/cache@v2.1.5
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-

- 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

# 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='echo "$(cat config/credentials.yml.example)" >' bundle exec rails credentials:edit

# Try to retrieve the yarn JS dependencies from the cache
- name: 'Cache Yarn Packages'
uses: actions/cache@v2.1.5
with:
path: node_modules/
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-yarn-
${{ runner.os }}-
run: EDITOR='echo "$(cat config/credentials.yml.example)" >' 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
run: yarn install

# Start the DB server and initialize the DB
- name: 'Start MySQL'
run: sudo systemctl start mysql

- name: 'Setup Test DB'
run: bin/rails db:setup RAILS_ENV=test

- name: 'Migrate DB'
run: bin/rails db:migrate RAILS_ENV=test

- name: 'Compile Assets'
run: |
bin/rails webpacker:compile
bin/rails assets:precompile
sudo systemctl start mysql
bin/rails db:setup RAILS_ENV=test
bin/rails db:migrate RAILS_ENV=test

# Prebuild the CSS, JS and image assets
- name: 'Precompile all of the Assets'
run: bin/rails assets:precompile

# Run the JS tests
- name: 'Run Karma Tests'
run: yarn test

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

# Only run Integration tests if the PR or Push is to master or development branches
# Run the time consuming integration tests (using Chrome headless browser)
- name: 'Run Rspec Integration Tests'
run: bin/bundle exec rspec spec/features/
72 changes: 24 additions & 48 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,99 +23,75 @@ jobs:
--health-timeout 5s
--health-retries 5

# Define environment variables for Postgres and Rails
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:@localhost:5432/roadmap_test

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

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

# Install Node
- uses: actions/setup-node@v2
with:
fetch-depth: 1
cache: 'yarn'

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

- 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 }}

# Copy all of the example configs over
- name: 'Setup Default Configuration'
run: |
# Make copies of all the example config files
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

# Try to retrieve the gems from the cache
- name: 'Cache Gems'
uses: actions/cache@v2.1.5
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-

- name: 'Bundle Install'
run: |
gem install bundler -v ${{ env.BUNDLER_VERSION }}
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without mysql rollbar aws

# 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='echo "$(cat config/credentials.yml.example)" >' bundle exec rails credentials:edit

# Try to retrieve the yarn JS dependencies from the cache
- name: 'Cache Yarn Packages'
uses: actions/cache@v2.1.5
with:
path: node_modules/
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-yarn-
${{ runner.os }}-

# 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

# Initialize the DB
- name: 'Setup Test DB'
run: bin/rails db:setup RAILS_ENV=test

- name: 'Migrate DB'
run: bin/rails db:migrate RAILS_ENV=test
run: |
bin/rails db:setup RAILS_ENV=test
bin/rails db:migrate RAILS_ENV=test

# Prebuild the CSS, JS and image assets
- name: 'Compile Assets'
run: |
bin/rails webpacker:compile
bin/rails assets:precompile
run: bin/rails assets:precompile

# Run the JS tests
- name: 'Run Karma Tests'
run: yarn test

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

# Integration Tests are only run if PR or Push is to master or development branches
# Run the time consuming integration tests (using Chrome headless browser)
- name: 'Run Integration Tests'
run: bin/rspec spec/features/
21 changes: 6 additions & 15 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,15 @@ jobs:
runs-on: ubuntu-latest

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

- 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
# Install Ruby and run bundler
- uses: ruby/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
ruby-version: 2.6.3
bundler-cache: true

# Run the Rubocop linter checks
- name: 'Run Rubocop'
run: bin/rubocop
Loading