From caf9e3d5a5cf9758bd43d8d4ffc89e652ab7c247 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Mon, 5 May 2025 17:33:53 -0400 Subject: [PATCH 1/4] add a/b test for disabling manual document upload Co-authored-by: Malik Warren --- config/application.yml.default | 2 ++ config/initializers/ab_tests.rb | 15 ++++++++++++++ lib/identity_config.rb | 2 ++ spec/config/initializers/ab_tests_spec.rb | 24 +++++++++++++++++++++++ 4 files changed, 43 insertions(+) diff --git a/config/application.yml.default b/config/application.yml.default index ddf2b9a2b37..ba1f8a93056 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -104,6 +104,8 @@ doc_auth_client_sharpness_threshold: 50 doc_auth_error_dpi_threshold: 290 doc_auth_error_glare_threshold: 40 doc_auth_error_sharpness_threshold: 40 +doc_auth_manual_upload_disabled_a_b_testing: false +doc_auth_manual_upload_disabled_a_b_testing_percent: 50 doc_auth_max_attempts: 5 doc_auth_max_capture_attempts_before_native_camera: 3 doc_auth_max_submission_attempts_before_native_camera: 3 diff --git a/config/initializers/ab_tests.rb b/config/initializers/ab_tests.rb index dfba4cc0605..1c9743a9c0f 100644 --- a/config/initializers/ab_tests.rb +++ b/config/initializers/ab_tests.rb @@ -127,4 +127,19 @@ def self.all ) do |service_provider:, session:, user:, user_session:, **| user&.uuid end.freeze + + DOC_AUTH_MANUAL_UPLOAD_DISABLED = AbTest.new( + experiment_name: 'Doc Auth Manual Upload Disabled', + should_log: [ + 'Idv: doc auth hybrid handoff visited', + 'IdV: doc auth document_capture visited', + ], + buckets: { + manual_upload_disabled: + IdentityConfig.store.doc_auth_manual_upload_disabled_a_b_testing ? + IdentityConfig.store.doc_auth_manual_upload_disabled_a_b_testing_percent : 0, + }, + ) do |service_provider:, session:, user:, user_session:, **| + user&.uuid + end.freeze end diff --git a/lib/identity_config.rb b/lib/identity_config.rb index eef21146616..10bfcab7492 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -124,6 +124,8 @@ def self.store config.add(:doc_auth_error_glare_threshold, type: :integer) config.add(:doc_auth_error_sharpness_threshold, type: :integer) config.add(:doc_auth_max_attempts, type: :integer) + config.add(:doc_auth_manual_upload_disabled_a_b_testing, type: :boolean) + config.add(:doc_auth_manual_upload_disabled_a_b_testing_percent, type: :integer) config.add(:doc_auth_max_capture_attempts_before_native_camera, type: :integer) config.add(:doc_auth_max_submission_attempts_before_native_camera, type: :integer) config.add(:doc_auth_passports_enabled, type: :boolean) diff --git a/spec/config/initializers/ab_tests_spec.rb b/spec/config/initializers/ab_tests_spec.rb index d83e16d9589..078610450ea 100644 --- a/spec/config/initializers/ab_tests_spec.rb +++ b/spec/config/initializers/ab_tests_spec.rb @@ -433,4 +433,28 @@ it_behaves_like 'an A/B test that uses user_uuid as a discriminator' end + + describe 'DOC_AUTH_MANUAL_UPLOAD_DISABLED' do + let(:ab_test) { :DOC_AUTH_MANUAL_UPLOAD_DISABLED } + + let(:enable_ab_test) do + -> { + allow(IdentityConfig.store) + .to receive(:doc_auth_manual_upload_disabled_a_b_testing) + .and_return(true) + allow(IdentityConfig.store) + .to receive(:doc_auth_manual_upload_disabled_a_b_testing_percent) + .and_return(50) + } + end + + let(:disable_ab_test) do + -> { + allow(IdentityConfig.store).to receive(:doc_auth_manual_upload_disabled_a_b_testing) + .and_return(false) + } + end + + it_behaves_like 'an A/B test that uses user_uuid as a discriminator' + end end From 4b088f204d444b1e87d4af8e7ea88a394249acaa Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Mon, 5 May 2025 17:35:28 -0400 Subject: [PATCH 2/4] add changelog changelog: Upcoming Features, Doc Auth, add a/b test for disabling manual document upload From fd708de5d075275c5cacc6bc7e929640135a93af Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Tue, 6 May 2025 09:29:15 -0400 Subject: [PATCH 3/4] change ab testing name to add enabled at the end --- config/application.yml.default | 2 +- config/initializers/ab_tests.rb | 2 +- lib/identity_config.rb | 2 +- spec/config/initializers/ab_tests_spec.rb | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/application.yml.default b/config/application.yml.default index ba1f8a93056..602aa38af09 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -104,7 +104,7 @@ doc_auth_client_sharpness_threshold: 50 doc_auth_error_dpi_threshold: 290 doc_auth_error_glare_threshold: 40 doc_auth_error_sharpness_threshold: 40 -doc_auth_manual_upload_disabled_a_b_testing: false +doc_auth_manual_upload_disabled_a_b_testing_enabled: false doc_auth_manual_upload_disabled_a_b_testing_percent: 50 doc_auth_max_attempts: 5 doc_auth_max_capture_attempts_before_native_camera: 3 diff --git a/config/initializers/ab_tests.rb b/config/initializers/ab_tests.rb index 1c9743a9c0f..2a91282c308 100644 --- a/config/initializers/ab_tests.rb +++ b/config/initializers/ab_tests.rb @@ -136,7 +136,7 @@ def self.all ], buckets: { manual_upload_disabled: - IdentityConfig.store.doc_auth_manual_upload_disabled_a_b_testing ? + IdentityConfig.store.doc_auth_manual_upload_disabled_a_b_testing_enabled ? IdentityConfig.store.doc_auth_manual_upload_disabled_a_b_testing_percent : 0, }, ) do |service_provider:, session:, user:, user_session:, **| diff --git a/lib/identity_config.rb b/lib/identity_config.rb index 10bfcab7492..d9f92391885 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -124,7 +124,7 @@ def self.store config.add(:doc_auth_error_glare_threshold, type: :integer) config.add(:doc_auth_error_sharpness_threshold, type: :integer) config.add(:doc_auth_max_attempts, type: :integer) - config.add(:doc_auth_manual_upload_disabled_a_b_testing, type: :boolean) + config.add(:doc_auth_manual_upload_disabled_a_b_testing_enabled, type: :boolean) config.add(:doc_auth_manual_upload_disabled_a_b_testing_percent, type: :integer) config.add(:doc_auth_max_capture_attempts_before_native_camera, type: :integer) config.add(:doc_auth_max_submission_attempts_before_native_camera, type: :integer) diff --git a/spec/config/initializers/ab_tests_spec.rb b/spec/config/initializers/ab_tests_spec.rb index 078610450ea..8b4e4385402 100644 --- a/spec/config/initializers/ab_tests_spec.rb +++ b/spec/config/initializers/ab_tests_spec.rb @@ -440,7 +440,7 @@ let(:enable_ab_test) do -> { allow(IdentityConfig.store) - .to receive(:doc_auth_manual_upload_disabled_a_b_testing) + .to receive(:doc_auth_manual_upload_disabled_a_b_testing_enabled) .and_return(true) allow(IdentityConfig.store) .to receive(:doc_auth_manual_upload_disabled_a_b_testing_percent) @@ -450,7 +450,7 @@ let(:disable_ab_test) do -> { - allow(IdentityConfig.store).to receive(:doc_auth_manual_upload_disabled_a_b_testing) + allow(IdentityConfig.store).to receive(:doc_auth_manual_upload_disabled_a_b_testing_enabled) .and_return(false) } end From 3cda194e4741bfebc5298eeb98f798e7c2da1c23 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Tue, 6 May 2025 10:13:30 -0400 Subject: [PATCH 4/4] default percent to 0 --- config/application.yml.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.yml.default b/config/application.yml.default index 602aa38af09..6d561995292 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -105,7 +105,7 @@ doc_auth_error_dpi_threshold: 290 doc_auth_error_glare_threshold: 40 doc_auth_error_sharpness_threshold: 40 doc_auth_manual_upload_disabled_a_b_testing_enabled: false -doc_auth_manual_upload_disabled_a_b_testing_percent: 50 +doc_auth_manual_upload_disabled_a_b_testing_percent: 0 doc_auth_max_attempts: 5 doc_auth_max_capture_attempts_before_native_camera: 3 doc_auth_max_submission_attempts_before_native_camera: 3