-
Notifications
You must be signed in to change notification settings - Fork 121
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
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]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some trivial notes, but otherwise this looks good to me!
@@ -75,6 +79,7 @@ | |||
let(:session) do | |||
{ document_capture_session_uuid: 'a-random-uuid' } | |||
end | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
@@ -97,11 +97,11 @@ def self.all | |||
}, | |||
).freeze | |||
|
|||
SOCURE_IDV_SHADOW_MODE = AbTest.new( | |||
SOCURE_IDV_SHADOW_MODE_FOR_NON_DOCV_USERS = AbTest.new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
🎫 Ticket
Link to the relevant ticket:
LG-15187
🛠 Summary of changes
This PR updates the logic
ResolutionProofingJob
uses 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_enabled
false
, no shadow mode jobs will be scheduled.idv_socure_shadow_mode_enabled_for_docv_users
socure_idplus_shadow_mode_percent
Here is a table laying out the relationship between the various variables:
false
true
false
true
true
false
false
true
true
true
true
true
false
true
true
true
false
true
📜 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_result
event in your logs.Scenario 1: Shadow mode disabled
idv_socure_shadow_mode_enabled: false
SocureShadowModeProofingJob
ranScenario 2: shadow mode enabled, user included in A/B test
idv_socure_shadow_mode_enabled: true
andsocure_idplus_shadow_mode_percent: 100
SocureShadowModeProofingJob
ranScenario 3: shadow mode enabled, user not included in A/B test
idv_socure_shadow_mode_enabled: true
andsocure_idplus_shadow_mode_percent: 0
SocureShadowModeProofingJob
ran🚨 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 apply
in your terminal)Then, you need to modify your
application.yml
to enable Socure docv:Scenario 4: shadow mode enabled for docv users, user goes through docv
idv_socure_shadow_mode_enabled: true
SocureShadowModeProofingJob
ranScenario 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: 100
SocureShadowModeProofingJob
ranScenario 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: 0
SocureShadowModeProofingJob
ran