LG-11688 Enforce the IdV available rule in a concern#9665
Merged
Conversation
We have been discussing feature flags that can be toggled while the applicaiton is running. This would be an issue for the feature flags that drive `FeatureManagement#idv_available?`. That method is used in the routes file to handle routing for IdV routes when IdV is unavailable. This means that to change those feature flags while the app is running carries a requirement to redraw routes. This commit makes a change to move equivalent logic to the routes file to the `Idv::Availability` concern. This concern is then included in all of the controller that were previously affected by the rule in the routes file. changelog: Internal, IdV Availability, IdV availability is computed in a concern instead of the routes file
Contributor
Author
|
I opted for a concern that we can explicitly include in controllers instead of including it in a shared concern for 2 reasons:
|
Comment on lines
-310
to
-314
| if !FeatureManagement.idv_available? | ||
| # IdV has been disabled. | ||
| match '/*path' => 'unavailable#show', via: %i[get post] | ||
| end | ||
|
|
Comment on lines
-65
to
-69
|
|
||
| # Configuration / vendor status changes can effect Rails routing tables. | ||
| # Force routes to be reloaded when we've modified configuration. | ||
| Rails.application.reload_routes! | ||
| end |
zachmargolis
approved these changes
Nov 27, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have been discussing feature flags that can be toggled while the applicaiton is running. This would be an issue for the feature flags that drive
FeatureManagement#idv_available?. That method is used in the routes file to handle routing for IdV routes when IdV is unavailable. This means that to change those feature flags while the app is running carries a requirement to redraw routes.This commit makes a change to move equivalent logic to the routes file to the
Idv::Availabilityconcern. This concern is then included in all of the controller that were previously affected by the rule in the routes file.