Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed extra pciu migration flippers #21108

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RachalCassity
Copy link
Member

@RachalCassity RachalCassity commented Mar 5, 2025

Note: Delete the description statements, complete each step. None are optional, but can be justified as to why they cannot be completed as written. Provide known gaps to testing that may raise the risk of merging to production.

Summary

:remove_pciu flipper is replacing va_v3_contact_information_service and remove_pciu_2. This will allow an easy flow to enable VAProfile CIV2 and AddressValidationV3 in production.

The remove_pciu flipper was added to the vet360_contact_info method in the User model. user.vaprofile_contact_info and user.va_profile_v2_email is no longer necessary.

Related issue(s)

Testing done

  • New code is covered by unit tests
  • Describe what the old behavior was prior to the change
  • Describe the steps required to verify your changes are working as expected. Exclusively stating 'Specs run' is NOT acceptable as appropriate testing
  • If this work is behind a flipper:
    • Tests need to be written for both the flipper on and flipper off scenarios. Docs.
    • What is the testing plan for rolling out the feature?

Screenshots

Note: Optional

What areas of the site does it impact?

(Describe what parts of the site are impacted andifcode touched other areas)

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@va-vfs-bot va-vfs-bot temporarily deployed to rcassity-civ2-cleanup/main/main March 5, 2025 19:46 Inactive
Copy link

github-actions bot commented Mar 5, 2025

1 Warning
⚠️ This PR changes 366 LoC (not counting whitespace/newlines).

In order to ensure each PR receives the proper attention it deserves, we recommend not exceeding
200. Expect some delays getting reviews.

File Summary

Files

  • app/controllers/concerns/vet360/transactionable.rb (+1/-1)

  • app/controllers/concerns/vet360/writeable.rb (+3/-3)

  • app/controllers/v0/profile/address_validation_controller.rb (+2/-2)

  • app/controllers/v0/profile/persons_controller.rb (+1/-1)

  • app/controllers/v0/profile/transactions_controller.rb (+1/-1)

  • app/controllers/v0/veteran_readiness_employment_claims_controller.rb (+1/-1)

  • app/models/async_transaction/va_profile/base.rb (+1/-1)

  • app/models/form_profiles/va_21686c.rb (+1/-1)

  • app/models/user.rb (+7/-3)

  • app/policies/va_profile_policy.rb (+1/-1)

  • app/services/users/profile.rb (+1/-2)

  • config/features.yml (+0/-11)

  • lib/va_profile/v2/contact_information/service.rb (+2/-2)

  • modules/ask_va_api/app/controllers/ask_va_api/v0/address_validation_controller.rb (+2/-2)

  • modules/ask_va_api/spec/requests/ask_va_api/v0/address_validation_spec.rb (+1/-1)

  • modules/burials/spec/lib/burials/form_profiles/va_21p530ez_spec.rb (+1/-0)

  • modules/mobile/app/models/mobile/v0/user_accessible_services.rb (+1/-1)

  • modules/mobile/spec/requests/mobile/v0/community_care_providers_spec.rb (+0/-1)

  • modules/mobile/spec/requests/mobile/v0/user/addresses_spec.rb (+0/-1)

  • modules/mobile/spec/requests/mobile/v0/user/contact_info_spec.rb (+0/-1)

  • modules/mobile/spec/requests/mobile/v0/user/emails_spec.rb (+0/-1)

  • modules/mobile/spec/requests/mobile/v0/user/phones_spec.rb (+0/-1)

  • modules/mobile/spec/requests/mobile/v0/user_spec.rb (+0/-1)

  • modules/mobile/spec/requests/mobile/v1/user_spec.rb (+0/-1)

  • modules/mobile/spec/services/sync_update_service_spec.rb (+0/-1)

  • modules/mobile/spec/sidekiq/vet360_linking_spec.rb (+0/-1)

  • modules/veteran/app/sidekiq/organizations/update.rb (+3/-3)

  • modules/veteran/app/sidekiq/representatives/update.rb (+3/-3)

  • modules/veteran/lib/tasks/update_vso_addresses.rake (+2/-2)

  • modules/veteran/spec/sidekiq/organizations/update_spec.rb (+4/-20)

  • modules/veteran/spec/sidekiq/representatives/update_spec.rb (+3/-60)

  • spec/controllers/v0/profile/address_validation_controller_spec.rb (+2/-2)

  • spec/controllers/v0/users_controller_spec.rb (+0/-2)

  • spec/lib/common/models/concerns/cache_aside_spec.rb (+19/-54)

  • spec/lib/debt_management_center/statement_identifier_service_spec.rb (+1/-9)

  • spec/lib/va_profile/v2/contact_information/service_spec.rb (+4/-4)

  • spec/lib/va_profile/v2/contact_information/transaction_response_spec.rb (+1/-1)

  • spec/lib/va_profile/v2/person/service_spec.rb (+1/-1)

  • spec/lib/va_profile/v3/address_validation/service_spec.rb (+1/-1)

  • spec/models/async_transaction/va_profile/base_spec.rb (+1/-2)

  • spec/models/async_transaction/vet360/base_spec.rb (+1/-4)

  • spec/models/form_profile/mdot_spec.rb (+3/-0)

  • spec/models/form_profile_spec.rb (+0/-2)

  • spec/models/form_profile_v2_spec.rb (+0/-1)

  • spec/models/user_spec.rb (+0/-4)

  • spec/models/va_profile_redis/cache_spec.rb (+1/-1)

  • spec/models/va_profile_redis/contact_information_spec.rb (+1/-1)

  • spec/models/va_profile_redis/v2/cache_spec.rb (+1/-1)

  • spec/models/va_profile_redis/v2/contact_information_spec.rb (+1/-1)

  • spec/rakelib/vet360_spec.rb (+1/-1)

  • spec/requests/swagger_spec.rb (+5/-8)

  • spec/requests/v0/in_progress_forms_controller_spec.rb (+8/-6)

  • spec/requests/v0/profile/addresses_spec.rb (+5/-5)

  • spec/requests/v0/profile/email_addresses_spec.rb (+0/-2)

  • spec/requests/v0/profile/permissions_spec.rb (+1/-1)

  • spec/requests/v0/profile/persons_spec.rb (+3/-3)

  • spec/requests/v0/profile/telephones_spec.rb (+4/-5)

  • spec/requests/v0/profile/transactions_spec.rb (+1/-3)

  • spec/support/va_profile/stub_vet360.rb (+1/-1)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, *.md, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/, *.bru, *.pdf
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

@@ -119,8 +119,7 @@ def form_526_required_identifiers
end

def vet360_contact_information
contact_info_v2_enabled = Flipper.enabled?(:va_v3_contact_information_service, user)
person = contact_info_v2_enabled ? user.vaprofile_contact_info : user.vet360_contact_info
person = user.vet360_contact_info
return {} if person.blank?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer need user.vaprofile_contact_info

@RachalCassity RachalCassity marked this pull request as ready for review March 5, 2025 19:50
@RachalCassity RachalCassity requested review from a team as code owners March 5, 2025 19:50

before do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ContactInformationV1 from cache aside spec.

else
'va_profile/contact_information'
end
allow(Flipper).to receive(:enabled?).with(:remove_pciu, instance_of(User)).and_return(true)
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up code.

@@ -337,7 +339,7 @@

it "can't have non-hash formData" do
put v0_in_progress_form_url(new_form.form_id),
params: { form_data: 'Hello!' }.to_json,
params: { form_data: '' }.to_json,
headers: { 'CONTENT_TYPE' => 'application/json' }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intentional. Form data should be ''

allow(Flipper).to receive(:enabled?).with(:remove_pciu, instance_of(User)).and_return(true)
allow(VAProfile::Configuration::SETTINGS.contact_information).to receive(:cache_enabled).and_return(true)
user.vaprofile_contact_info
user.vet360_contact_info
sign_in_as(user)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user.vaprofile_contact_info no longer needed.

VAProfileRedis::V2::ContactInformation.for_user(self)
else
elsif !Flipper.enabled?(:remove_pciu, self) && vet360_id.present?
VAProfileRedis::ContactInformation.for_user(self)
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VAProfileRedis::V2::ContactInformation.for_user(self) requires icn.
VAProfileRedis::ContactInformation.for_user(self) requires vet360_id

@@ -46,7 +46,7 @@ def encrypted_user
uuid: current_user.uuid,
icn: current_user.icn,
first_name: current_user.first_name,
va_profile_email: current_user.va_profile_email || current_user.va_profile_v2_email
va_profile_email: current_user.va_profile_email
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current_user.va_profile_v2_email no longer needed.

@@ -38,7 +38,7 @@ def service_auth_map
prescriptions: access?(mhv_prescriptions: :access?),
scheduleAppointments: access?(schedule_appointment: :access?),
secureMessaging: access?(mhv_messaging: :mobile_access?),
userProfileUpdate: access?(vet360: :access?)
userProfileUpdate: access?(va_profile: :access_to_v2?)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated for icn requirements.

@RachalCassity RachalCassity requested a review from a team as a code owner March 5, 2025 20:02
@va-vfs-bot va-vfs-bot temporarily deployed to rcassity-civ2-cleanup/main/main March 5, 2025 20:03 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to rcassity-civ2-cleanup/main/main March 5, 2025 20:12 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants