Add feature flag to control verify by mail availability#1455
Add feature flag to control verify by mail availability#1455el-mapache merged 1 commit intomasterfrom
Conversation
7bc848b to
a35ab97
Compare
lib/feature_management.rb
Outdated
There was a problem hiding this comment.
What do you think about tying this feature flag to a Figaro entry, similarly to our enable_identity_verification flag so that we can easily turn it on when we're ready without having to modify the IdP code?
Also, did you mean to remove the reveal_usps_code? flag? IIUC, they serve 2 separate purposes. One is to facilitate testing of the USPS flow feature by prefilling the code in the form, and should only be enabled in certain environments. The other is to globally turn on or off the whole USPS feature. If the USPS feature is ON, we still want the code prefilling to be OFF on some servers. In this PR, if I'm reading things correctly, turning on the USPS feature will automatically also prefill the USPS code.
There was a problem hiding this comment.
Yes, but I'll add a separate method since combing them will defeat the purpose of being able to toggle the feature in production without prefilling the code.
There was a problem hiding this comment.
Re: the first part of the comment, I thought our feature flags were entirely handled in the feature management class. I'll look at the enable_identity_verification flag for insight!
There was a problem hiding this comment.
If you look at the FeatureManagement class, you'll notice that pretty much all the methods depend on a Figaro key. The class mainly provides descriptive method names and allows us to add other conditions besides Figaro values.
There was a problem hiding this comment.
What do you think about restricting access at the route level instead, similarly to how we turned off LOA3? https://github.com/18F/identity-idp/blob/master/config/routes.rb#L115
There was a problem hiding this comment.
Ah I didn't see that. I'll change it, I like that much better.
There was a problem hiding this comment.
We can eliminate the need of this additional condition by restricting at the route level.
There was a problem hiding this comment.
This change seems unrelated to the feature flag. Can we move this to a separate PR and open a new issue if there isn't one, assuming it's a bug that this always goes to the address path.
There was a problem hiding this comment.
Is it unrelated? Currently the user won't be redirected to a valid route if the feature flag isn't enabled. Are you saying we ignore that and just accept that the code won't work properly with the feature flag disabled, and address it in a separate PR? Or will moving the USPS feature flag check into the routes address this problem?
I might be missing the point
There was a problem hiding this comment.
Maybe I'm misunderstanding, but I don't think the verify/address page should be restricted since it allows the user to choose between USPS and Phone verification. If the USPS feature is ON, then the USPS button should show up on the verify/address page, otherwise, it should not be shown. In other words, unless this controller was doing something wrong, it should not be changed. What should be changed is the logic in the view to determine when to show the USPS button since address verification can be performed in one of two ways currently. It's the USPS verification that needs to be toggled on or off, not address verification as a whole, right?
There was a problem hiding this comment.
Ok, I understand your point now. We want to err on the side of presenting more information about the process to the user, so I'll add the page back and remove the mail verification option from the view.
191c650 to
bc983b1
Compare
|
@monfresh updated with your feedback thus far |
There was a problem hiding this comment.
I don't think we need to change anything in this spec since we didn't change the controller. It's expected to always redirect to verify/address, whether the feature is enabled or not.
There was a problem hiding this comment.
What do you think about removing these changes since they are cosmetic, to keep this PR focused on the addition of the feature flag?
There was a problem hiding this comment.
Pretty sure the above line is required for the test to pass. If I remove it , it fails. Or is there a better way to do this?
There was a problem hiding this comment.
I guess you meant this blank line?
There was a problem hiding this comment.
I meant that both of the changes in this file are not related to this PR. They are only cosmetic changes. One removes the parentheses around true, and the other is removing a blank line.
There was a problem hiding this comment.
Any particular reason for the change from _url to _path?
There was a problem hiding this comment.
Looks like a lazy copy from the old code, one of the methods had url instead of path
There was a problem hiding this comment.
I don't think this is needed, right?
d2b3b69 to
8a13108
Compare
|
@monfresh updated again |
There was a problem hiding this comment.
Can we leave this file unmodified since this change is not necessary to implement this feature?
**Why**: The entire flow will be conditionally available, so tying the code visibility to the availability of the feature makes sense Gate usps pages, verify/phone view + specs update **Why**: Users shouldnt have the option to verify by mail if the feature is turned off, and they shouldnt be able to directly access the pages Address PR feedback **Why**: There are improvements to be made * Use Figaro config setting * Change name to better match identity_verification flag * Adds route spec * Removes checks on controller level
c51f20b to
de4befd
Compare
|
thank you! |
|
Crap. I forgot we can't merge this until we submit a PR to the devops repo to add this new Figaro flag to dev. |
|
Ugh thats right, should we revert? |
|
No, it's fine. I'm working on the devops PR now. |
This will let us deploy the application to production while smoothing out the LOA3 mail verification flow. The flow will be available in our local and QA environments.
This PR:
usps_controllerindex to the account page