Skip to content

Rework scrum project feature guards as routing constraints#22348

Open
myabc wants to merge 1 commit intofeature/69139-sprint-task-boardsfrom
code-maintenance/scrum-projects-routing-constraint
Open

Rework scrum project feature guards as routing constraints#22348
myabc wants to merge 1 commit intofeature/69139-sprint-task-boardsfrom
code-maintenance/scrum-projects-routing-constraint

Conversation

@myabc
Copy link
Contributor

@myabc myabc commented Mar 13, 2026

Important

This PR is based off #22086. Please review/merge that PR first.

Ticket

n/a

What are you trying to accomplish?

Use Constraints::FeatureDecision for 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

  • Added/updated tests
  • Tested major browsers (Chrome, Firefox, Edge, ...)

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
@myabc myabc added maintenance ruby Pull requests that update Ruby code labels Mar 14, 2026
@myabc myabc added this to the 17.3.x milestone Mar 14, 2026
@myabc myabc changed the title Move scrum guards into routes Rework scrum project feature guards as routing constraints Mar 16, 2026
@myabc myabc marked this pull request as ready for review March 16, 2026 06:34
Copilot AI review requested due to automatic review settings March 16, 2026 06:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

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

Labels

maintenance ruby Pull requests that update Ruby code

Development

Successfully merging this pull request may close these issues.

2 participants