LG-15187: Update Socure shadow mode A/B test logic (part 2/2)#11694
Merged
LG-15187: Update Socure shadow mode A/B test logic (part 2/2)#11694
Conversation
Adds a new parameter to ResolutionProofingJob prior to implementation, so that the new signature method can be used once all job queues are running the same code. [skip changelog]
Update this spec to use more let and subject blocks ahead of adding new tests to it. [skip changelog]
Assert we're actually passing proofing components into ResolutionProofingJob
Handle logic around shadow mode enabled / disabled globally, shadow mode enabled for docv users, and shadow mode a/b test for non-docv users.
Tests can get stuck with mocked configs, leading to flakiness. [skip changelog]
n1zyy
approved these changes
Jan 2, 2025
Contributor
n1zyy
left a comment
There was a problem hiding this comment.
Some trivial notes, but otherwise this looks good to me!
| let(:session) do | ||
| { document_capture_session_uuid: 'a-random-uuid' } | ||
| end | ||
|
|
| ).freeze | ||
|
|
||
| SOCURE_IDV_SHADOW_MODE = AbTest.new( | ||
| SOCURE_IDV_SHADOW_MODE_FOR_NON_DOCV_USERS = AbTest.new( |
Contributor
There was a problem hiding this comment.
Just an idle musing from someone who hasn't looked at IDP code since last year: I think if I didn't have all the context of this PR in mind, I'd expect this to have a SOCURE_IDV_SHADOW_MODE_FOR_DOCV_USERS corollary. This isn't particularly sensible, of course.
Co-authored-by: Matt Wagner <matt.wagner@gsa.gov>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎫 Ticket
Link to the relevant ticket:
LG-15187
🛠 Summary of changes
This PR updates the logic
ResolutionProofingJobuses to decide whether to kick off aSocureShadowModeProofingJob.We're going from a single A/B test configuration, where a user is either in or not in the shadow mode test, to a more complex setup:
Thus this PR reworks the config structure slightly:
idv_socure_shadow_mode_enabledfalse, no shadow mode jobs will be scheduled.idv_socure_shadow_mode_enabled_for_docv_userssocure_idplus_shadow_mode_percentHere is a table laying out the relationship between the various variables:
falsetruefalsetruetruefalsefalsetruetruetruetruetruefalsetruetruetruefalsetrue📜 Testing Plan
Before testing, make sure that shadow mode can run locally by configuring the connection to the Socure sandbox:
The easiest way to check whether the SocureShadowModeProofing job has run is to watch for the
idv_socure_shadow_mode_proofing_resultevent in your logs.Scenario 1: Shadow mode disabled
idv_socure_shadow_mode_enabled: falseSocureShadowModeProofingJobranScenario 2: shadow mode enabled, user included in A/B test
idv_socure_shadow_mode_enabled: trueandsocure_idplus_shadow_mode_percent: 100SocureShadowModeProofingJobranScenario 3: shadow mode enabled, user not included in A/B test
idv_socure_shadow_mode_enabled: trueandsocure_idplus_shadow_mode_percent: 0SocureShadowModeProofingJobran🚨 These next scenarios require some setup outlined in here 🚨
To avoid having to wire up Socure doc auth locally, you can use a mocked Socure doc auth provider.
First, bring in the mocked provider implementation:
Then, apply this so that mock socure users are treated as docv users:
(To apply, copy the patch, then do
pbpaste | git applyin your terminal)Then, you need to modify your
application.ymlto enable Socure docv:Scenario 4: shadow mode enabled for docv users, user goes through docv
idv_socure_shadow_mode_enabled: trueSocureShadowModeProofingJobranScenario 5: shadow mode enabled for docv users, user does not go through docv, but is selected for A/B test
idv_socure_shadow_mode_enabled: true,doc_auth_vendor_default: 'mock', andsocure_idplus_shadow_mode_percent: 100SocureShadowModeProofingJobranScenario 6: shadow mode enabled for docv users, user does not go through docv and is not selected for A/B test
idv_socure_shadow_mode_enabled: true,doc_auth_default: 'mock', andsocure_idplus_shadow_mode_percent: 0SocureShadowModeProofingJobran