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

feature/APPEALS-34124-43428-29105-28925-33581 - Rails 6.1 Upgrade (and supporting PRs) #22315

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
96d54b1
🔧 Assume defaults for `config.action_dispatch.use_cookies_with_metada…
jcroteau Mar 27, 2024
fc5e7b0
✅ Fix flakey spec
jcroteau Mar 27, 2024
a1eaefd
🔧 Assume default for `config.action_dispatch.use_authenticated_cookie…
jcroteau Mar 28, 2024
c662d25
✨ Add new utility module for adding DB indexes concurrently
jcroteau Apr 4, 2024
df7e3ad
🗑️ Deprecate `Caseflow::Migration`
jcroteau Apr 4, 2024
6fbd3f7
🔧 Add instructive error message for non-concurrent `add_index` migrat…
jcroteau Apr 4, 2024
632cb35
🚨 Address linter / codeclimate complaints
jcroteau Apr 4, 2024
c6219d1
✨ Introduce `SslRedirectExclusionPolicy`
jcroteau Apr 24, 2024
130791a
♻️ Replace deprecated controller-level `force_ssl`
jcroteau Apr 24, 2024
be7a4c7
🔥 Remove SSL redirect exemptions
jcroteau Apr 25, 2024
ea1e133
🔥 Remove deprecated config setting `config.active_record.sqlite3.repr…
jcroteau May 14, 2024
e9ff41d
⬆️ Update `caseflow-commons` to resolve sub-dependency conflicts
jcroteau Jul 3, 2024
85548e2
⬆️ Update rails and other gems as necessary
jcroteau May 14, 2024
116663c
🐛 Fix 'uninitialized constant' error when loading app
jcroteau May 14, 2024
a814438
⬆️ bin/rails app:update - Apply relevant changes
jcroteau May 15, 2024
e87fc5a
🔧 Override default for `config.active_record.has_many_inversing`
jcroteau May 16, 2024
a3ce670
🔧 Assume default for `config.active_storage.track_variants`
jcroteau May 16, 2024
04790fd
🔧 Override default for `config.active_job.retry_jitter`
jcroteau May 28, 2024
5401835
🔧 Assume default for `config.active_job.skip_after_callbacks_if_termi…
jcroteau May 16, 2024
0fcf28b
🔧 Assume default for `config.action_dispatch.cookies_same_site_protec…
jcroteau May 16, 2024
b6381ef
🔧 Assume default for `config.action_controller.urlsafe_csrf_tokens`
jcroteau May 16, 2024
408eb1d
🔧 Assume default for `ActiveSupport.utc_to_local_returns_utc_offset_t…
jcroteau May 16, 2024
7b9e0e1
🔧 Assume default for `config.action_dispatch.ssl_default_redirect_sta…
jcroteau May 16, 2024
7c33f10
🔧 Assume default for `config.active_record.legacy_connection_handling`
jcroteau May 16, 2024
8ae96ff
🔧 Assume default for `config.action_view.form_with_generates_remote_f…
jcroteau May 16, 2024
5d036d0
🔧 Assume default for `config.active_storage.queues.analysis`
jcroteau May 16, 2024
b08aa7f
🔧 Assume default for `config.active_storage.queues.purge`
jcroteau May 16, 2024
5a5d66f
🔧 Assume default for `config.action_mailbox.queues.incineration`
jcroteau May 16, 2024
01a7c41
🔧 Assume default for `config.action_mailbox.queues.routing`
jcroteau May 16, 2024
a2d0243
🔧 Assume default for `config.action_mailer.deliver_later_queue_name`
jcroteau May 16, 2024
5e41632
🔧 Assume default for `config.action_view.preload_links_header`
jcroteau May 16, 2024
8e8c070
🔥 Remove 'new_framework_defaults_6_1.rb'
jcroteau May 16, 2024
cf8a033
🔧 Load defaults for Rails 6.1
jcroteau May 16, 2024
c99784a
♻️ Extract constant
jcroteau May 17, 2024
1a37f4b
♻️ Migrate to new Rails deprecation config where applicable
jcroteau May 17, 2024
63de9e9
♻️ Push members down now that there is only one subclass
jcroteau May 17, 2024
61a2715
🩹 Add forgotten disallowed deprecation warning
jcroteau May 17, 2024
9b9c23d
💡 Update comment
jcroteau May 17, 2024
eeab8e2
✅ Update test to account for change to `ActionDispatch::Response#cont…
jcroteau May 17, 2024
413d84b
🚨 Exclude 'config.ru' from Rubocop cops
jcroteau May 17, 2024
d4cf233
🚚 Move 'db/etl/migrate' to 'db/etl_migrate'
jcroteau Apr 30, 2024
0ecbb04
🚚 Move 'db/etl/schema.rb' to 'db/etl_schema.rb'
jcroteau Apr 30, 2024
6aed240
♻️ Arrange 'database.yml' configs by environment
jcroteau Apr 30, 2024
c843692
🔧 Reformat 'database.yml' to Rails 6+ multi-DB conventions
jcroteau May 9, 2024
e07e636
🔧 Add etl migration paths to DB config
jcroteau May 20, 2024
300399d
🔧 Update DB connection names in 'database_cleaner' config
jcroteau May 20, 2024
8fe0a64
♻️ Use new database-specific rake tasks
jcroteau May 21, 2024
6f45766
➖ Remove 'multiverse' gem
jcroteau May 21, 2024
93c54bc
🗃️ Prohibit execution of vacols DB and non-DB-specific rake tasks
jcroteau May 21, 2024
655f77b
♻️ Create new environment for GH workflow 'Make-docs-to-webpage'
jcroteau May 23, 2024
d0cb506
💚 Remove redundant DB migrations from CI workflow
jcroteau May 23, 2024
a109182
🐛 Fix `spec/mailers/hearing_mailer_spec.rb` - `NoMethodError`
jcroteau May 28, 2024
4c16b29
🐛 Fix `spec/workflows/post_decision_motion_updater_spec.rb` - `Frozen…
jcroteau May 28, 2024
225b777
✅ Add test for `RoSchedulePeriod`
jcroteau May 29, 2024
fcaafba
🐛 Fix `spec/models/schedule_period_spec.rb` - `ActiveRecord::RecordIn…
jcroteau May 29, 2024
7c67094
🐛 Fix `spec/mailers/hearing_mailer_spec.rb` - `ActionView::Template::…
jcroteau May 30, 2024
7812a53
✅ Fix `spec/models/veteran_spec.rb`
jcroteau Jun 5, 2024
27be82c
✅ Fix `spec/sql/ama_cases_sql_spec.rb`
jcroteau Jun 7, 2024
01ee550
✅ Fix multiple specs - `Minitest::UnexpectedError`
jcroteau Jun 7, 2024
fbd7682
✅ Fix `spec/lib/helpers/association_wrapper_spec.rb`
jcroteau Jun 10, 2024
d5fb249
✅ Fix `spec/controllers/api/v1/jobs_controller_spec.rb`
jcroteau Jun 10, 2024
072c6e7
🐛 Fix `spec/controllers/appeals_controller_spec.rb` - `NoMethodError`
jcroteau Jun 10, 2024
9a546f2
🐛 Fix `CaseSearchResultsBase` validations
jcroteau Jun 11, 2024
0062d25
✅ Fix `spec/controllers/application_controller_spec.rb` -- Cache-Cont…
jcroteau Jun 12, 2024
ca6a9d2
🐛 Fix multiple specs - `ActiveRecord::EagerLoadPolymorphicError`
jcroteau Jun 21, 2024
5beba4a
🐛 Fix `spec/models/task_spec.rb` - `update_all` clears query cache
jcroteau Jun 25, 2024
b1fd1fc
🐛 Fix `spec/services/hearings/calendar_service_spec.rb` - template re…
jcroteau Jun 27, 2024
78408b5
🐛 Fix YAML syntax error caused by whitespace in ENV var
jcroteau Jul 9, 2024
e45190a
⬆️ Update `caseflow-commons` dependency to latest ref
jcroteau Jul 26, 2024
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
3 changes: 3 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ plugins:
mass_threshold: 81
exclude_patterns:
- 'db/migrate/*'
- 'db/etl_migrate/*'
- 'app/controllers/idt/api/v2/appeals_controller.rb'
- 'spec/controllers/idt/api/v2/appeals_controller_spec.rb'
- 'spec/controllers/idt/api/appeals_controller_spec.rb'
Expand Down Expand Up @@ -79,6 +80,7 @@ plugins:
enabled: false
exclude_patterns:
- 'db/migrate/*'
- 'db/etl_migrate/*'
- 'app/jobs/dispatch_email_job.rb'
- 'app/mailers/dispatch_mailer.rb'
rubocop:
Expand Down Expand Up @@ -115,6 +117,7 @@ plugins:

exclude_patterns:
- 'db/schema.rb'
- 'db/etl_schema.rb'
- 'db/seeds.rb'
- 'db/scripts/*'
- 'node_modules/**/*'
Expand Down
34 changes: 4 additions & 30 deletions .github/workflows/make-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,50 +40,24 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# Since installing a client to Oracle DB is a pain and setting up the VACOLS DB is not necessary, let's skip it.
- name: Remove references to VACOLS Oracle DB
run: |
sed '/ruby-oci8/d' -i Gemfile
sed '/activerecord-oracle_enhanced-adapter/d' -i Gemfile

# Would like to run `bundle lock --update` to update Gemfile.lock without installing gems (to be done in next step)
# but bundler is not installed yet, so manually modify it:
sed '/ruby-oci8/d' -i Gemfile.lock
sed '/^ activerecord-oracle_enhanced-adapter/,/^ [a-z]/{/^ activerecord-oracle_enhanced-adapter/!{/^ [a-z]/!d}}' -i Gemfile.lock
sed '/activerecord-oracle_enhanced-adapter/d' -i Gemfile.lock
sed '/ruby-plsql/d' -i Gemfile.lock

# Remove VACOLS database configuration
# https://stackoverflow.com/questions/6287755/using-sed-to-delete-all-lines-between-two-matching-patterns
sed '/_vacols:$/,/^$/{/^_vacols:$/!{/^$/!d}}' -i config/database.yml

# Even though it won't be used in this script, Rails expects a 'test_vacols' configuration due to "#{Rails.env}_vacols"
echo '# Copied from demo_vacols configuration
test_vacols:
adapter: postgresql
pool: 1
timeout: 5000
database: test-vacols
' >> config/database.yml

- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup test database
env:
RAILS_ENV: test
RAILS_ENV: make_docs
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
run: |
echo "::group::Set up Caseflow DB"
bin/rails db:create && bin/rails db:schema:load
bin/rails db:create:primary && bin/rails db:schema:load:primary
echo "::endgroup::"

echo "::group::Set up Caseflow ETL DB"
DB=etl bundle exec rake db:create db:schema:load
bundle exec rake db:create:etl db:schema:load:etl
echo "::endgroup::"

# Skipping VACOLS since Oracle DB is not set up
Expand All @@ -95,7 +69,7 @@ jobs:

- name: Create DB schema documentation
env:
RAILS_ENV: test
RAILS_ENV: make_docs
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ jobs:

- name: Database setup
run: |
./ci-bin/capture-log "DB=etl bundle exec rake db:create db:schema:load db:migrate"
./ci-bin/capture-log "bundle exec rake db:create db:schema:load db:migrate"
./ci-bin/capture-log "bundle exec rake db:create:etl db:schema:load:etl"
./ci-bin/capture-log "bundle exec rake db:create:primary db:schema:load:primary"
./ci-bin/capture-log "make -f Makefile.example external-db-create"
# added line to create external table(s) that are needed for tests

Expand Down
2 changes: 1 addition & 1 deletion .reek.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,5 @@ directories:
# Directories and files below will not be scanned at all
exclude_paths:
- db/migrate
- db/etl/migrate
- db/etl_migrate
- spec
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ AllCops:
Exclude:
- 'bin/**/*'
- 'db/**/*'
- 'config.ru'
- 'config/**/*'
- 'script/**/*'
- 'vendor/**/*'
Expand Down
6 changes: 3 additions & 3 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ if git.modified_files.grep(/db\/schema.rb/).any?
warn("This PR changes the schema. Please use the PR template checklist.")
end

if git.modified_files.grep(/db\/etl\/schema.rb/).any?
if git.modified_files.grep(/db\/etl_schema.rb/).any?
warn("This PR changes the etl schema. Please use the PR template checklist.")
end

new_db_migrations = git.modified_files.grep(/db\/migrate\//).any?
new_etl_migrations = git.modified_files.grep(/db\/etl\/migrate\//).any?
new_etl_migrations = git.modified_files.grep(/db\/etl_migrate\//).any?

# migration without migrating
if new_db_migrations && git.modified_files.grep(/db\/schema.rb/).none?
warn("This PR contains db migrations, but the schema.rb is not modified. Did you forget to run 'make migrate'?")
end

if new_etl_migrations && git.modified_files.grep(/db\/etl\/schema.rb/).none?
if new_etl_migrations && git.modified_files.grep(/db\/etl_schema.rb/).none?
warn("This PR contains etl migrations, but the etl schema.rb is not modified. Did you forget to run 'make migrate'?")
end

Expand Down
17 changes: 7 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source ENV["GEM_SERVER_URL"] || "https://rubygems.org"

# State machine
gem "aasm", "4.11.0"
gem "activerecord-import"
gem "activerecord-import", "1.0.3"
gem "acts_as_tree"

# amoeba gem for cloning appeals
Expand All @@ -17,7 +17,7 @@ gem "bgs", git: "https://github.com/department-of-veterans-affairs/ruby-bgs.git"
gem "bootsnap", require: false
gem "browser"
gem "business_time", "~> 0.9.3"
gem "caseflow", git: "https://github.com/department-of-veterans-affairs/caseflow-commons", ref: "716b58caf2116da5fca21c3b3aeea6c9712f3b9d"
gem "caseflow", git: "https://github.com/department-of-veterans-affairs/caseflow-commons", ref: "9bd3635fbd8094d25160669f38d8699e2f1d7a98"
gem "connect_mpi", git: "https://github.com/department-of-veterans-affairs/connect-mpi.git", ref: "a3a58c64f85b980a8b5ea6347430dd73a99ea74c"
gem "connect_vbms", git: "https://github.com/department-of-veterans-affairs/connect_vbms.git", ref: "9807d9c9f0f3e3494a60b6693dc4f455c1e3e922"
gem "console_tree_renderer", git: "https://github.com/department-of-veterans-affairs/console-tree-renderer.git", tag: "v0.1.1"
Expand All @@ -33,9 +33,6 @@ gem "icalendar"
gem "kaminari"
gem "logstasher"
gem "moment_timezone-rails"
# Rails 6 has native support for multiple dbs, so prefer that over multiverse after upgrade.
# https://github.com/ankane/multiverse#upgrading-to-rails-6
gem "multiverse"
gem "newrelic_rpm"
gem "nokogiri", ">= 1.11.0.rc4"
gem "paper_trail", "~> 12.0"
Expand All @@ -56,7 +53,7 @@ gem "pg", platforms: :ruby
# Discussion: https://github.com/18F/college-choice/issues/597#issuecomment-139034834
gem "puma", "5.6.4"
gem "rack", "~> 2.2.6.2"
gem "rails", "6.0.6.1"
gem "rails", "6.1.7.7"
# Used to colorize output for rake tasks
gem "rainbow"
# React
Expand All @@ -80,22 +77,22 @@ gem "stringex", require: false
gem "strong_migrations"
# print trees
gem "tty-tree"
gem "tzinfo", "1.2.10"
gem "tzinfo", "~> 2.0"
# Use Uglifier as compressor for JavaScript assets
gem "uglifier", ">= 1.3.0"
gem "validates_email_format_of"
gem "ziptz"

group :production, :staging, :ssh_forwarding, :development, :test do
# Oracle DB
gem "activerecord-oracle_enhanced-adapter", "~> 6.0.0"
gem "activerecord-oracle_enhanced-adapter", "~> 6.1.0"
gem "ruby-oci8", "~> 2.2"
end

group :test, :development, :demo do
group :test, :development, :demo, :make_docs do
# Security scanners
gem "brakeman"
gem "bullet"
gem "bullet", "~> 6.1.0"
gem "bundler-audit"
# Testing tools
gem "capybara"
Expand Down
Loading
Loading