Skip to content

Add feature flag to control verify by mail availability#1455

Merged
el-mapache merged 1 commit intomasterfrom
ab-add-activate-by-mail-flag
Jun 1, 2017
Merged

Add feature flag to control verify by mail availability#1455
el-mapache merged 1 commit intomasterfrom
ab-add-activate-by-mail-flag

Conversation

@el-mapache
Copy link
Contributor

@el-mapache el-mapache commented May 25, 2017

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:

  • Always redirects the user to the phone verification option after they confirm their financial information
  • Removes the link to the verify by mail page from the phone verification page
  • Redirects users who attempt to manually visit the verification options page, usps confirmation code entry page, or usps_controller index to the account page

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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!

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I didn't see that. I'll change it, I like that much better.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can eliminate the need of this additional condition by restricting at the route level.

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

@el-mapache el-mapache May 30, 2017

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

@el-mapache el-mapache force-pushed the ab-add-activate-by-mail-flag branch from 191c650 to bc983b1 Compare May 30, 2017 20:35
@el-mapache
Copy link
Contributor Author

@monfresh updated with your feedback thus far

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about removing these changes since they are cosmetic, to keep this PR focused on the addition of the feature flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess you meant this blank line?

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

s/does not route/routes

Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason for the change from _url to _path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like a lazy copy from the old code, one of the methods had url instead of path

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is needed, right?

@el-mapache el-mapache force-pushed the ab-add-activate-by-mail-flag branch from d2b3b69 to 8a13108 Compare May 31, 2017 13:45
@el-mapache
Copy link
Contributor Author

@monfresh updated again

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we leave this file unmodified since this change is not necessary to implement this feature?

Copy link
Contributor

@monfresh monfresh left a comment

Choose a reason for hiding this comment

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

lgtm. Thanks!

**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
@el-mapache el-mapache force-pushed the ab-add-activate-by-mail-flag branch from c51f20b to de4befd Compare June 1, 2017 15:20
@el-mapache
Copy link
Contributor Author

thank you!

@el-mapache el-mapache merged commit 8efadb3 into master Jun 1, 2017
@el-mapache el-mapache deleted the ab-add-activate-by-mail-flag branch June 1, 2017 16:11
@monfresh
Copy link
Contributor

monfresh commented Jun 1, 2017

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.

@el-mapache
Copy link
Contributor Author

Ugh thats right, should we revert?

@monfresh
Copy link
Contributor

monfresh commented Jun 1, 2017

No, it's fine. I'm working on the devops PR now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants