[Experiment] Add a flag-gated Duo home route and homepage preference

Stack (merge in this order)

Order MR Change
1 Sync routes for gitlab-org/gitlab!269673 (Duo home dashboard) HTTP router route sync
2 Add a flag-gated Duo home route and homepage preference Backend: flag, route, gate, homepage preference (this MR)
3 Add a flag-gated, Duo home dashboard page under a user preference Frontend: page app, embedded chat, sessions feed

What does this MR do and why?

Adds the backend for an experimental Duo-first home page at /dashboard/duo_home, behind the sdlc_duo_home feature flag (wip, default off) for internal testing. Part of SDLC Chrome and Panel Readiness.

The two commits read in order:

  1. The route behind the flag. GET /dashboard/duo_home renders the page's mount node for users who pass one helper, duo_home_available?, and returns 404 for everyone else. CE returns false. The EE override requires the flag and the access_duo_agentic_chat ability, because the page is built around the agentic chat and a user without it would land on an empty page. The route, action, and view live under ee/, so a FOSS build carries no unrouted action.
  2. The homepage preference. While the gate passes, "Duo home" is listed under Preferences > Behavior > Homepage, and EE::RootController#redirect_logged_user sends a user who picked it there, next to the operations dashboard's redirect. The enum value is additive, so there is no migration. As with homepage and operations, the option list is filtered at render and the write path accepts the value regardless. A user already saved on it keeps the option listed after the gate closes, so the saved choice still renders and can be changed, while the landing falls through to the default dashboard.

Until the page app merges, the route serves an empty mount node. The flag is off by default.

The new route needs the matching sync in the HTTP router, Sync routes for gitlab-org/gitlab!269673 (Duo home dashboard), which has to merge first now that cells-routes:router-in-sync blocks.

Screenshots or screen recordings

The one visible change is the new option in the Homepage list. Preferences > Behavior with the Homepage list open and scrolled to its end:

Before (master) After (gate open)
homepage_list_before homepage_list_after

How to set up and validate locally

  1. In a Rails console, enable the flag for a user with agentic Duo Chat: Feature.enable(:sdlc_duo_home, User.find_by_username('root')).
  2. Go to Preferences > Behavior > Homepage and pick "Duo home". Select the GitLab logo: it lands on /dashboard/duo_home, an empty page until the page app merges.
  3. Disable the flag: /dashboard/duo_home returns 404, the logo lands on the default dashboard, and "Duo home" stays listed so it can be changed.

Request, controller, and helper specs cover both gate states and the redirect.

Edited by Paul W

Merge request reports

Loading
Loading