Loading
Persist event source to source_type on duo workflow creation
What does this MR do and why?
Reconciles the source event property with the source_type database column on duo_workflows_workflows.
Previously, the source param (e.g. merge_request_code_conflict, fix_pipeline) was only forwarded to the agent_platform_session_created internal analytics event and was never persisted to the database. The source_type column existed but only held slack and mcp.
This MR:
- Extends the
source_typeenum inAi::DuoWorkflows::Workflowto include all internal GitLab entry points fromWORKFLOW_ACTIONS_SOURCE. - Persists the
sourceparam intosource_typeat workflow creation time via a newsource_type_attributesprivate method inCreateWorkflowService. Unknown or blank source values are silently ignored, preserving backward compatibility.
The source_type column already exists in the database (added in milestone 19.4 by AddSourceTypeAndSourceLinkToDuoWorkflowsWorkflows), so no migration is needed.
References
- #617810 (closed) (this issue)
- https://gitlab.com/gitlab-org/gitlab/-/work_items/605256 (event
sourcetracking) - #603759 (closed) (
source_type+source_linkDB columns) - !247849 (merged) (original
source_typemigration)
How to set up and validate locally
- Run a fix pipeline flow on a failed pipeline
- In the rails console, confirm
source_typewas saved:
pry(main)> Ai::DuoWorkflows::Workflow.last.source_type
...
=> "fix_pipeline"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.
Edited by Roman Eisner