Skip to content

Commit

Permalink
Merge branch 'master' into co-030624-Updating-feature-toggle-actor-type
Browse files Browse the repository at this point in the history
  • Loading branch information
cosu419 authored Mar 6, 2024
2 parents cd0c214 + af1b654 commit 3f5ec52
Show file tree
Hide file tree
Showing 103 changed files with 2,088 additions and 1,996 deletions.
13 changes: 9 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.bundle
.git
coverage/
data/
log/*
tmp/
.github
.gitignore
.rspec
coverage
data
docs
log
tmp
3 changes: 1 addition & 2 deletions .github/workflows/code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v4

# Lock back to an @v1-version once https://github.com/ruby/setup-ruby/pull/491 is merged
- uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7
with:
bundler-cache: true

Expand Down
45 changes: 23 additions & 22 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 100`
# on 2024-02-14 16:07:35 UTC using RuboCop version 1.60.2.
# on 2024-03-04 22:34:21 UTC using RuboCop version 1.61.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -83,7 +83,7 @@ FactoryBot/ConsistentParenthesesStyle:
- 'spec/sidekiq/form1095/new1095_bs_job_spec.rb'
- 'spec/sidekiq/vre/create_ch31_submissions_report_job_spec.rb'

# Offense count: 489
# Offense count: 504
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Include.
# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb
Expand Down Expand Up @@ -140,7 +140,7 @@ Layout/LineContinuationSpacing:
- 'spec/sidekiq/cypress_viewport_updater/viewport_preset_js_file_spec.rb'
- 'spec/support/saml/response_builder.rb'

# Offense count: 45
# Offense count: 40
# This cop supports safe autocorrection (--autocorrect).
Lint/AmbiguousOperatorPrecedence:
Exclude:
Expand Down Expand Up @@ -228,7 +228,7 @@ Lint/ConstantDefinitionInBlock:
- 'spec/uploaders/uploader_virus_scan_spec.rb'
- 'spec/uploaders/validate_pdf_spec.rb'

# Offense count: 7
# Offense count: 5
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
Lint/DuplicateBranch:
Exclude:
Expand All @@ -249,7 +249,7 @@ Lint/DuplicateRegexpCharacterClassElement:
Exclude:
- 'modules/check_in/lib/check_in/utils/logger.rb'

# Offense count: 91
# Offense count: 88
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Exclude:
Expand Down Expand Up @@ -465,7 +465,7 @@ Lint/UselessRescue:
- 'app/controllers/v0/contact_us/inquiries_controller.rb'
- 'lib/lgy/service.rb'

# Offense count: 888
# Offense count: 901
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 90
Expand All @@ -476,17 +476,17 @@ Metrics/AbcSize:
Metrics/BlockLength:
Max: 62

# Offense count: 188
# Offense count: 192
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 29

# Offense count: 128
# Offense count: 132
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 29

# Offense count: 265
# Offense count: 266
Naming/AccessorMethodName:
Enabled: false

Expand Down Expand Up @@ -581,7 +581,7 @@ Naming/VariableNumber:
- 'spec/sidekiq/facilities/state_cemetery_reload_job_spec.rb'
- 'spec/sidekiq/form1010cg/delete_old_uploads_job_spec.rb'

# Offense count: 905
# Offense count: 919
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Enabled: false
Expand Down Expand Up @@ -649,7 +649,7 @@ RSpec/ClassCheck:
- 'spec/lib/iam_ssoe_oauth/session_manager_spec.rb'
- 'spec/requests/v1/facilities/va_request_spec.rb'

# Offense count: 64
# Offense count: 67
# This cop supports safe autocorrection (--autocorrect).
RSpec/ExcessiveDocstringSpacing:
Exclude:
Expand Down Expand Up @@ -688,7 +688,7 @@ RSpec/ExcessiveDocstringSpacing:
- 'spec/requests/upload_supporting_evidence_request_spec.rb'
- 'spec/sidekiq/vre/create_ch31_submissions_report_job_spec.rb'

# Offense count: 66
# Offense count: 65
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Expand Down Expand Up @@ -748,8 +748,10 @@ RSpec/PendingWithoutReason:
- 'spec/requests/breakers_integration_spec.rb'
- 'spec/sidekiq/facilities/mental_health_reload_job_spec.rb'

# Offense count: 603
# Offense count: 630
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ResponseMethods.
# ResponseMethods: response, last_response
RSpec/Rails/HaveHttpStatus:
Exclude:
- 'modules/appeals_api/spec/controllers/application_controller_spec.rb'
Expand Down Expand Up @@ -814,6 +816,7 @@ RSpec/Rails/HaveHttpStatus:
- 'spec/controllers/v0/profile/valid_va_file_numbers_controller_spec.rb'
- 'spec/controllers/v0/veteran_readiness_employment_claims_controller_spec.rb'
- 'spec/lib/vetext/service_spec.rb'
- 'spec/middleware/rack/attack_spec.rb'
- 'spec/requests/burial_claims_spec.rb'
- 'spec/requests/claim_documents_spec.rb'
- 'spec/requests/csrf_request_spec.rb'
Expand All @@ -833,13 +836,13 @@ RSpec/Rails/HaveHttpStatus:
- 'spec/support/controller_spec_helper.rb'
- 'spec/support/shared_examples_for_mhv.rb'

# Offense count: 259
# Offense count: 264
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Inferences.
RSpec/Rails/InferredSpecType:
Enabled: false

# Offense count: 27
# Offense count: 26
# This cop supports safe autocorrection (--autocorrect).
RSpec/SortMetadata:
Exclude:
Expand Down Expand Up @@ -870,7 +873,7 @@ RSpec/SortMetadata:
- 'spec/sidekiq/education_form/process10203_submissions_spec.rb'
- 'spec/sidekiq/education_form/send_school_certifying_officials_email_spec.rb'

# Offense count: 650
# Offense count: 647
RSpec/StubbedMock:
Enabled: false

Expand Down Expand Up @@ -903,7 +906,7 @@ RSpec/SubjectDeclaration:
- 'spec/sidekiq/sidekiq_alive/cleanup_queues_spec.rb'
- 'spec/uploaders/form1010cg/poa_uploader_spec.rb'

# Offense count: 123
# Offense count: 116
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: constant, string
Expand Down Expand Up @@ -1071,10 +1074,9 @@ Rails/FilePath:
- 'modules/dhp_connected_devices/app/services/token_storage_service.rb'
- 'spec/sidekiq/evss/document_upload_spec.rb'

# Offense count: 15
# Offense count: 14
Rails/I18nLocaleTexts:
Exclude:
- 'app/mailers/failed_claims_report_mailer.rb'
- 'app/mailers/veteran_readiness_employment_mailer.rb'
- 'app/models/async_transaction/base.rb'
- 'app/models/message.rb'
Expand Down Expand Up @@ -1237,14 +1239,13 @@ Style/FileRead:
- 'modules/vba_documents/spec/sidekiq/upload_processor_spec.rb'
- 'spec/lib/hca/service_spec.rb'

# Offense count: 12
# Offense count: 11
# This cop supports safe autocorrection (--autocorrect).
Style/FileWrite:
Exclude:
- 'lib/common/file_helpers.rb'
- 'lib/sftp_writer/local.rb'
- 'modules/claims_api/app/models/claims_api/power_of_attorney.rb'
- 'modules/claims_api/lib/claims_api/v1/poa_pdf_constructor/signature.rb'
- 'modules/dhp_connected_devices/app/services/token_storage_service.rb'
- 'modules/mobile/app/services/mobile/v0/claims/proxy.rb'
- 'rakelib/mockdata_synchronize.rake'
Expand Down Expand Up @@ -1292,7 +1293,7 @@ Style/NegatedIfElseCondition:
- 'modules/dhp_connected_devices/app/serializers/device_serializer.rb'
- 'modules/vaos/app/controllers/vaos/v2/appointments_controller.rb'

# Offense count: 368
# Offense count: 367
Style/OpenStructUse:
Enabled: false

Expand Down
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ GIT

GIT
remote: https://github.com/department-of-veterans-affairs/vets-json-schema
revision: 59bbc8ad75bbb8798fe099ce179d35ad312068a6
revision: 6941836945d2c45390c96c03e2c0de9e31ece3a5
branch: master
specs:
vets_json_schema (20.39.1)
vets_json_schema (21.0.0)
multi_json (~> 1.0)
script_utils (= 0.0.4)

Expand Down Expand Up @@ -561,7 +561,9 @@ GEM
json (2.7.1-java)
json-schema (4.1.1)
addressable (>= 2.8)
json_schemer (2.1.1)
json_schemer (2.2.0)
base64
bigdecimal
hana (~> 1.3)
regexp_parser (~> 2.0)
simpleidn (~> 0.2)
Expand Down Expand Up @@ -677,7 +679,7 @@ GEM
activerecord (>= 6.1)
request_store (~> 1.4)
parallel (1.24.0)
parallel_tests (4.5.1)
parallel_tests (4.5.2)
parallel
parser (3.3.0.5)
ast (~> 2.4.1)
Expand All @@ -697,7 +699,7 @@ GEM
hashery (~> 2.0)
ruby-rc4
ttfunk
pg (1.5.5)
pg (1.5.6)
pg_query (5.1.0)
google-protobuf (>= 3.22.3)
pg_search (2.3.6)
Expand All @@ -713,7 +715,6 @@ GEM
prawn-table
prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0)
prism (0.24.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -737,7 +738,7 @@ GEM
rack (2.2.8.1)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
rack-cors (2.0.1)
rack-cors (2.0.2)
rack (>= 2.0.0)
rack-protection (3.2.0)
base64 (>= 0.1.0)
Expand Down Expand Up @@ -870,20 +871,19 @@ GEM
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.0)
rubocop-ast (1.31.1)
parser (>= 3.3.0.4)
prism (>= 0.24.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-junit-formatter (0.1.4)
rubocop-rails (2.23.1)
rubocop-rails (2.24.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.26.1)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.27.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ This project provides common APIs for applications that live on VA.gov (formerly

[API Docs](https://department-of-veterans-affairs.github.io/va-digital-services-platform-docs/api-reference/#/)



For frontend, see [vets-website](https://github.com/department-of-veterans-affairs/vets-website) and [vets-content](https://github.com/department-of-veterans-affairs/vagov-content) repos.

## Base setup
Expand Down
14 changes: 10 additions & 4 deletions app/controllers/v0/rated_disabilities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,23 @@ def show
remove_inactive_ratings!(response['data']['attributes']['individual_ratings'])
end

# LH returns the ICN of the Veteran in the data.id field
# We want to scrub it out before sending to the FE
response['data']['id'] = ''

render json: response
end

private

def remove_inactive_ratings!(ratings)
ratings.select! { |rating| active?(rating) }
def active?(rating)
end_date = rating['rating_end_date']

end_date.nil? || Date.parse(end_date).future?
end

def active?(rating)
rating['rating_end_date'].nil?
def remove_inactive_ratings!(ratings)
ratings.select! { |rating| active?(rating) }
end

def service
Expand Down
Loading

0 comments on commit 3f5ec52

Please sign in to comment.