Fix: Hide Automate pages and nav when Duo is disabled
What does this MR do and why?
This MR fixes the bug that was discovered when the Automate pages still display, despite Duo being disabled for the project. The outcome is to have the pages render a 404 and the navigation to be hidden when duo is not available to the project.
References
Screenshots or screen recordings
** Screen Recording **
Screen_Recording_2025-09-09_at_3.28.19_PM
How to set up and validate locally
-
Start your local GDK in SaaS mode.
-
Make sure you have AI features enabled https://docs.gitlab.com/development/ai_features/
-
Turn on the following feature flags:
duo_workflow,duo_workflow_in_ci, andai_flow_triggers -
Navigate to a project with that has AI features enabled (see Step 1).
-
In the left side panel, you will see
Automatewith a tanuki icon. -
Validate if dropdown items appear:
Agent sessionsandFlow triggers. -
Go to your Project settings: Settings > General > GitLab Duo.
-
Turn the toggle to off/disabled for
GitLab Duoand clickSave changes. This disables the duo settings. -
Check your navigation in your project and validate
Automateno longer appears. -
Check the following path in your project and validate a 404 occurs for
Agent sessions: /-/automate/agent-sessions -
Check the following path in your project and validate a 404 occurs for
Flow triggers: /-/automate/flow-triggers -
Go back to your Project settings and enable duo: Settings > General > GitLab Duo.
-
Turn the toggle to on/enabled for
GitLab Duoand clickSave changes. This enables the duo settings again for the project. -
Check your navigation in your project and validate
Automateappears again. -
Go to your parent group settings and disabled GitLab Duo (if top level group go to Settings > GitLab Duo, otherwise go to Settings > General > GitLab Duo).
-
Turn the toggle to never on/disabled for
GitLab Duo. Clicksave changes. -
Go back to your project and validate
Automatedoes not appear anymore in your Project navigation. -
Click the dropdown and select Agent sessions. This will load your agent sessions in that project
-
If you need to populate flows, run the rake task for your project (ee/lib/tasks/gitlab/duo_workflow/duo_workflow.rake)
bundle exec rake "gitlab:duo_workflow:populate[50,20,1,gitlab-duo/test]". -
Validate session items have the appropriate labeling, status and icon.
-
Hover over a session item and notice the hover state matches the design.
-
Click on a session and validate it still re-routes.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #568366 (closed)