Add triggeredByUserId filter to duoWorkflowSessionArtifacts
What does this MR do and why?
Add the ability to filter duoWorkflowSessionArtifacts by the initiating user, supporting both positive (triggeredByUserId) and negated (not: { triggeredByUserId }) filter arguments. This unblocks the frontend "Triggered By" filtered search bar (#606319).
Changes
- Add
triggeredByUserIdargument toBaseSessionArtifactsResolver(available on both group and project fields) - Add
triggeredByUserIdtoSessionArtifactNegatedFilterInputfor negated filtering - Support both user filters in
ClickHouseFinder - Update GraphQL reference docs
- Add specs for all new filter paths (ClickHouse finder, PostgreSQL finder, group and project GraphQL request specs)
Both filters require ClickHouse, consistent with every other filter on this field
except workflowId. triggeredByUserId is listed in unsupported_pg_args and not: { triggeredByUserId }
is covered by the existing not entry, so the resolver raises the usual
"requires ClickHouse to be enabled for analytics" argument error on the PostgreSQL
path rather than silently returning unfiltered results.
This means no new PostgreSQL queries or model scopes are introduced: PostgresqlFinder
continues to handle only workflowId.
References
- Related to https://gitlab.com/gitlab-org/gitlab/-/issues/607545
- Depends on https://gitlab.com/gitlab-org/gitlab/-/issues/606639 (merged via !247168 (merged))
- Blocks https://gitlab.com/gitlab-org/gitlab/-/issues/606319
Screenshots or screen recordings
How to set up and validate locally
- Enable the feature flag:
Feature.enable(:agent_artifacts_page) - Query
duoWorkflowSessionArtifactswithtriggeredByUserIdargument:query { group(fullPath: "my-group") { duoWorkflowSessionArtifacts(triggeredByUserId: "gid://gitlab/User/1") { nodes { id workflowDefinition } } } } - With ClickHouse enabled, verify only artifacts triggered by that user are returned.
- Test the negated filter with
not: { triggeredByUserId: "gid://gitlab/User/1" }. - Without ClickHouse, verify both filters return a "requires ClickHouse to be enabled for analytics" error.
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.
