Agent Flows - Update graphql for get_agent_flows
What does this MR do and why?
This MR updates the get_agent_flows graphql query to now utilize the project scope. This is so we can see all Agent Sessions under a project level and not the user level. This allows us to filter out all workflows of type Chat as well (and IDE for the moment) so that only WEB type sessions display.
This is a follow up of the following MR: !196164 (merged)
Related Issues
GitLab Issue: #550468
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
In your local GitLab rails console: rails c in the gitlab directory, or bin/rails c
- Execute the following in your rails console. This will create a few workflows locally of type
WEBwith different users to validate the UI.
current_user = User.first # The logged-in user
current_project = Project.find(3) # The project we will be querying (it should be `gitlab-org/gitlab-shell`
another_user = User.second
another_project = Project.first
# Current user, but different project: (This should NOT show up on the page)
Ai::DuoWorkflows::Workflow.create!(:workflow_definition => "convert_to_gitlab_ci", user: current_user, project: another_project, environment: "web")
# Current user, current project: (This should show up on the page)
Ai::DuoWorkflows::Workflow.create!(:workflow_definition => "convert_to_gitlab_ci", user: current_user, project: current_project, environment: "web")
# Same project, different user: (This should show up on the page)
Ai::DuoWorkflows::Workflow.create!(:workflow_definition => "convert_to_gitlab_ci", user: another_user, project: current_project, environment: "web")
In your local GDK
- Pull down the latest branch, make sure you are running locally on a SAAS instance (instructions here).
- Go to your
Gitlab-orggroup and find theGitlab-shellproject. - In the left side navigation, there should be the Automate item with the tanuki icon. Click it and go into Agent sessions.
- Validate that the 2 created workflows appear that were created by different users.
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 #550468
Edited by Lindsey Shelton

