From 6d99094bac450e5ee89ac6dbd6a87f848ba3da72 Mon Sep 17 00:00:00 2001 From: Jack Ross Date: Wed, 23 Feb 2022 16:16:57 -0500 Subject: [PATCH 1/8] Adding app year 2022 --- app/assets/javascripts/services.js | 2 +- app/models/magi/income.rb | 2 +- config/state_config.json | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/services.js b/app/assets/javascripts/services.js index 4a95dcd1..375bde7c 100644 --- a/app/assets/javascripts/services.js +++ b/app/assets/javascripts/services.js @@ -735,7 +735,7 @@ angular.module('MAGI.services',[]). {abbr: 'WI', name: 'Wisconsin', inApp: true}, {abbr: 'WY', name: 'Wyoming', inApp: true} ]). - constant('applicationYears', [2013,2014,2015,2016,2017,2018,2019,2020,2021]). + constant('applicationYears', [2013,2014,2015,2016,2017,2018,2019,2020,2021,2022]). constant('applicationStatuses', [ {code: "01", name: "Lawful Permanent Resident (LPR/Green Card Holder)", qnc: true, startDate: "Entry date"}, {code: "02", name: "Asylee", qnc: true, startDate: "Asylum grant date"}, diff --git a/app/models/magi/income.rb b/app/models/magi/income.rb index b5b869f6..cfc1d6de 100644 --- a/app/models/magi/income.rb +++ b/app/models/magi/income.rb @@ -4,7 +4,7 @@ module MAGI class Income < Ruleset - input "Application Year", "From application", "Integer", [2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021] + input "Application Year", "From application", "Integer", [2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022] input "Applicant Adult Group Category Indicator", "From MAGI Part I", "Char(1)", %w(Y N) input "Applicant Pregnancy Category Indicator", "From MAGI Part I", "Char(1)", %w(Y N) input "Applicant Parent Caretaker Category Indicator", "From MAGI Part I", "Char(1)", %w(Y N) diff --git a/config/state_config.json b/config/state_config.json index 728d59d5..490a135a 100644 --- a/config/state_config.json +++ b/config/state_config.json @@ -45,6 +45,10 @@ "2021": { "Base FPL": 12880, "FPL Per Person": 4540 + }, + "2022": { + "Base FPL": 13590, + "FPL Per Person": 4720 } }, From a0fa1e5f63db852848a19403a5996d4e3b751721 Mon Sep 17 00:00:00 2001 From: Jack Ross Date: Thu, 24 Feb 2022 15:57:57 -0500 Subject: [PATCH 2/8] Updating local deployment instructions and adding a script to test the local setup --- README.md | 16 ++++++++++++---- local-test.sh | 4 ++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 local-test.sh diff --git a/README.md b/README.md index 6d6b84c6..8f0e5421 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,17 @@ This is provided as a reference implementation and out of the box solution for s A hosted version of this tool is available at https://www.medicaideligibilityapi.org/ +## Updated (Docker) Directions (February 2022) +* `docker compose -p medicaid up --build -V` +* Browse to `localhost:3000` and the site should populate + +### Testing +* Run `sh local-test.sh` + * Stolen from directions below +* Should return something like: `{"Applicant Adult Group Category Indicator":"Y","Adult Group Category Determination Date":"2022-02-24","Adult Group Category Ineligibility Reason":999}` + +## Previous Directions + To run the tool locally, run: ``` bundle install @@ -17,10 +28,7 @@ browse to http://localhost:3000/ To calculate Medicaid eligibility for a group of applications, post the JSON blob for an application to `/determinations/eval` You can also evaluate a specific ruleset on specified inputs/configs. POST the JSON to `http://localhost:3000/rulesets/MAGI/{ruleset}/eval` For example: -``` -~ $ curl -d '{"config": {"Option Adult Group": "Y"}, "inputs":{"Applicant Age": 25, "Applicant Pregnancy Category Indicator": "N", "Medicare Entitlement Indicator": "N"}}' http://0.0.0:3000/rulesets/MAGI/adult_group/eval --header "Content-Type: application/json" -H 'Accept: application/json'; echo -{"Applicant Adult Group Category Indicator":"Y","Adult Group Category Determination Date":"2014-01-17","Adult Group Category Ineligibility Reason":999} -``` +`curl -d '{"config": {"Option Adult Group": "Y"}, "inputs":{"Applicant Age": 25, "Applicant Pregnancy Category Indicator": "N", "Medicare Entitlement Indicator": "N"}}' http://0.0.0:3000/rulesets/MAGI/adult_group/eval --header "Content-Type: application/json" -H 'Accept: application/json'; echo {"Applicant Adult Group Category Indicator":"Y","Adult Group Category Determination Date":"2014-01-17","Adult Group Category Ineligibility Reason":999}` Additional information about how to integrate the project using the API can be found in doc/MitC integration.docx diff --git a/local-test.sh b/local-test.sh new file mode 100644 index 00000000..ffcb0139 --- /dev/null +++ b/local-test.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +curl -d '{"config": {"Option Adult Group": "Y"}, "inputs":{"Applicant Age": 25, "Applicant Pregnancy Category Indicator": "N", "Medicare Entitlement Indicator": "N", "Applicant Dependent Child Covered Indicator": "Y"}}' http://0.0.0:3000/rulesets/MAGI/adult_group/eval --header "Content-Type: application/json" -H 'Accept: application/json' +echo \ No newline at end of file From d8d4db4d341f04af68ff44dc0693b2fb7ecb37ed Mon Sep 17 00:00:00 2001 From: Jack Ross Date: Fri, 1 Apr 2022 16:03:05 -0400 Subject: [PATCH 3/8] Attempting to upgrade Ruby/Rails versions to get working with Heroku --- Dockerfile | 2 +- Gemfile | 6 +- Gemfile.lock | 289 +++++++++++++++++++++++++++++++-------------------- 3 files changed, 180 insertions(+), 117 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d1c35c3..fbca60b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.3 +FROM ruby:2.7.5 RUN apt-get update -qq && apt-get install -y nodejs diff --git a/Gemfile b/Gemfile index 6a544523..a5f5e762 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' -ruby '~> 2.3.0' +ruby '~> 2.7.5' -gem 'rails', '~> 4.0' +gem 'rails', '~> 6' gem 'newrelic_rpm' gem 'rails-api' gem 'activerecord-nulldb-adapter' @@ -30,7 +30,7 @@ group :development, :test do end group :test do - gem 'minitest-rails', '~> 1.0' + gem 'minitest-rails', '~> 6.0' gem 'minitest-reporters' # gem 'mini_backtrace' end diff --git a/Gemfile.lock b/Gemfile.lock index 3f00d75a..84da7afe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,124 +1,177 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.0.13) - actionpack (= 4.0.13) + actioncable (6.1.5) + actionpack (= 6.1.5) + activesupport (= 6.1.5) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.1.5) + actionpack (= 6.1.5) + activejob (= 6.1.5) + activerecord (= 6.1.5) + activestorage (= 6.1.5) + activesupport (= 6.1.5) + mail (>= 2.7.1) + actionmailer (6.1.5) + actionpack (= 6.1.5) + actionview (= 6.1.5) + activejob (= 6.1.5) + activesupport (= 6.1.5) mail (~> 2.5, >= 2.5.4) - actionpack (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) + rails-dom-testing (~> 2.0) + actionpack (6.1.5) + actionview (= 6.1.5) + activesupport (= 6.1.5) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.5) + actionpack (= 6.1.5) + activerecord (= 6.1.5) + activestorage (= 6.1.5) + activesupport (= 6.1.5) + nokogiri (>= 1.8.5) + actionview (6.1.5) + activesupport (= 6.1.5) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) active_model_serializers (0.8.4) activemodel (>= 3.0) - activemodel (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - activerecord (4.0.13) - activemodel (= 4.0.13) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.13) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.4) - activerecord-nulldb-adapter (0.4.0) - activerecord (>= 2.0.0) - activesupport (4.0.13) - i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) + activejob (6.1.5) + activesupport (= 6.1.5) + globalid (>= 0.3.6) + activemodel (6.1.5) + activesupport (= 6.1.5) + activerecord (6.1.5) + activemodel (= 6.1.5) + activesupport (= 6.1.5) + activerecord-nulldb-adapter (0.8.0) + activerecord (>= 5.2.0, < 7.1) + activestorage (6.1.5) + actionpack (= 6.1.5) + activejob (= 6.1.5) + activerecord (= 6.1.5) + activesupport (= 6.1.5) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.5) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) airbrussh (1.4.0) sshkit (>= 1.6.1, != 1.7.0) ansi (1.5.0) - arel (4.0.2) - ast (2.4.0) - brakeman (4.8.2) - builder (3.1.4) - bundler-audit (0.6.1) + ast (2.4.2) + brakeman (5.2.1) + builder (3.2.4) + bundler-audit (0.9.0.1) bundler (>= 1.2.0, < 3) - thor (~> 0.18) - capistrano (3.14.0) + thor (~> 1.0) + capistrano (3.17.0) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) sshkit (>= 1.9.0) - code_analyzer (0.5.1) + code_analyzer (0.5.5) sexp_processor - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.10) + crass (1.0.6) + erubi (1.10.0) erubis (2.7.0) - execjs (2.7.0) - font-awesome-rails (4.7.0.5) - railties (>= 3.2, < 6.1) - gon (6.3.2) + execjs (2.8.1) + font-awesome-rails (4.7.0.8) + railties (>= 3.2, < 8.0) + globalid (1.0.0) + activesupport (>= 5.0) + gon (6.4.0) actionpack (>= 3.0.20) i18n (>= 0.7) multi_json request_store (>= 1.0) - hashie (4.1.0) httparty (0.10.2) multi_json (~> 1.0) multi_xml (>= 0.5.2) - i18n (0.9.5) + i18n (1.10.0) concurrent-ruby (~> 1.0) - jaro_winkler (1.5.4) - jasmine (3.5.1) - jasmine-core (~> 3.5.0) + jasmine (3.99.0) + jasmine-core (= 3.99.0) phantomjs - rack (>= 1.2.1) + rack (>= 2.1.4) rake - jasmine-core (3.5.0) - json (2.3.0) - kgio (2.11.3) + webrick + jasmine-core (3.99.0) + json (2.6.1) + kgio (2.11.4) + loofah (2.16.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - mini_mime (1.0.2) - minitest (4.7.5) - minitest-rails (1.0.1) - minitest (~> 4.7) - minitest-test (~> 1.0) - railties (>= 3.0, < 4.1) - minitest-reporters (0.14.24) + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.15.0) + minitest-rails (6.1.0) + minitest (~> 5.10) + railties (~> 6.1.0) + minitest-reporters (1.5.0) ansi builder - minitest (>= 2.12, < 5.0) - powerbar - minitest-test (1.1.0) - minitest (~> 4.0) - multi_json (1.14.1) + minitest (>= 5.0) + ruby-progressbar + multi_json (1.15.0) multi_xml (0.6.0) net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) - net-ssh (6.0.2) - newrelic_rpm (6.10.0.364) - parallel (1.19.1) - parser (2.7.1.2) - ast (~> 2.4.0) + net-ssh (6.1.0) + newrelic_rpm (8.5.0) + nio4r (2.5.8) + nokogiri (1.13.3-x86_64-linux) + racc (~> 1.4) + parallel (1.22.1) + parser (3.1.1.0) + ast (~> 2.4.1) phantomjs (2.1.1.0) - power_assert (1.2.0) - powerbar (2.0.1) - hashie (>= 1.1.0) - rack (1.5.5) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.0.13) - actionmailer (= 4.0.13) - actionpack (= 4.0.13) - activerecord (= 4.0.13) - activesupport (= 4.0.13) - bundler (>= 1.3.0, < 2.0) - railties (= 4.0.13) - sprockets-rails (~> 2.0) + power_assert (2.0.1) + racc (1.6.0) + rack (2.2.3) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.1.5) + actioncable (= 6.1.5) + actionmailbox (= 6.1.5) + actionmailer (= 6.1.5) + actionpack (= 6.1.5) + actiontext (= 6.1.5) + actionview (= 6.1.5) + activejob (= 6.1.5) + activemodel (= 6.1.5) + activerecord (= 6.1.5) + activestorage (= 6.1.5) + activesupport (= 6.1.5) + bundler (>= 1.15.0) + railties (= 6.1.5) + sprockets-rails (>= 2.0.0) rails-api (0.4.1) actionpack (>= 3.2.11) railties (>= 3.2.11) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.2) + loofah (~> 2.3) rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging - rails_best_practices (1.20.0) + rails_best_practices (1.23.1) activesupport - code_analyzer (>= 0.5.1) + code_analyzer (~> 0.5.5) erubis i18n json @@ -126,51 +179,61 @@ GEM ruby-progressbar rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (4.0.13) - actionpack (= 4.0.13) - activesupport (= 4.0.13) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rainbow (3.0.0) - raindrops (0.19.1) - rake (13.0.1) - request_store (1.5.0) + railties (6.1.5) + actionpack (= 6.1.5) + activesupport (= 6.1.5) + method_source + rake (>= 12.2) + thor (~> 1.0) + rainbow (3.1.1) + raindrops (0.20.0) + rake (13.0.6) + regexp_parser (2.2.1) + request_store (1.5.1) rack (>= 1.4) require_all (3.0.0) - rexml (3.2.4) - rubocop (0.81.0) - jaro_winkler (~> 1.5.1) + rexml (3.2.5) + rubocop (1.26.1) parallel (~> 1.10) - parser (>= 2.7.0.1) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) rexml + rubocop-ast (>= 1.16.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - ruby-progressbar (1.10.1) - sexp_processor (4.14.1) - spring (1.7.2) - sprockets (3.7.2) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.16.0) + parser (>= 3.1.1.0) + ruby-progressbar (1.11.0) + sexp_processor (4.16.0) + spring (4.0.0) + sprockets (4.0.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) - sshkit (1.21.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) - test-unit (3.3.5) + test-unit (3.5.3) power_assert - thor (0.20.3) - thread_safe (0.3.6) - tzinfo (0.3.57) + thor (1.2.1) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) - unicode-display_width (1.7.0) - unicorn (5.5.5) + unicode-display_width (2.1.0) + unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) + webrick (1.7.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.5.4) PLATFORMS ruby @@ -185,10 +248,10 @@ DEPENDENCIES gon httparty (~> 0.10.0) jasmine - minitest-rails (~> 1.0) + minitest-rails (~> 6.0) minitest-reporters newrelic_rpm - rails (~> 4.0) + rails (~> 6) rails-api rails_12factor rails_best_practices @@ -200,7 +263,7 @@ DEPENDENCIES unicorn RUBY VERSION - ruby 2.3.8p459 + ruby 2.7.5p203 BUNDLED WITH - 1.17.3 + 2.1.4 From 5cdf69c9208c0bed940bfd3a6194db3895636a7e Mon Sep 17 00:00:00 2001 From: Jack Ross Date: Fri, 1 Apr 2022 16:23:01 -0400 Subject: [PATCH 4/8] Removing rails-api and dependencies in the test/development groups Adding required manifest.js files and adding required assets --- Gemfile | 18 +----------------- app/assets/config/manifest.js | 2 ++ 2 files changed, 3 insertions(+), 17 deletions(-) create mode 100644 app/assets/config/manifest.js diff --git a/Gemfile b/Gemfile index a5f5e762..fa20ebb2 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ ruby '~> 2.7.5' gem 'rails', '~> 6' gem 'newrelic_rpm' -gem 'rails-api' gem 'activerecord-nulldb-adapter' gem 'active_model_serializers', '~> 0.8.0' gem 'font-awesome-rails' @@ -22,19 +21,4 @@ group :development do gem 'bundler-audit', require: false # Deploy with Capistrano gem 'capistrano' -end - -group :development, :test do - gem 'jasmine' - gem 'spring' -end - -group :test do - gem 'minitest-rails', '~> 6.0' - gem 'minitest-reporters' - # gem 'mini_backtrace' -end - -# fixing a few travisCI complaints -gem 'rake', group: :test -gem 'test-unit' +end \ No newline at end of file diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 00000000..64e5867a --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link application.css +//= link application.js \ No newline at end of file From 2965e1d3395f6e8041ad16080d65e825ff30579a Mon Sep 17 00:00:00 2001 From: Jack Ross Date: Fri, 1 Apr 2022 16:32:14 -0400 Subject: [PATCH 5/8] Switching "before_filter" command which no longer exists to "before_action" as the error recommends... not sure if this breaks anything or has similar functionality --- app/controllers/determinations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/determinations_controller.rb b/app/controllers/determinations_controller.rb index ac47cf6d..2b40f42f 100644 --- a/app/controllers/determinations_controller.rb +++ b/app/controllers/determinations_controller.rb @@ -2,7 +2,7 @@ class DeterminationsController < ApplicationController include ActionController::MimeResponds include ActionController::HttpAuthentication::Token::ControllerMethods - before_filter :restrict_access + before_action :restrict_access @@access_tokens ||= ENV['ACCESS_TOKENS'] ? ENV['ACCESS_TOKENS'].split(';') : [] From b89fec395c68de9b26e8ffa433bc0b614bde850c Mon Sep 17 00:00:00 2001 From: Jack Ross Date: Fri, 1 Apr 2022 16:44:39 -0400 Subject: [PATCH 6/8] Updating Gemfile.lock file after removing test/development dependencies --- Gemfile.lock | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 84da7afe..3c09f673 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,7 +66,6 @@ GEM zeitwerk (~> 2.3) airbrussh (1.4.0) sshkit (>= 1.6.1, != 1.7.0) - ansi (1.5.0) ast (2.4.2) brakeman (5.2.1) builder (3.2.4) @@ -99,13 +98,6 @@ GEM multi_xml (>= 0.5.2) i18n (1.10.0) concurrent-ruby (~> 1.0) - jasmine (3.99.0) - jasmine-core (= 3.99.0) - phantomjs - rack (>= 2.1.4) - rake - webrick - jasmine-core (3.99.0) json (2.6.1) kgio (2.11.4) loofah (2.16.0) @@ -117,14 +109,6 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - minitest-rails (6.1.0) - minitest (~> 5.10) - railties (~> 6.1.0) - minitest-reporters (1.5.0) - ansi - builder - minitest (>= 5.0) - ruby-progressbar multi_json (1.15.0) multi_xml (0.6.0) net-scp (3.0.0) @@ -137,8 +121,6 @@ GEM parallel (1.22.1) parser (3.1.1.0) ast (~> 2.4.1) - phantomjs (2.1.1.0) - power_assert (2.0.1) racc (1.6.0) rack (2.2.3) rack-test (1.1.0) @@ -158,9 +140,6 @@ GEM bundler (>= 1.15.0) railties (= 6.1.5) sprockets-rails (>= 2.0.0) - rails-api (0.4.1) - actionpack (>= 3.2.11) - railties (>= 3.2.11) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) @@ -206,7 +185,6 @@ GEM parser (>= 3.1.1.0) ruby-progressbar (1.11.0) sexp_processor (4.16.0) - spring (4.0.0) sprockets (4.0.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -217,8 +195,6 @@ GEM sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) - test-unit (3.5.3) - power_assert thor (1.2.1) tzinfo (2.0.4) concurrent-ruby (~> 1.0) @@ -229,7 +205,6 @@ GEM unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) - webrick (1.7.0) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -247,18 +222,11 @@ DEPENDENCIES font-awesome-rails gon httparty (~> 0.10.0) - jasmine - minitest-rails (~> 6.0) - minitest-reporters newrelic_rpm rails (~> 6) - rails-api rails_12factor rails_best_practices - rake rubocop - spring - test-unit uglifier (~> 2.7.2) unicorn From 34abd573f658222a234fea0ec9914db43d1eb796 Mon Sep 17 00:00:00 2001 From: Jack Ross Date: Fri, 1 Apr 2022 17:05:20 -0400 Subject: [PATCH 7/8] Attempting to adjust the precompile (for production) as we were getting an error: NoMethodError: undefined method `start_with?' for when trying to push to staging Going off of this comment: https://github.com/rails/sprockets/issues/632#issuecomment-551324428 --- config/environments/production.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index fa5d9615..9f7429ef 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -61,9 +61,7 @@ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # config.assets.precompile += %w( search.js ) - config.assets.precompile = [ Proc.new{ |path| !File.extname(path).in?(['.map','.js', '.css']) }, - /(?:\/|\\|\A)application\.(css|js)$/ ] - + config.assets.precompile = ["*.map", "*.js", "*.css"] config.assets.js_compressor = Uglifier.new(:mangle => false) # Ignore bad email addresses and do not raise email delivery errors. From 0b713ddfdef43bf489e3ae9b462a7425b3b516a0 Mon Sep 17 00:00:00 2001 From: Jack Ross Date: Fri, 1 Apr 2022 17:16:56 -0400 Subject: [PATCH 8/8] Trying to add a configuration for storage based on this comment: https://stackoverflow.com/a/66179690 --- config/storage.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 config/storage.yml diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 00000000..0b723b31 --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket + +# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] \ No newline at end of file