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

  1. Start your local GDK in SaaS mode.

  2. Make sure you have AI features enabled https://docs.gitlab.com/development/ai_features/

  3. Turn on the following feature flags: duo_workflow, duo_workflow_in_ci, and ai_flow_triggers

  4. Navigate to a project with that has AI features enabled (see Step 1).

  5. In the left side panel, you will see Automate with a tanuki icon.

  6. Validate if dropdown items appear: Agent sessions and Flow triggers.

  7. Go to your Project settings: Settings > General > GitLab Duo.

  8. Turn the toggle to off/disabled for GitLab Duo and click Save changes. This disables the duo settings.

  9. Check your navigation in your project and validate Automate no longer appears.

  10. Check the following path in your project and validate a 404 occurs for Agent sessions: /-/automate/agent-sessions

  11. Check the following path in your project and validate a 404 occurs for Flow triggers: /-/automate/flow-triggers

  12. Go back to your Project settings and enable duo: Settings > General > GitLab Duo.

  13. Turn the toggle to on/enabled for GitLab Duo and click Save changes. This enables the duo settings again for the project.

  14. Check your navigation in your project and validate Automate appears again.

  15. 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).

  16. Turn the toggle to never on/disabled for GitLab Duo. Click save changes.

  17. Go back to your project and validate Automate does not appear anymore in your Project navigation.

  18. Click the dropdown and select Agent sessions. This will load your agent sessions in that project

  19. 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]".

  20. Validate session items have the appropriate labeling, status and icon.

  21. Hover over a session item and notice the hover state matches the design.

  22. 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)

Merge request reports

Loading