Skip to content

Commit

Permalink
Merge branch 'master' into liz/add-better-error-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
liztownd authored Nov 26, 2024
2 parents 0779434 + eff3d53 commit 6fb38fe
Show file tree
Hide file tree
Showing 79 changed files with 1,417 additions and 451 deletions.
11 changes: 3 additions & 8 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ app/controllers/v1/sessions_controller.rb @department-of-veterans-affairs/octo-
app/controllers/v1/supplemental_claims_controller.rb @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/backend-review-group
app/controllers/v1/supplemental_claims @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/backend-review-group
app/controllers/v1/post911_gi_bill_statuses_controller.rb @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/govcio-vfep-codereviewers
app/controllers/v2/higher_level_reviews_controller.rb @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/backend-review-group
app/mailers/application_mailer.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/mailers/ch31_submissions_report_mailer.rb @department-of-veterans-affairs/benefits-non-disability @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/mailers/create_daily_spool_files_mailer.rb @department-of-veterans-affairs/my-education-benefits @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -609,7 +610,6 @@ app/sidekiq/account_login_statistics_job.rb @department-of-veterans-affairs/octo
app/sidekiq/benefits_intake_remediation_status_job.rb @department-of-veterans-affairs/platform-va-product-forms @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/sidekiq/benefits_intake_status_job.rb @department-of-veterans-affairs/platform-va-product-forms @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/sidekiq/bgs @department-of-veterans-affairs/benefits-dependents-management @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/sidekiq/central_mail/delete_old_claims.rb @department-of-veterans-affairs/mbs-core-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/sidekiq/central_mail/submit_form4142_job.rb @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/sidekiq/central_mail/submit_central_form686c_job.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/benefits-dependents-management
app/sidekiq/copay_notifications @department-of-veterans-affairs/vsa-debt-resolution @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -1315,21 +1315,16 @@ spec/fixtures/notice_of_disagreements/NOD_show_response_200.json @department-of-
spec/fixtures/notice_of_disagreements/valid_NOD_create_request.json @department-of-veterans-affairs/backend-review-group
spec/fixtures/okta @department-of-veterans-affairs/lighthouse-pivot
spec/fixtures/okta/okta_callback_request_idme_1567760195.json @department-of-veterans-affairs/lighthouse-pivot
spec/fixtures/pdf_fill @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/10-10CG @department-of-veterans-affairs/vfs-10-10 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21-0538 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21-0781 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21-4142 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21-674 @department-of-veterans-affairs/benefits-dependents-management @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21-8940 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21P-0969 @department-of-veterans-affairs/pension-and-burials @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21P-530 @department-of-veterans-affairs/benefits-non-disability @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21P-530V2 @department-of-veterans-affairs/benefits-non-disability @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/26-1880 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/28-1900 @department-of-veterans-affairs/benefits-non-disability @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/28-8832 @department-of-veterans-affairs/benefits-non-disability @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/5655 @department-of-veterans-affairs/vsa-debt-resolution
spec/fixtures/pdf_fill/686C-674 @department-of-veterans-affairs/benefits-dependents-management @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/extras.pdf @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_utilities @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pension @department-of-veterans-affairs/pension-and-burials @department-of-veterans-affairs/backend-review-group
spec/fixtures/preneeds @department-of-veterans-affairs/mbs-core-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand All @@ -1342,7 +1337,6 @@ spec/fixtures/vbms @department-of-veterans-affairs/benefits-dependents-managemen
spec/sidekiq/account_login_statistics_job_spec.rb @department-of-veterans-affairs/octo-identity
spec/sidekiq/benefits_intake_status_job_spec.rb @department-of-veterans-affairs/platform-va-product-forms @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/sidekiq/bgs @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/benefits-dependents-management
spec/sidekiq/central_mail/delete_old_claims_spec.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/sidekiq/central_mail/submit_career_counseling_job_spec.rb @department-of-veterans-affairs/my-education-benefits @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/sidekiq/central_mail/submit_form4142_job_spec.rb @department-of-veterans-affairs/backend-review-group
spec/sidekiq/central_mail/submit_central_form686c_job_spec.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/benefits-dependents-management
Expand Down Expand Up @@ -1735,6 +1729,7 @@ spec/requests/v1/higher_level_reviews_spec.rb @department-of-veterans-affairs/b
spec/requests/v1/notice_of_disagreements_spec.rb @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/benefits-decision-reviews-be
spec/requests/v1/post911_gi_bill_status_spec.rb @department-of-veterans-affairs/govcio-vfep-codereviewers @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/requests/v1/supplemental_claims_spec.rb @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/benefits-decision-reviews-be
spec/requests/v2/higher_level_reviews_spec.rb @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/backend-review-group
spec/controllers/v1/decision_review_evidences_controller_spec.rb @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/backend-review-group
spec/requests/va_profile @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/routing/v0/map_services_routing_spec.rb @department-of-veterans-affairs/octo-identity
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/be_review_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Require backend-review-group approval
on:
pull_request_review:
types: [submitted]
branches:
- master

jobs:
check-approval-requirements:
Expand Down
69 changes: 38 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ GEM
tzinfo
ethon (0.16.0)
ffi (>= 1.15.0)
factory_bot (6.4.5)
factory_bot (6.5.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.3)
factory_bot (~> 6.4)
factory_bot_rails (6.4.4)
factory_bot (~> 6.5)
railties (>= 5.0.0)
faker (3.5.1)
i18n (>= 1.8.11, < 2)
Expand Down Expand Up @@ -475,11 +475,11 @@ GEM
nokogiri (>= 1.11.4)
fitbit_api (1.0.0)
oauth2 (~> 2.0)
flipper (1.3.1)
flipper (1.3.2)
concurrent-ruby (< 2)
flipper-active_record (1.3.1)
activerecord (>= 4.2, < 8)
flipper (~> 1.3.1)
flipper-active_record (1.3.2)
activerecord (>= 4.2, < 9)
flipper (~> 1.3.2)
flipper-active_support_cache_store (1.3.1)
activesupport (>= 4.2, < 8)
flipper (~> 1.3.1)
Expand Down Expand Up @@ -529,6 +529,11 @@ GEM
google-protobuf (4.28.3)
bigdecimal
rake (>= 13)
google-protobuf (4.28.3-java)
bigdecimal
ffi (~> 1)
ffi-compiler (~> 1)
rake (>= 13)
googleauth (1.11.2)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.1)
Expand Down Expand Up @@ -639,7 +644,7 @@ GEM
rake (~> 13.0)
lockbox (2.0.0)
logger (1.6.1)
loofah (2.22.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.2.10)
Expand All @@ -660,15 +665,15 @@ GEM
rake
mini_magick (4.13.2)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.1)
mini_portile2 (2.8.8)
minitest (5.25.2)
mock_redis (0.46.0)
msgpack (1.7.2)
msgpack (1.7.2-java)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.4.1)
mutex_m (0.2.0)
mutex_m (0.3.0)
nap (1.1.0)
nenv (0.3.0)
net-http (0.4.1)
Expand All @@ -685,8 +690,8 @@ GEM
net-smtp (0.5.0)
net-protocol
net-ssh (7.2.0)
nio4r (2.7.3)
nio4r (2.7.3-java)
nio4r (2.7.4)
nio4r (2.7.4-java)
nkf (0.2.0)
nkf (0.2.0-java)
nokogiri (1.16.7)
Expand Down Expand Up @@ -736,7 +741,7 @@ GEM
racc
patience_diff (1.2.0)
optimist (~> 3.0)
pdf-core (0.9.0)
pdf-core (0.10.0)
pdf-forms (1.5.1)
cliver (~> 0.3.2)
rexml (~> 3.2, >= 3.2.6)
Expand All @@ -756,9 +761,10 @@ GEM
activerecord (>= 6.1)
activesupport (>= 6.1)
pkce_challenge (1.0.0)
prawn (2.4.0)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
prawn (2.5.0)
matrix (~> 0.4)
pdf-core (~> 0.10.0)
ttfunk (~> 1.8)
prawn-markup (1.0.0)
nokogiri
prawn
Expand All @@ -776,21 +782,21 @@ GEM
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
pstore (0.1.3)
psych (5.1.2)
psych (5.2.0)
stringio
psych (5.1.2-java)
psych (5.2.0-java)
jar-dependencies (>= 0.1.7)
public_suffix (6.0.1)
puma (6.4.3)
puma (6.5.0)
nio4r (~> 2.0)
puma (6.4.3-java)
puma (6.5.0-java)
nio4r (~> 2.0)
pundit (2.4.0)
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.8.1)
racc (1.8.1-java)
rack (2.2.9)
rack (2.2.10)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
rack-cors (2.0.2)
Expand All @@ -805,7 +811,7 @@ GEM
rack-timeout (0.7.0)
rack-vcr (0.1.6)
vcr (>= 2.9)
rackup (1.0.0)
rackup (1.0.1)
rack (< 3)
webrick
rails (7.1.4.1)
Expand Down Expand Up @@ -849,7 +855,7 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
rchardet (1.8.0)
rdoc (6.7.0)
rdoc (6.8.1)
psych (>= 4.0.0)
redis (5.3.0)
redis-client (>= 0.22.0)
Expand All @@ -858,7 +864,7 @@ GEM
redis-namespace (1.11.0)
redis (>= 4)
regexp_parser (2.9.2)
reline (0.5.10)
reline (0.5.11)
io-console (~> 0.5)
representable (3.2.0)
declarative (< 0.1.0)
Expand Down Expand Up @@ -927,9 +933,9 @@ GEM
json-schema (>= 2.2, < 6.0)
railties (>= 5.2, < 8.0)
rspec-core (>= 2.14)
rswag-ui (2.15.0)
actionpack (>= 5.2, < 8.0)
railties (>= 5.2, < 8.0)
rswag-ui (2.16.0)
actionpack (>= 5.2, < 8.1)
railties (>= 5.2, < 8.1)
rtesseract (3.1.3)
rubocop (1.68.0)
json (~> 2.3)
Expand Down Expand Up @@ -1032,7 +1038,7 @@ GEM
ssrf_filter (1.1.2)
staccato (0.5.3)
statsd-instrument (3.9.7)
stringio (3.1.1)
stringio (3.1.2)
strong_migrations (2.0.2)
activerecord (>= 6.1)
super_diff (0.13.0)
Expand All @@ -1049,7 +1055,8 @@ GEM
timecop (0.9.10)
timeout (0.4.2)
trailblazer-option (0.1.2)
ttfunk (1.7.0)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
Expand Down Expand Up @@ -1107,7 +1114,7 @@ GEM
xmlmapper (0.8.1)
nokogiri (~> 1.11)
yard (0.9.37)
zeitwerk (2.6.18)
zeitwerk (2.7.1)

PLATFORMS
aarch64-linux
Expand Down
43 changes: 20 additions & 23 deletions app/controllers/v0/burial_claims_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@

require 'pension_burial/tag_sentry'
require 'burials/monitor'
require 'common/exceptions/validation_errors'

module V0
class BurialClaimsController < ClaimsBaseController
class BurialClaimsController < ApplicationController
skip_before_action(:authenticate)
before_action :load_user, only: :create

service_tag 'burial-application'

def show
# TODO: update FE to no longer poll for submission, @see Pensions::ClaimsController
claim = claim_class.find_by!(guid: params[:id])
form_submission = claim&.form_submissions&.last
submission_attempt = form_submission&.form_submission_attempts&.last
if submission_attempt
state = submission_attempt.aasm_state == 'failure' ? 'failure' : 'success'
render(json: { data: { attributes: { state: } } })
elsif central_mail_submission
render json: CentralMailSubmissionSerializer.new(central_mail_submission)
end
render json: SavedClaimSerializer.new(claim)
rescue ActiveRecord::RecordNotFound => e
monitor.track_show404(params[:id], current_user, e)
render(json: { data: { attributes: { state: 'not found' } } }, status: :not_found)
render(json: { error: e.to_s }, status: :not_found)
rescue => e
monitor.track_show_error(params[:id], current_user, e)
render(json: { data: { attributes: { state: 'error processing request' } } }, status: :unprocessable_entity)
raise e
end

def create
Expand Down Expand Up @@ -53,15 +49,6 @@ def create
raise e
end

def create_claim
if Flipper.enabled?(:va_burial_v2)
form = filtered_params[:form]
claim_class.new(form:, formV2: form.present? ? JSON.parse(form)['formV2'] : nil)
else
claim_class.new(form: filtered_params[:form])
end
end

private

# an identifier that matches the parameter that the form will be set as in the JSON submission.
Expand All @@ -74,8 +61,13 @@ def claim_class
SavedClaim::Burial
end

def central_mail_submission
CentralMailSubmission.joins(:central_mail_claim).find_by(saved_claims: { guid: params[:id] })
def create_claim
if Flipper.enabled?(:va_burial_v2)
form = filtered_params[:form]
claim_class.new(form:, formV2: form.present? ? JSON.parse(form)['formV2'] : nil)
else
claim_class.new(form: filtered_params[:form])
end
end

def process_and_upload_to_lighthouse(in_progress_form, claim)
Expand All @@ -87,6 +79,11 @@ def process_and_upload_to_lighthouse(in_progress_form, claim)
raise e
end

# Filters out the parameters to form access.
def filtered_params
params.require(short_name.to_sym).permit(:form)
end

##
# include validation error on in_progress_form metadata.
# `noop` if in_progress_form is `blank?`
Expand Down
Loading

0 comments on commit 6fb38fe

Please sign in to comment.