Skip to content

Commit

Permalink
Merge branch 'master' into sjc-pil-encryption-p2
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjcumming authored Apr 16, 2024
2 parents 362b830 + 9f5164e commit 3c9437b
Show file tree
Hide file tree
Showing 175 changed files with 2,281 additions and 1,644 deletions.
10 changes: 7 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ app/controllers/v0/appeals_controller.rb @department-of-veterans-affairs/benefit
app/controllers/v0/appointments_controller.rb @department-of-veterans-affairs/vfs-vaos @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v0/apps_controller.rb @department-of-veterans-affairs/lighthouse-pivot
app/controllers/v0/ask_va @department-of-veterans-affairs/ask-va-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v0/average_days_for_claim_completion_controller.rb @department-of-veterans-affairs/benefits-microservices @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v0/backend_statuses_controller.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v0/benefits_claims_controller.rb @department-of-veterans-affairs/benefits-management-tools-be @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v0/benefits_documents_controller.rb @department-of-veterans-affairs/benefits-management-tools-be @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -194,6 +195,7 @@ app/models/async_transaction/base.rb @department-of-veterans-affairs/vfs-authent
app/models/async_transaction/va_profile @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/backend-review-group
app/models/async_transaction/vet360 @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/backend-review-group
app/models/attachment.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/models/average_days_for_claim_completion.rb @department-of-veterans-affairs/benefits-microservices @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/models/backend_status.rb @department-of-veterans-affairs/backend-review-group
app/models/bank_name.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/models/base_facility.rb @department-of-veterans-affairs/vfs-facilities-frontend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -976,7 +978,6 @@ rakelib/mockdata_synchronize.rake @department-of-veterans-affairs/octo-identity
rakelib/pension_burial.rake @department-of-veterans-affairs/mbs-core-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
rakelib/piilog_repl @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/va-api-engineers
rakelib/prod @department-of-veterans-affairs/vfs-vaos @department-of-veterans-affairs/backend-review-group @department-of-veterans-affairs/va-api-engineers
rakelib/prod/user_credential.rake @department-of-veterans-affairs/octo-identity
rakelib/remove_va1995s_records.rake @department-of-veterans-affairs/govcio-vfep-codereviewers @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
rakelib/routes_csv.rake @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
rakelib/rswag.rake @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand All @@ -996,6 +997,7 @@ spec/controllers/sign_in @department-of-veterans-affairs/octo-identity
spec/controllers/v0/account_controls_controller_spec.rb @department-of-veterans-affairs/octo-identity
spec/controllers/v0/apps_controller_spec.rb @department-of-veterans-affairs/lighthouse-pivot
spec/controllers/v0/ask_va @department-of-veterans-affairs/ask-va-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/average_days_for_claim_completion_controller_spec.rb @department-of-veterans-affairs/benefits-microservices @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/benefits_claims_controller_spec.rb @department-of-veterans-affairs/benefits-management-tools-be @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/benefits_reference_data_controller_spec.rb @department-of-veterans-affairs/Benefits-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/burial_claims_controller_spec.rb @department-of-veterans-affairs/mbs-core-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -1190,6 +1192,7 @@ spec/fixtures/pdf_fill/21-674 @department-of-veterans-affairs/Benefits-Team-1 @d
spec/fixtures/pdf_fill/21-8940 @department-of-veterans-affairs/Benefits-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21P-527EZ @department-of-veterans-affairs/pensions @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/21P-530 @department-of-veterans-affairs/Benefits-Team-1 @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-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/fixtures/pdf_fill/26-1880 @department-of-veterans-affairs/Benefits-Team-1 @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-Team-1 @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-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -1485,6 +1488,7 @@ spec/rakelib/form526_spec.rb @department-of-veterans-affairs/Benefits-Team-1 @de
spec/rakelib/piilog_repl @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/rakelib/piilog_repl/piilog_helpers_spec.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/rakelib/vet360_spec.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
rakelib/prod/user_credential.rake @department-of-veterans-affairs/octo-identity
spec/requests/admin_spec.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/requests/appeals_request_spec.rb @department-of-veterans-affairs/backend-review-group
spec/requests/appointments_request_spec.rb @department-of-veterans-affairs/vfs-vaos @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -1798,7 +1802,7 @@ spec/support/vcr_cassettes/bgs @department-of-veterans-affairs/benefits-dependen
spec/support/vcr_cassettes/bgs/claims @department-of-veterans-affairs/Benefits-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/bgs/benefit_claim @department-of-veterans-affairs/benefits-management-tools-be @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/bid @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/brd @department-of-veterans-affairs/lighthouse-dash @department-of-veterans-affairs/dbex-trex @department-of-veterans-affairs/Disability-Experience
spec/support/vcr_cassettes/brd @department-of-veterans-affairs/dbex-trex @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/carma @department-of-veterans-affairs/vfs-10-10 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/central_mail @department-of-veterans-affairs/lighthouse-banana-peels @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/caseflow @department-of-veterans-affairs/lighthouse-banana-peels @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -1876,7 +1880,7 @@ spec/support/vcr_cassettes/slack/slack_bot_notify.yml @department-of-veterans-af
spec/support/vcr_cassettes/sm_client @department-of-veterans-affairs/vfs-mhv-secure-messaging @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/spec/support @department-of-veterans-affairs/octo-identity
spec/support/vcr_cassettes/staccato @department-of-veterans-affairs/vfs-10-10 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/token_validation @department-of-veterans-affairs/lighthouse-dash @department-of-veterans-affairs/lighthouse-banana-peels @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/token_validation @department-of-veterans-affairs/lighthouse-banana-peels @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/spupport/vcr_cassettes/user/get_facilities_empty.yml @department-of-veterans-affairs/vfs-facilities-frontend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/va_forms @department-of-veterans-affairs/platform-va-product-forms @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/support/vcr_cassettes/va_notify @department-of-veterans-affairs/va-notify-write @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/check_codeowners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ HEAD_SHA=$(git rev-parse HEAD)
BASE_SHA=$(git rev-parse origin/master)

# Get the list of changed files between the base and head commits
IFS=$'\n' # Change IFS to split only on newlines
CHANGED_FILES=$(git diff --name-only --diff-filter=AMR ${BASE_SHA}...${HEAD_SHA})
echo "Changed files: $CHANGED_FILES"

Expand All @@ -37,7 +38,7 @@ check_in_codeowners() {
return 1
}

for FILE in "${CHANGED_FILES}"; do
for FILE in ${CHANGED_FILES}; do
# Ignore files starting with a dot
if [[ $FILE == .* ]]; then
echo "Ignoring file $FILE"
Expand All @@ -53,3 +54,4 @@ for FILE in "${CHANGED_FILES}"; do
done

echo "All changed files or their parent directories have a CODEOWNERS entry."
IFS=$' \t\n' # Reset IFS after the loop
2 changes: 2 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'ostruct'

module VSPDanger
HEAD_SHA = `git rev-parse --abbrev-ref HEAD`.chomp.freeze
BASE_SHA = 'origin/master'
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ GEM
attr_extras (7.1.0)
awesome_print (1.9.2)
aws-eventstream (1.3.0)
aws-partitions (1.903.0)
aws-sdk-core (3.191.5)
aws-partitions (1.913.0)
aws-sdk-core (3.191.6)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.78.0)
aws-sdk-kms (1.79.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.146.1)
Expand Down Expand Up @@ -474,7 +474,7 @@ GEM
rack (>= 1.4, < 4)
rack-protection (>= 1.5.3, <= 4.0.0)
sanitize (< 7)
foreman (0.87.2)
foreman (0.88.1)
formatador (1.1.0)
fugit (1.9.0)
et-orbi (~> 1, >= 1.2.7)
Expand Down Expand Up @@ -952,7 +952,7 @@ GEM
rake (>= 10.0)
semantic_logger (4.15.0)
concurrent-ruby (~> 1.0)
sentry-ruby (5.17.2)
sentry-ruby (5.17.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
shellany (0.0.1)
Expand Down
15 changes: 15 additions & 0 deletions app/controllers/v0/average_days_for_claim_completion_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module V0
class AverageDaysForClaimCompletionController < ApplicationController
service_tag 'average-days-to-completion'
skip_before_action :authenticate, only: :index

def index
rtn = AverageDaysForClaimCompletion.order('created_at DESC').first
render json: {
average_days: rtn.present? ? rtn.average_days : -1.0
}
end
end
end
36 changes: 24 additions & 12 deletions app/controllers/v0/health_care_applications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'hca/service'
require 'bgs/service'
require 'pdf_fill/filler'
require 'lighthouse/facilities/v1/client'

module V0
class HealthCareApplicationsController < ApplicationController
Expand All @@ -11,7 +12,7 @@ class HealthCareApplicationsController < ApplicationController
service_tag 'healthcare-application'
FORM_ID = '1010ez'

skip_before_action(:authenticate, only: %i[create show enrollment_status healthcheck download_pdf])
skip_before_action(:authenticate, only: %i[create show enrollment_status healthcheck facilities])

before_action :record_submission_attempt, only: :create
before_action :load_user, only: %i[create enrollment_status]
Expand Down Expand Up @@ -68,12 +69,8 @@ def healthcheck
render(json: HCA::Service.new.health_check)
end

def download_pdf
source_file_path = PdfFill::Filler.fill_form(health_care_application, SecureRandom.uuid, sign: false)
file_contents = File.read(source_file_path)
File.delete(source_file_path)

send_data file_contents, filename: file_name_for_pdf, type: 'application/pdf', disposition: 'attachment'
def facilities
render(json: lighthouse_facilities_service.get_facilities(lighthouse_facilities_params))
end

private
Expand All @@ -82,11 +79,26 @@ def health_care_application
@health_care_application ||= HealthCareApplication.new(params.permit(:form))
end

def file_name_for_pdf
veteran_name = health_care_application.parsed_form.try(:[], 'veteranFullName')
first_name = veteran_name.try(:[], 'first') || 'First'
last_name = veteran_name.try(:[], 'last') || 'Last'
"10-10EZ_#{first_name}_#{last_name}.pdf"
def lighthouse_facilities_service
@lighthouse_facilities_service ||= Lighthouse::Facilities::V1::Client.new
end

def lighthouse_facilities_params
params.permit(
:zip,
:state,
:lat,
:long,
:radius,
:bbox,
:visn,
:type,
:services,
:mobile,
:page,
:per_page,
facilityIds: []
)
end

def record_submission_attempt
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/v0/profile/direct_deposits_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class DirectDepositsController < ApplicationController
error = { status: exception.status_code, body: exception.errors.first }
response = Lighthouse::DirectDeposit::ErrorParser.parse(error)

# temporary - will be removed after direct deposit merge is complete
update_error_code_prefix(response) if single_form_enabled?

render status: response.status, json: response.body
end

Expand All @@ -41,6 +44,14 @@ def update

private

def single_form_enabled?
Flipper.enabled?(:profile_show_direct_deposit_single_form, @current_user)
end

def update_error_code_prefix(response)
response.code = response.code.sub('cnp.payment', 'direct.deposit')
end

def client
@client ||= DirectDeposit::Client.new(@current_user.icn)
end
Expand Down
4 changes: 4 additions & 0 deletions app/models/average_days_for_claim_completion.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class AverageDaysForClaimCompletion < ApplicationRecord
end
1 change: 1 addition & 0 deletions app/sidekiq/kms_key_rotation/batch_initiator_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def gids_for_model(model, max_records_per_batch)

model
.where.not('encrypted_kms_key LIKE ?', "v#{KmsEncryptedModelPatch.kms_version}:%")
.or(model.where(encrypted_kms_key: nil))
.limit(max_records_per_batch)
.pluck(model.primary_key)
.map { |id| URI::GID.build(app: GlobalID.app, model_name: model.name, model_id: id).to_s }
Expand Down
3 changes: 1 addition & 2 deletions app/sidekiq/terms_of_use/sign_up_service_updater_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ module TermsOfUse
class SignUpServiceUpdaterJob
include Sidekiq::Job

sidekiq_options unique_for: 2.days
sidekiq_options retry: 15 # 2.1 days using exponential backoff
sidekiq_options retry: 5 # ~17 mins

sidekiq_retries_exhausted do |job, exception|
Rails.logger.warn(
Expand Down
15 changes: 15 additions & 0 deletions config/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ features:
decision_review_delay_evidence:
actor_type: user
description: Ensures that NOD and SC evidence is not received in Central Mail before the appeal itself
decision_review_updated_pii_rules:
actor_type: user
description: Uses udpated rules for when to clear PII from appeals_api records
dependency_verification:
actor_type: user
description: Feature gates the dependency verification modal for updating the diaries service.
Expand Down Expand Up @@ -948,10 +951,18 @@ features:
actor_type: user
description: Displays an alert to users on 1990EZ intro page that the Backend Service is Down.
enable_in_development: false
show_meb_1990EZ_R6_maintenance_message:
actor_type: user
description: Displays an alert to users on 1990EZ intro page that the Backend Service is Down.
enable_in_development: false
show_meb_1990E_maintenance_alert:
actor_type: user
description: Displays an alert to users on 1990E intro page that the Backend Service is Down.
enable_in_development: false
show_meb_1990E_R6_maintenance_message:
actor_type: user
description: Displays an alert to users on 1990E intro page that the Backend Service is Down.
enable_in_development: false
show_meb_letters_maintenance_alert:
actor_type: user
description: Displays an alert to users on Letters Inbox page that the Backend Service is Down.
Expand All @@ -971,6 +982,10 @@ features:
actor_type: user
description: enables exclusion period checks
enable_in_development: false
meb_auto_populate_relinquishment_date:
actor_type: user
description: Flag to autofill datepicker for reliinquishment date
enable_in_development: true
show_forms_app:
actor_type: user
description: Enables the TOE form to be displayed.
Expand Down
4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
get(:healthcheck)
get(:enrollment_status)
get(:rating_info)
post(:download_pdf)
get(:facilities)
end
end

Expand Down Expand Up @@ -148,6 +148,8 @@
get 'claim_letters', to: 'claim_letters#index'
get 'claim_letters/:document_id', to: 'claim_letters#show'

get 'average_days_for_claim_completion', to: 'average_days_for_claim_completion#index'

get 'virtual_agent_claim_letters', to: 'virtual_agent_claim_letters#index'
get 'virtual_agent_claim_letters/:document_id', to: 'virtual_agent_claim_letters#show'

Expand Down
Loading

0 comments on commit 3c9437b

Please sign in to comment.