Skip to content

Commit

Permalink
Merge branch 'master' into burial-94168-remove-structureddata-process…
Browse files Browse the repository at this point in the history
…datajob
  • Loading branch information
wayne-weibel authored Oct 16, 2024
2 parents 400f778 + 681d1f0 commit 7efe1b3
Show file tree
Hide file tree
Showing 263 changed files with 6,914 additions and 11,282 deletions.
76 changes: 40 additions & 36 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions .github/workflows/be_review_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'require-backend-approval')
id: verify_approval
run: |
BACKEND_REVIEWERS=$(echo '${{ steps.get_team_members.outputs.data }}' | jq -r '.[].login' | tr '\n' '|' | sed 's/|$//')
APPROVALS=$(echo '${{ steps.check_backend_review_group_approval_status.outputs.data }}' | jq -r '.[] | select(.state == "APPROVED") | .user.login' | grep -iE "$BACKEND_REVIEWERS" | wc -l)
BACKEND_REVIEWERS=$(cat <<'EOF' | jq -r '.[].login' | tr '\n' '|' | sed 's/|$//'
${{ steps.get_team_members.outputs.data }}
EOF
)
APPROVALS=$(cat <<'EOF' | jq -r '.[] | select(.state == "APPROVED") | .user.login' | grep -iE "$BACKEND_REVIEWERS" | wc -l
${{ steps.check_backend_review_group_approval_status.outputs.data }}
EOF
)
echo "Number of backend-review-group approvals: $APPROVALS"
if [ "$APPROVALS" -eq 0 ]; then
echo "approval_status=required" >> $GITHUB_OUTPUT
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/ready_for_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN

# If no failures, no_failures=true
- name: Audit PR Labels
id: audit_pr_labels
if: |
Expand All @@ -36,13 +37,15 @@ jobs:
run: |
echo "no_failures=true" >> $GITHUB_OUTPUT
# If test-passing label is present, ready_for_review=true
- name: Audit Test Passing Label
id: audit_passing_labels
if: |
contains(github.event.pull_request.labels.*.name, 'test-passing')
run: |
echo "ready_for_review=true" >> $GITHUB_OUTPUT
# If require-backend-approval label is present, get reviews
- name: Check backend-review-group approval status
if: contains(github.event.pull_request.labels.*.name, 'require-backend-approval')
id: check_backend_review_group_approval_status
Expand All @@ -52,6 +55,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

#
- name: Get backend-review-group members
if: contains(github.event.pull_request.labels.*.name, 'require-backend-approval')
id: get_team_members
Expand All @@ -65,8 +69,16 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'require-backend-approval')
id: verify_approval
run: |
BACKEND_REVIEWERS=$(echo '${{ steps.get_team_members.outputs.data }}' | jq -r '.[].login' | tr '\n' '|' | sed 's/|$//')
APPROVALS=$(echo '${{ steps.check_backend_review_group_approval_status.outputs.data }}' | jq -r '.[] | select(.state == "APPROVED") | .user.login' | grep -iE "$BACKEND_REVIEWERS" | wc -l)
BACKEND_REVIEWERS=$(cat <<'EOF' | jq -r '.[].login' | tr '\n' '|' | sed 's/|$//'
${{ steps.get_team_members.outputs.data }}
EOF
)
APPROVALS=$(cat <<'EOF' | jq -r '.[] | select(.state == "APPROVED") | .user.login' | grep -iE "$BACKEND_REVIEWERS" | wc -l
${{ steps.check_backend_review_group_approval_status.outputs.data }}
EOF
)
echo "Number of backend-review-group approvals: $APPROVALS"
if [ "$APPROVALS" -eq 0 ]; then
echo "approval_status=required" >> $GITHUB_OUTPUT
Expand Down
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ path 'modules' do
gem 'apps_api'
gem 'ask_va_api'
gem 'avs'
gem 'burials'
gem 'check_in'
gem 'claims_api'
gem 'covid_research'
Expand Down Expand Up @@ -62,7 +63,7 @@ gem 'connect_vbms', git: 'https://github.com/adhocteam/connect_vbms', tag: 'v2.1
gem 'csv'
gem 'date_validator'
gem 'ddtrace'
gem 'dogstatsd-ruby', '5.6.1'
gem 'dogstatsd-ruby', '5.6.2'
gem 'dry-struct'
gem 'dry-types'
gem 'ethon', '>=0.13.0'
Expand Down Expand Up @@ -137,6 +138,7 @@ gem 'rails-session_cookie'
gem 'redis'
gem 'redis-namespace'
gem 'request_store'
gem 'require_all'
gem 'restforce'
gem 'rgeo-geojson'
gem 'roo'
Expand Down Expand Up @@ -179,7 +181,7 @@ group :development do
end

group :test do
gem 'apivore', git: 'https://github.com/department-of-veterans-affairs/apivore', tag: 'v2.0.0.vsp'
gem 'apivore', git: 'https://github.com/department-of-veterans-affairs/apivore', tag: 'v2.1.0.vsp'
gem 'mock_redis'
gem 'pdf-inspector'
gem 'rspec_junit_formatter'
Expand Down
38 changes: 21 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ GIT

GIT
remote: https://github.com/department-of-veterans-affairs/apivore
revision: f8ccd476f6c5301f5ebe4e2dd5b30ff0e567ffc1
tag: v2.0.0.vsp
revision: 1c7d19c4a52f71a3ef07940697ad9520f1872dd6
tag: v2.1.0.vsp
specs:
apivore (2.0.0.vsp)
apivore (2.1.0.vsp)
actionpack (>= 4)
hashie (~> 5.0)
json-schema (~> 4.0)
json-schema (~> 5.0)
rspec (~> 3)
rspec-expectations (~> 3.1)
rspec-mocks (~> 3.1)
Expand Down Expand Up @@ -93,6 +93,7 @@ PATH
sidekiq
ask_va_api (0.1.0)
avs (0.1.0)
burials (0.1.0)
check_in (0.1.0)
claims_api (0.0.1)
dry-schema
Expand Down Expand Up @@ -363,7 +364,7 @@ GEM
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.5.1)
docile (1.4.0)
dogstatsd-ruby (5.6.1)
dogstatsd-ruby (5.6.2)
domain_name (0.6.20240107)
down (5.4.2)
addressable (~> 2.8)
Expand Down Expand Up @@ -511,7 +512,7 @@ GEM
google-apis-core (>= 0.15.0, < 2.a)
google-apis-discovery_v1 (~> 0.18)
thor (>= 0.20, < 2.a)
google-cloud-env (2.1.1)
google-cloud-env (2.2.1)
faraday (>= 1.0, < 3.a)
google-protobuf (4.28.2)
bigdecimal
Expand All @@ -521,7 +522,7 @@ GEM
ffi (~> 1)
ffi-compiler (~> 1)
rake (>= 13)
googleauth (1.11.0)
googleauth (1.11.1)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.1)
jwt (>= 1.4, < 3.0)
Expand Down Expand Up @@ -550,7 +551,7 @@ GEM
builder (>= 2.1.2)
rexml (~> 3.0)
hana (1.3.7)
hashdiff (1.1.0)
hashdiff (1.1.1)
hashery (2.1.2)
hashie (5.0.0)
hexapdf (0.47.0)
Expand Down Expand Up @@ -590,8 +591,8 @@ GEM
jruby-openssl (0.15.0-java)
json (2.7.2)
json (2.7.2-java)
json-schema (4.3.1)
addressable (>= 2.8)
json-schema (5.0.1)
addressable (~> 2.8)
json_schemer (2.3.0)
bigdecimal
hana (~> 1.3)
Expand Down Expand Up @@ -855,6 +856,7 @@ GEM
uber (< 0.2.0)
request_store (1.7.0)
rack (>= 1.4)
require_all (3.0.0)
restforce (7.5.0)
faraday (>= 1.1.0, < 2.12.0)
faraday-follow_redirects (<= 0.3.0, < 1.0.0)
Expand All @@ -863,7 +865,7 @@ GEM
hashie (>= 1.2.0, < 6.0)
jwt (>= 1.5.6)
retriable (3.1.2)
rexml (3.3.7)
rexml (3.3.8)
rgeo (3.0.1)
rgeo-activerecord (7.0.1)
activerecord (>= 5.0)
Expand All @@ -889,7 +891,7 @@ GEM
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (7.0.1)
Expand All @@ -910,9 +912,9 @@ GEM
rspec-support (3.13.1)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rswag-specs (2.14.0)
rswag-specs (2.15.0)
activesupport (>= 5.2, < 8.0)
json-schema (>= 2.2, < 5.0)
json-schema (>= 2.2, < 6.0)
railties (>= 5.2, < 8.0)
rspec-core (>= 2.14)
rswag-ui (2.15.0)
Expand Down Expand Up @@ -1021,7 +1023,7 @@ GEM
staccato (0.5.3)
statsd-instrument (3.9.2)
stringio (3.1.1)
strong_migrations (2.0.0)
strong_migrations (2.0.1)
activerecord (>= 6.1)
super_diff (0.13.0)
attr_extras (>= 6.2.4)
Expand Down Expand Up @@ -1071,7 +1073,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webmock (3.23.1)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down Expand Up @@ -1128,6 +1130,7 @@ DEPENDENCIES
brakeman
breakers
bundler-audit
burials!
byebug
carrierwave
carrierwave-aws
Expand All @@ -1147,7 +1150,7 @@ DEPENDENCIES
ddtrace
debts_api!
dhp_connected_devices!
dogstatsd-ruby (= 5.6.1)
dogstatsd-ruby (= 5.6.2)
dry-struct
dry-types
ethon (>= 0.13.0)
Expand Down Expand Up @@ -1246,6 +1249,7 @@ DEPENDENCIES
redis-namespace
representation_management!
request_store
require_all
restforce
rgeo-geojson
roo
Expand Down
6 changes: 6 additions & 0 deletions app/controllers/flipper_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
class FlipperController < ApplicationController
service_tag 'feature-flag'
skip_before_action :authenticate

def login
# Swallow auth token and redirect to /flipper/features with a param for redirecting
redirect_to "/flipper/features?redirect=#{params[:feature_name]}"
end

def logout
cookies.delete :api_session
redirect_to '/flipper/features'
Expand Down
8 changes: 5 additions & 3 deletions app/controllers/v0/caregivers_assistance_claims_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ def download_pdf
client_file_name = file_name_for_pdf(@claim.veteran_data)
file_contents = File.read(source_file_path)

# rubocop:disable Lint/NonAtomicFileOperation
File.delete(source_file_path) if File.exist?(source_file_path)
# rubocop:enable Lint/NonAtomicFileOperation
File.delete(source_file_path) if !Flipper.enabled?(:caregiver1010) && File.exist?(source_file_path)

auditor.record(:pdf_download)

send_data file_contents, filename: client_file_name, type: 'application/pdf', disposition: 'attachment'
ensure
if Flipper.enabled?(:caregiver1010) && (source_file_path && File.exist?(source_file_path))
File.delete(source_file_path)
end
end

def facilities
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/v0/my_va/submission_statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def controller_enabled?
end

def allowed_forms
%w[20-10206 20-10207 21-0845 21-0966 21-0972 21-10210 21-4142 21-4142a 21P-0847]
%w[20-10206 20-10207 21-0845 21-0972 21-10210 21-4142 21-4142a 21P-0847]
end

def serializable_from(result)
Expand Down
8 changes: 7 additions & 1 deletion app/models/saved_claim/caregivers_assistance_claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ def process_attachments!
def to_pdf(filename = nil, **)
# We never save the claim, so we don't have an id to provide for the filename.
# Instead we'll create a filename with this format "10-10cg_{uuid}"
PdfFill::Filler.fill_form(self, filename || guid, **)
name = filename || guid
PdfFill::Filler.fill_form(self, name, **)
rescue => e
Rails.logger.error("Failed to generate PDF: #{e.message}")
PersonalInformationLog.create(data: { form: parsed_form, file_name: name },
error_class: '1010CGPdfGenerationError')
raise
end

# SavedClaims require regional_office to be defined, CaregiversAssistanceClaim has no purpose for it.
Expand Down
4 changes: 4 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def account_id
@account_id ||= account&.id
end

def initial_sign_in
user_account.created_at
end

def credential_lock
return @credential_lock unless @credential_lock.nil?

Expand Down
7 changes: 7 additions & 0 deletions app/services/login/after_login_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def perform
Login::UserAcceptableVerifiedCredentialUpdater.new(user_account: @current_user.user_account).perform
update_account_login_stats(login_type)
id_mismatch_validations
create_mhv_account

if Settings.test_user_dashboard.env == 'staging'
TestUserDashboard::UpdateUser.new(current_user).call(Time.current)
Expand Down Expand Up @@ -53,5 +54,11 @@ def check_id_mismatch(identity_value, mpi_value, error_message)
Rails.logger.warn("[SessionsController version:v1] #{error_message}", error_data)
end
end

def create_mhv_account
return unless Settings.mhv.account_creation.create_after_login

MHV::AccountCreatorJob.perform_async(current_user.user_verification.id)
end
end
end
7 changes: 7 additions & 0 deletions app/services/sign_in/user_code_map_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def perform
create_user_acceptable_verified_credential
create_terms_code_container if needs_accepted_terms_of_use?
create_code_container
create_mhv_account
user_code_map
end

Expand Down Expand Up @@ -61,6 +62,12 @@ def create_code_container
device_sso:).save!
end

def create_mhv_account
return unless Settings.mhv.account_creation.create_after_login

MHV::AccountCreatorJob.perform_async(user_verification.id)
end

def device_sso
state_payload.scope == Constants::Auth::DEVICE_SSO
end
Expand Down
3 changes: 2 additions & 1 deletion app/services/users/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def profile
sec_id: user.sec_id,
logingov_uuid: user.logingov_uuid,
idme_uuid: user.idme_uuid,
id_theft_flag: user.id_theft_flag
id_theft_flag: user.id_theft_flag,
initial_sign_in: user.initial_sign_in
}
end
# rubocop:enable Metrics/MethodLength
Expand Down
2 changes: 2 additions & 0 deletions app/sidekiq/benefits_intake_status_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def log_result(result, form_id, uuid, time_to_transition = nil, error_message =
StatsD.increment("#{STATS_KEY}.#{form_id}.#{result}")
StatsD.increment("#{STATS_KEY}.all_forms.#{result}")
if result == 'failure'
tags = [service: 'veteran-facing-forms', function: "#{form_id} form submission to Lighthouse"]
statsd.increment('silent_failure', tags:)
Rails.logger.error('BenefitsIntakeStatusJob', result:, form_id:, uuid:, time_to_transition:, error_message:)
else
Rails.logger.info('BenefitsIntakeStatusJob', result:, form_id:, uuid:, time_to_transition:)
Expand Down
Loading

0 comments on commit 7efe1b3

Please sign in to comment.