Skip to content

Commit

Permalink
Ruby 3 (#634)
Browse files Browse the repository at this point in the history
* Updated ruby version, updated gems, fixed some deprecations.  Need to fix autoloading constants issue.

* Upgraded gems and some config modification to get app running

* Moves constants out of environment configs and into their own initializer.  Updates capybara.

* Update webdrivers and reconfigured drivers.  Fixed some tests

* Fixed a couple more tests.

* not sure how these tests got some messed up, but they are working now.  I should organize them better and give better context descriptions

* Fixed remaining tests

* upgraded rubocop and the rails and rspec add-ons.  Ran 'safe' autofixer.

* Fixed up rest of auto rubocop fixes.  Generated rubocop todo config.  Fixed up remaining tests.

* Removed some things that weren't needed.  Running CI tests based on whether or not they are in the integration folder.

* Adds back in dependabot config.

* Update README.md

* Adds matrix gem
  • Loading branch information
ajkiessl authored Mar 20, 2023
1 parent 14439ea commit 80bd9df
Show file tree
Hide file tree
Showing 192 changed files with 1,128 additions and 1,108 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
export TAG=${CIRCLE_SHA1}
export GIT_COMMITED_AT=$(git log -1 --date=short --pretty=format:%ct)
PARTNER=graduate docker-compose run --name=test --service-ports -d test
docker exec -e RAILS_ENV=test -e JS=true test /etda_workflow/bin/ci-rspec
docker exec -e RAILS_ENV=test -e INTEGRATION=true test /etda_workflow/bin/ci-rspec
docker cp test:/etda_workflow/coverage/.resultset.json .resultset.json
/tmp/workspace/cc-test-reporter format-coverage -t simplecov -o integration_coverage.json -p /etda_workflow/ .resultset.json
# docker cp test:/app/vendor .
Expand Down
146 changes: 0 additions & 146 deletions .drone.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/gitleaks.yml

This file was deleted.

25 changes: 4 additions & 21 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require: rubocop-rspec
inherit_from: .rubocop_todo.yml

require: [rubocop-rspec, rubocop-rails]

AllCops:
TargetRubyVersion: 3.1
Exclude:
- 'db/**/*'
- 'config/**/*'
Expand All @@ -21,26 +24,6 @@ AllCops:
- 'app/models/submission_status_giver.rb'
- 'spec/models/submission_status_giver_spec.rb'

Rails:
Enabled: true
#
# Include:
# - '**/Rakefile'
# - '**/config.ru'
#
# Exclude:
# - 'db/**/*'
# - 'script/**/*'
# - 'vendor/**/*'
# - 'config/deploy/**/*'
# - 'spec/routing/*'
# - 'bin/*'
# - 'node_modules/**/*'
# - 'webpack.config.js'
# - 'spec/zlib/tasks/legacy/**'
# - 'spec/zlib/tasks/**'
# - 'lib/tasks/**/*'

Layout/LineLength:
Enabled: false

Expand Down
117 changes: 117 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-03-17 20:18:34 UTC using RuboCop version 1.41.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
Capybara/VisibilityMatcher:
Exclude:
- 'spec/integration/admin/manage_submissions_spec.rb'

# Offense count: 17
Lint/MissingSuper:
Enabled: false

# Offense count: 80
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
Naming/VariableNumber:
Enabled: false

# Offense count: 230
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 20

# Offense count: 44
RSpec/RepeatedExampleGroupBody:
Enabled: false

# Offense count: 42
RSpec/RepeatedExampleGroupDescription:
Enabled: false

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationMailer:
Exclude:
- 'app/mailers/workflow_mailer.rb'

# Offense count: 25
# Configuration parameters: EnforcedStyle, AllowToTime.
# SupportedStyles: strict, flexible
Rails/Date:
Exclude:
- 'app/models/approval_configuration.rb'
- 'app/models/committee_member_token.rb'
- 'app/models/semester_release_report_email.rb'
- 'spec/controllers/admin/submissions_controller_spec.rb'
- 'spec/factories/committee_member_tokens.rb'
- 'spec/mailers/workflow_mailer_spec.rb'
- 'spec/models/approval_status_spec.rb'
- 'spec/models/committee_member_token_spec.rb'
- 'spec/models/semester_release_report_email_spec.rb'
- 'spec/models/solr_submission_spec.rb'
- 'spec/models/submission_spec.rb'

# Offense count: 8
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
Rails/FilePath:
Exclude:
- 'app/models/lionpath/lionpath_csv_importer.rb'
- 'app/models/solr_log.rb'
- 'spec/integration/admin/submissions/respond_to_final_submission_spec.rb'
- 'spec/models/lionpath/lionpath_csv_importer_spec.rb'
- 'spec/support/file_utility_helper.rb'

# Offense count: 7
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/committee_role.rb'
- 'app/models/degree.rb'
- 'app/models/degree_type.rb'
- 'app/models/faculty_member.rb'
- 'app/models/program.rb'

# Offense count: 3
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
Exclude:
- 'app/helpers/application_helper.rb'

# Offense count: 34
Rails/OutputSafety:
Exclude:
- 'app/controllers/author/committee_members_controller.rb'
- 'app/controllers/author/submissions_controller.rb'
- 'app/controllers/email_contact_form_controller.rb'
- 'app/models/email_contact_form.rb'
- 'app/presenters/admin/author_view.rb'
- 'app/presenters/admin/submission_form_view.rb'
- 'app/presenters/admin/submission_view.rb'
- 'app/presenters/author/committee_member_view.rb'
- 'app/presenters/author/submission_view.rb'
- 'app/views/admin/submissions/table_bodies/_final_submission_incomplete.json.jbuilder'
- 'app/views/admin/submissions/table_bodies/_format_review_completed.json.jbuilder'
- 'app/views/admin/submissions/table_bodies/_format_review_incomplete.json.jbuilder'

# Offense count: 45
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
Rails/SkipsModelValidations:
Enabled: false

# Offense count: 1
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/UniqueValidationWithoutIndex:
Exclude:
- 'app/models/author.rb'
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.6
3.1.2
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# syntax=docker/dockerfile:experimental
FROM harbor.k8s.libraries.psu.edu/library/ruby-2.7.6-node-12:20230126 as base
FROM harbor.k8s.libraries.psu.edu/library/ruby-3.1.2-node-16:20230306 as base

# hadolint ignore=DL3008
RUN apt-get update && \
RUN apt-get update && \
apt-get install --no-install-recommends libmariadb-dev mariadb-client clamav clamdscan wget libpng-dev make -y && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -13,7 +13,7 @@ WORKDIR /etda_workflow
COPY Gemfile Gemfile.lock /etda_workflow/

RUN useradd -u 10000 etda -d /etda_workflow && \
usermod -G clamav etda && \
usermod -G clamav etda && \
chown -R etda /etda_workflow && \
chmod 777 /etc/clamav

Expand Down Expand Up @@ -44,4 +44,3 @@ RUN bundle install --without development test
RUN PARTNER=graduate RAILS_ENV=production DEVISE_SECRET_KEY=$(bundle exec rails secret) bundle exec rails assets:precompile

CMD ["/etda_workflow/bin/startup"]

Loading

0 comments on commit 80bd9df

Please sign in to comment.