Rework scrum project feature guards as routing constraints#22348
Open
myabc wants to merge 1 commit intofeature/69139-sprint-task-boardsfrom
Open
Rework scrum project feature guards as routing constraints#22348myabc wants to merge 1 commit intofeature/69139-sprint-task-boardsfrom
myabc wants to merge 1 commit intofeature/69139-sprint-task-boardsfrom
Conversation
Use Constraints::FeatureDecision for the scrum-only sprint and backlog sharing routes, and move the inactive-flag expectations from controller specs into routing specs. #22086
13 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves scrum_projects feature-flag gating for the Backlogs “new Agile sprint” endpoints and backlog sharing settings from controller-level checks to route-level constraints, and updates specs accordingly.
Changes:
- Wrap new sprint-related routes and backlog sharing settings routes in
Constraints::FeatureDecision.new(:scrum_projects). - Remove controller-level feature flag guards that are now redundant due to routing constraints.
- Update/add routing specs to assert routes are (not) available depending on the flag.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| modules/backlogs/config/routes.rb | Gates new sprint + backlog sharing settings routes behind scrum_projects routing constraint. |
| modules/backlogs/app/controllers/rb_sprints_controller.rb | Removes feature-flag authorization checks now handled by routing. |
| modules/backlogs/app/controllers/projects/settings/backlog_sharings_controller.rb | Removes feature-flag 404 guard now handled by routing. |
| modules/backlogs/spec/routing/rb_sprints_routing_spec.rb | Adds routing expectations for flag active/inactive cases. |
| modules/backlogs/spec/routing/rb_stories_routing_spec.rb | Adds routing expectations for the flagged move route. |
| modules/backlogs/spec/routing/projects/settings/backlog_sharings_routing_spec.rb | New routing spec covering backlog sharing settings routes under the flag. |
| modules/backlogs/spec/controllers/rb_sprints_controller_spec.rb | Removes “flag inactive” controller examples (now unroutable). |
| modules/backlogs/spec/controllers/projects/settings/backlog_sharings_controller_spec.rb | Removes “flag inactive” controller examples (now unroutable). |
| modules/backlogs/spec/features/projects/settings/backlog_sharing_settings_spec.rb | Drops direct-access 404 assertion when the flag is inactive. |
You can also share your feedback on Copilot code review. Take the survey.
modules/backlogs/spec/features/projects/settings/backlog_sharing_settings_spec.rb
Show resolved
Hide resolved
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.
Important
This PR is based off #22086. Please review/merge that PR first.
Ticket
n/a
What are you trying to accomplish?
Use
Constraints::FeatureDecisionfor the scrum-only sprint and backlog sharing routes, and move the inactive-flag expectations from controller specs into routing specs.What approach did you choose and why?
routing constraints are a cleaner and more concise way of adding guards for functionality behind feature flags
Merge checklist