Iteration routes should redirect to cadence routes
What does this MR do and why?
Resolves #355697 (closed).
When :iteration_cadences
FF is enabled, redirect legacy iteration routes to their new cadence routes.
-
An iteration as a resource is really a nested resource under an iteration cadence i.e., a group has many cadences and a cadence has many iterations.
-
When Iteration Cadences is enabled after turning on its FF, iteration routes need to be redirected to their nested routes under cadence resources.
How to set up and validate locally
-
Enable Iterations Cadences in the Rails console.
Feature.enable(:iteration_cadences)
-
Create a new cadence (iterations are automatically created.)
Note the cadence id and one of its iteration id to test routes.
demo
Screen_Recording_2022-04-25_at_12.00.24_PM
In the video the cadence id is 8104
and the iteration id is 8502
.
8104
with your cadence id):
Iterations::Cadences::CreateIterationsInAdvanceService.new(User.automation_bot, Iterations::Cadence.find(8104)).execute
- Check each "legacy" route listed gets redirected to the new nested routes.
page | Legacy route | New nested route | Note |
---|---|---|---|
Iterations list | http://gdk.test:3000/groups/<group path>/-/iterations |
http://gdk.test:3000/groups/<group path>/-/cadences |
There is no standalone iteration list. Iterations are listed within a cadence list. |
New iteration form | http://gdk.test:3000/groups/<group path>/-/iterations/new |
http://gdk.test:3000/groups/<group path>/-/cadences |
The new page needs to be redirected to the cadence list because you can't create an iteration without picking a cadence first on the list. |
Edit iteration form | http://gdk.test:3000/groups/<group path>/-/iterations/<iteration id>/edit |
http://gdk.test:3000/groups/<group path>/-/cadences/<cadence id>/iterations/<iteration id>/edit |
Try using a bogus iteration id or one that user doesn't have access to and check a 404 is returned. |
Iteration show | http://gdk.test:3000/groups/<group path>/-/iterations/<iteration id> |
http://gdk.test:3000/groups/<group path>/-/cadences/<cadence id>/iterations/<iteration id> |
Try using a bogus iteration id or one that user doesn't have access to and check a 404 is returned. |
All iterations/cadences have nested project routes for show
and index
(these merely mirror the group pages):
page | Legacy route | New nested route |
---|---|---|
Iterations list | http://gdk.test:3000/groups/<group path>/<project path>/-/iterations |
http://gdk.test:3000/groups/<group path>/<project path>/-/cadences |
Iteration show | http://gdk.test:3000/groups/<group path>/<project path>/-/iterations/<iteration id> |
http://gdk.test:3000/groups/<group path>/<project path>/-/cadences/<cadence id>/iterations/<iteration id> |
- Additionally check that the redirects don't happen when the feature flag is disabled.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.