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

use email address for unique-ish id for feature toggles #3323

Merged
merged 4 commits into from
Sep 23, 2019

Conversation

annaswims
Copy link
Contributor

Description of change

I think we would be better off using email address as the identifier for our feature toggles. It's a lot easier to manage, say if we want to enable a feature for a specific user like this:
Screen Shot 2019-09-20 at 1 08 53 PM

Otherwise we'd have to ask the user to log in and find their uuid, which is cumbersome.

The user code allows for nil email addresses (though I thing we always have one), so on the odd chance they don't have one we can fall back to using account_uuid.

Presuming the user uses the same email address across their DS Logon/ID.me/MHV accounts they would see the same behavior across login types

ruby toggle_threshold.rb my_feature_name

# toggle_threshold.rb
require 'zlib'

feature_name = ARGV.first
puts "the feature #{feature_name} will be enabled for the user if the 'Percentage of Logged in Users' setting is greater than the threshold"
puts "Email, threshold"

(1..300).each do |num|
  email = "vets.gov.user+#{num}@gmail.com"
 threshold = (Zlib.crc32("#{feature_name}User;#{email}") % (100 * 1_000))/1_000.0
 puts "#{email}, #{threshold}"
end

Testing done

tested locally that I could enable an individual actor by email address

Testing planned

verify on staging

Applies to all PRs

  • Appropriate logging
  • Swagger docs have been updated, if applicable
  • Provide link to originating GitHub issue, or connected to it via ZenHub
  • Does not contain any sensitive information (i.e. PII/credentials/internal URLs/etc., in logging, hardcoded, or in specs)
  • Provide which alerts would indicate a problem with this functionality (if applicable)

@annaswims annaswims requested review from a team as code owners September 20, 2019 17:18
@annaswims
Copy link
Contributor Author

@erikphansen

the feature profile_show_direct_deposit will be enabled for the user if the 'Percentage of Logged in Users' setting is greater than the threshold
Email, threshold
vets.gov.user+1@gmail.com, 63.194
vets.gov.user+2@gmail.com, 97.243
vets.gov.user+3@gmail.com, 21.723
vets.gov.user+4@gmail.com, 3.64
vets.gov.user+5@gmail.com, 37.176
vets.gov.user+6@gmail.com, 58.841
vets.gov.user+7@gmail.com, 18.137
vets.gov.user+8@gmail.com, 50.431
vets.gov.user+9@gmail.com, 43.231
vets.gov.user+10@gmail.com, 40.778
vets.gov.user+11@gmail.com, 76.266
vets.gov.user+12@gmail.com, 12.843
vets.gov.user+13@gmail.com, 99.883
vets.gov.user+14@gmail.com, 66.344
vets.gov.user+15@gmail.com, 30.216
vets.gov.user+16@gmail.com, 13.641
vets.gov.user+17@gmail.com, 46.761
vets.gov.user+18@gmail.com, 5.135
vets.gov.user+19@gmail.com, 32.911
vets.gov.user+20@gmail.com, 97.306
vets.gov.user+21@gmail.com, 26.554
vets.gov.user+22@gmail.com, 45.403
vets.gov.user+23@gmail.com, 32.315
vets.gov.user+24@gmail.com, 2.456
vets.gov.user+25@gmail.com, 69.752
vets.gov.user+26@gmail.com, 86.329
vets.gov.user+27@gmail.com, 91.545
vets.gov.user+28@gmail.com, 99.135
vets.gov.user+29@gmail.com, 2.527
vets.gov.user+30@gmail.com, 6.549
vets.gov.user+31@gmail.com, 36.149
vets.gov.user+32@gmail.com, 75.476
vets.gov.user+33@gmail.com, 3.38
vets.gov.user+34@gmail.com, 90.839
vets.gov.user+35@gmail.com, 4.183
vets.gov.user+36@gmail.com, 53.718
vets.gov.user+37@gmail.com, 45.622
vets.gov.user+38@gmail.com, 60.784
vets.gov.user+39@gmail.com, 10.48
vets.gov.user+40@gmail.com, 9.722
vets.gov.user+41@gmail.com, 60.57
vets.gov.user+42@gmail.com, 89.819
vets.gov.user+43@gmail.com, 7.579
vets.gov.user+44@gmail.com, 91.384
vets.gov.user+45@gmail.com, 11.512
vets.gov.user+46@gmail.com, 71.129
vets.gov.user+47@gmail.com, 45.145
vets.gov.user+48@gmail.com, 41.791
vets.gov.user+49@gmail.com, 31.679
vets.gov.user+50@gmail.com, 81.013
vets.gov.user+51@gmail.com, 28.597
vets.gov.user+52@gmail.com, 90.292
vets.gov.user+53@gmail.com, 47.764
vets.gov.user+54@gmail.com, 14.263
vets.gov.user+55@gmail.com, 7.639
vets.gov.user+56@gmail.com, 81.366
vets.gov.user+57@gmail.com, 71.606
vets.gov.user+58@gmail.com, 91.376
vets.gov.user+59@gmail.com, 54.256
vets.gov.user+60@gmail.com, 36.069
vets.gov.user+61@gmail.com, 62.437
vets.gov.user+62@gmail.com, 88.932
vets.gov.user+63@gmail.com, 96.196
vets.gov.user+64@gmail.com, 67.335
vets.gov.user+65@gmail.com, 12.295
vets.gov.user+66@gmail.com, 5.798
vets.gov.user+67@gmail.com, 46.726
vets.gov.user+68@gmail.com, 25.664
vets.gov.user+69@gmail.com, 1.12
vets.gov.user+70@gmail.com, 79.498
vets.gov.user+71@gmail.com, 55.722
vets.gov.user+72@gmail.com, 93.835
vets.gov.user+73@gmail.com, 10.315
vets.gov.user+74@gmail.com, 89.896
vets.gov.user+75@gmail.com, 30.408
vets.gov.user+76@gmail.com, 48.009
vets.gov.user+77@gmail.com, 43.849
vets.gov.user+78@gmail.com, 4.047
vets.gov.user+79@gmail.com, 74.799
vets.gov.user+80@gmail.com, 81.723
vets.gov.user+81@gmail.com, 70.843
vets.gov.user+82@gmail.com, 14.234
vets.gov.user+83@gmail.com, 65.434
vets.gov.user+84@gmail.com, 78.937
vets.gov.user+85@gmail.com, 6.233
vets.gov.user+86@gmail.com, 14.456
vets.gov.user+87@gmail.com, 84.088
vets.gov.user+88@gmail.com, 42.654
vets.gov.user+89@gmail.com, 13.086
vets.gov.user+90@gmail.com, 80.82
vets.gov.user+91@gmail.com, 11.06
vets.gov.user+92@gmail.com, 34.325
vets.gov.user+93@gmail.com, 86.005
vets.gov.user+94@gmail.com, 95.158
vets.gov.user+95@gmail.com, 9.014
vets.gov.user+96@gmail.com, 9.847
vets.gov.user+97@gmail.com, 25.399
vets.gov.user+98@gmail.com, 85.585
vets.gov.user+99@gmail.com, 42.321
vets.gov.user+100@gmail.com, 87.359
vets.gov.user+101@gmail.com, 70.911
vets.gov.user+102@gmail.com, 10.59
vets.gov.user+103@gmail.com, 63.39
vets.gov.user+104@gmail.com, 85.149
vets.gov.user+105@gmail.com, 5.725
vets.gov.user+106@gmail.com, 10.364
vets.gov.user+107@gmail.com, 82.492
vets.gov.user+108@gmail.com, 48.858
vets.gov.user+109@gmail.com, 12.57
vets.gov.user+110@gmail.com, 74.672
vets.gov.user+111@gmail.com, 11.504
vets.gov.user+112@gmail.com, 38.481
vets.gov.user+113@gmail.com, 87.537
vets.gov.user+114@gmail.com, 89.458
vets.gov.user+115@gmail.com, 9.01
vets.gov.user+116@gmail.com, 13.427
vets.gov.user+117@gmail.com, 27.507
vets.gov.user+118@gmail.com, 79.893
vets.gov.user+119@gmail.com, 42.325
vets.gov.user+120@gmail.com, 4.0
vets.gov.user+121@gmail.com, 6.528
vets.gov.user+122@gmail.com, 13.729
vets.gov.user+123@gmail.com, 94.817
vets.gov.user+124@gmail.com, 19.138
vets.gov.user+125@gmail.com, 72.514
vets.gov.user+126@gmail.com, 12.131
vets.gov.user+127@gmail.com, 63.811
vets.gov.user+128@gmail.com, 64.165
vets.gov.user+129@gmail.com, 74.661
vets.gov.user+130@gmail.com, 40.271
vets.gov.user+131@gmail.com, 18.383
vets.gov.user+132@gmail.com, 0.078
vets.gov.user+133@gmail.com, 16.11
vets.gov.user+134@gmail.com, 69.133
vets.gov.user+135@gmail.com, 74.605
vets.gov.user+136@gmail.com, 70.38
vets.gov.user+137@gmail.com, 33.516
vets.gov.user+138@gmail.com, 69.962
vets.gov.user+139@gmail.com, 32.298
vets.gov.user+140@gmail.com, 89.664
vets.gov.user+141@gmail.com, 93.856
vets.gov.user+142@gmail.com, 32.705
vets.gov.user+143@gmail.com, 33.761
vets.gov.user+144@gmail.com, 79.778
vets.gov.user+145@gmail.com, 3.586
vets.gov.user+146@gmail.com, 42.211
vets.gov.user+147@gmail.com, 75.907
vets.gov.user+148@gmail.com, 63.397
vets.gov.user+149@gmail.com, 72.805
vets.gov.user+150@gmail.com, 42.159
vets.gov.user+151@gmail.com, 51.471
vets.gov.user+152@gmail.com, 68.75
vets.gov.user+153@gmail.com, 31.95
vets.gov.user+154@gmail.com, 49.261
vets.gov.user+155@gmail.com, 23.885
vets.gov.user+156@gmail.com, 53.42
vets.gov.user+157@gmail.com, 94.956
vets.gov.user+158@gmail.com, 77.066
vets.gov.user+159@gmail.com, 37.546
vets.gov.user+160@gmail.com, 57.535
vets.gov.user+161@gmail.com, 78.367
vets.gov.user+162@gmail.com, 62.494
vets.gov.user+163@gmail.com, 38.654
vets.gov.user+164@gmail.com, 46.557
vets.gov.user+165@gmail.com, 37.693
vets.gov.user+166@gmail.com, 84.956
vets.gov.user+167@gmail.com, 16.348
vets.gov.user+168@gmail.com, 54.202
vets.gov.user+169@gmail.com, 59.482
vets.gov.user+170@gmail.com, 50.736
vets.gov.user+171@gmail.com, 15.376
vets.gov.user+172@gmail.com, 65.137
vets.gov.user+173@gmail.com, 25.745
vets.gov.user+174@gmail.com, 53.49
vets.gov.user+175@gmail.com, 64.946
vets.gov.user+176@gmail.com, 59.507
vets.gov.user+177@gmail.com, 51.859
vets.gov.user+178@gmail.com, 34.421
vets.gov.user+179@gmail.com, 60.277
vets.gov.user+180@gmail.com, 31.809
vets.gov.user+181@gmail.com, 69.441
vets.gov.user+182@gmail.com, 22.432
vets.gov.user+183@gmail.com, 61.76
vets.gov.user+184@gmail.com, 40.835
vets.gov.user+185@gmail.com, 60.259
vets.gov.user+186@gmail.com, 47.49
vets.gov.user+187@gmail.com, 88.354
vets.gov.user+188@gmail.com, 35.428
vets.gov.user+189@gmail.com, 18.5
vets.gov.user+190@gmail.com, 3.918
vets.gov.user+191@gmail.com, 7.438
vets.gov.user+192@gmail.com, 86.287
vets.gov.user+193@gmail.com, 32.143
vets.gov.user+194@gmail.com, 95.468
vets.gov.user+195@gmail.com, 95.404
vets.gov.user+196@gmail.com, 52.045
vets.gov.user+197@gmail.com, 14.061
vets.gov.user+198@gmail.com, 34.251
vets.gov.user+199@gmail.com, 98.091
vets.gov.user+200@gmail.com, 68.817
vets.gov.user+201@gmail.com, 70.385
vets.gov.user+202@gmail.com, 26.032
vets.gov.user+203@gmail.com, 86.064
vets.gov.user+204@gmail.com, 96.243
vets.gov.user+205@gmail.com, 78.195
vets.gov.user+206@gmail.com, 66.834
vets.gov.user+207@gmail.com, 94.226
vets.gov.user+208@gmail.com, 82.228
vets.gov.user+209@gmail.com, 33.684
vets.gov.user+210@gmail.com, 91.518
vets.gov.user+211@gmail.com, 88.382
vets.gov.user+212@gmail.com, 68.127
vets.gov.user+213@gmail.com, 83.327
vets.gov.user+214@gmail.com, 39.804
vets.gov.user+215@gmail.com, 71.356
vets.gov.user+216@gmail.com, 71.613
vets.gov.user+217@gmail.com, 8.477
vets.gov.user+218@gmail.com, 81.339
vets.gov.user+219@gmail.com, 82.651
vets.gov.user+220@gmail.com, 89.262
vets.gov.user+221@gmail.com, 54.062
vets.gov.user+222@gmail.com, 51.535
vets.gov.user+223@gmail.com, 5.167
vets.gov.user+224@gmail.com, 49.932
vets.gov.user+225@gmail.com, 44.428
vets.gov.user+226@gmail.com, 11.533
vets.gov.user+227@gmail.com, 9.933
vets.gov.user+228@gmail.com, 72.939
vets.gov.user+229@gmail.com, 97.675
vets.gov.user+230@gmail.com, 12.257
vets.gov.user+231@gmail.com, 50.049
vets.gov.user+232@gmail.com, 61.632
vets.gov.user+233@gmail.com, 31.744
vets.gov.user+234@gmail.com, 21.347
vets.gov.user+235@gmail.com, 12.323
vets.gov.user+236@gmail.com, 11.874
vets.gov.user+237@gmail.com, 50.242
vets.gov.user+238@gmail.com, 70.82
vets.gov.user+239@gmail.com, 92.292
vets.gov.user+240@gmail.com, 42.414
vets.gov.user+241@gmail.com, 89.326
vets.gov.user+242@gmail.com, 43.759
vets.gov.user+243@gmail.com, 93.647
vets.gov.user+244@gmail.com, 94.924
vets.gov.user+245@gmail.com, 4.812
vets.gov.user+246@gmail.com, 61.517
vets.gov.user+247@gmail.com, 92.077
vets.gov.user+248@gmail.com, 24.843
vets.gov.user+249@gmail.com, 98.635
vets.gov.user+250@gmail.com, 30.657
vets.gov.user+251@gmail.com, 23.873
vets.gov.user+252@gmail.com, 11.264
vets.gov.user+253@gmail.com, 47.584
vets.gov.user+254@gmail.com, 4.035
vets.gov.user+255@gmail.com, 14.531
vets.gov.user+256@gmail.com, 91.714
vets.gov.user+257@gmail.com, 63.01
vets.gov.user+258@gmail.com, 7.492
vets.gov.user+259@gmail.com, 81.636
vets.gov.user+260@gmail.com, 30.129
vets.gov.user+261@gmail.com, 5.745
vets.gov.user+262@gmail.com, 28.336
vets.gov.user+263@gmail.com, 53.68
vets.gov.user+264@gmail.com, 97.459
vets.gov.user+265@gmail.com, 22.227
vets.gov.user+266@gmail.com, 79.634
vets.gov.user+267@gmail.com, 34.386
vets.gov.user+268@gmail.com, 58.548
vets.gov.user+269@gmail.com, 19.668
vets.gov.user+270@gmail.com, 26.91
vets.gov.user+271@gmail.com, 10.142
vets.gov.user+272@gmail.com, 55.711
vets.gov.user+273@gmail.com, 45.183
vets.gov.user+274@gmail.com, 42.652
vets.gov.user+275@gmail.com, 98.524
vets.gov.user+276@gmail.com, 97.245
vets.gov.user+277@gmail.com, 39.613
vets.gov.user+278@gmail.com, 48.187
vets.gov.user+279@gmail.com, 40.155
vets.gov.user+280@gmail.com, 99.759
vets.gov.user+281@gmail.com, 14.255
vets.gov.user+282@gmail.com, 54.542
vets.gov.user+283@gmail.com, 65.134
vets.gov.user+284@gmail.com, 34.381
vets.gov.user+285@gmail.com, 47.629
vets.gov.user+286@gmail.com, 55.724
vets.gov.user+287@gmail.com, 80.14
vets.gov.user+288@gmail.com, 53.322
vets.gov.user+289@gmail.com, 52.426
vets.gov.user+290@gmail.com, 68.384
vets.gov.user+291@gmail.com, 68.416
vets.gov.user+292@gmail.com, 94.241
vets.gov.user+293@gmail.com, 46.881
vets.gov.user+294@gmail.com, 58.338
vets.gov.user+295@gmail.com, 42.498
vets.gov.user+296@gmail.com, 92.579
vets.gov.user+297@gmail.com, 44.419
vets.gov.user+298@gmail.com, 50.821
vets.gov.user+299@gmail.com, 20.581
vets.gov.user+300@gmail.com, 89.844

@va-vfs-bot va-vfs-bot temporarily deployed to change_feature_toggle_id/master September 20, 2019 21:28 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to change_feature_toggle_id/master September 23, 2019 15:01 Inactive
Copy link
Contributor

@omgitsbillryan omgitsbillryan left a comment

Choose a reason for hiding this comment

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

LGTM, but I'm a bit OOL in considering what negative consequences may arise from such a change.

Copy link
Contributor

@jholton jholton left a comment

Choose a reason for hiding this comment

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

LGTM

@jholton jholton merged commit 6536901 into master Sep 23, 2019
@johnpaulashenfelter johnpaulashenfelter deleted the change_feature_toggle_id branch October 10, 2019 16:13
@annaswims annaswims added the VSP VSP Contract label Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VSP VSP Contract
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants