Wire `author_source` into `completed_pipeline_execution` and `first_pipeline_succeeded` events
What does this MR do and why?
Part of #596636 — identifying agent-generated pipeline configs to filter Config Quality and Time-to-first-pipeline metrics to AI-guided flows.
Previous MRs in this chain established the foundation:
- Add `author_source` property to CI config inter... (!232453 - merged) added
author_sourceto thecommit_change_to_ciconfigfileandcreate_ci_config_fileinternal events by reading theDuo-Workflow-Definitiongit trailer at commit time. - Add ci_config_author_source column to ci_projec... (!232740 - merged) added the
ci_config_generated_bycolumn toci_project_metricsand atrack_ai_generated_config!upsert, which persists the trailer value when an AI agent commits a CI config.
This MR closes the loop by surfacing author_source on the two downstream events that analytics actually uses:
completed_pipeline_execution— fires on every pipeline completion;author_sourcelets us segment Config Quality metrics by whether the pipeline was set up by a human or an AI agent.first_pipeline_succeeded— fires on Time-to-first-pipeline;author_sourcelets us compare TTFP for AI-guided onboarding vs. manual onboarding.
Because these events fire from the pipeline execution context, not from a git push, we cannot read the git trailer there directly. Instead we look up the persisted value from ci_project_metrics at event-fire time. When no AI agent trailer was recorded for the project, the value defaults to 'human'.
References
- Issue: Identify agent-generated pipeline configs using... (#596636)
- Persistence foundation: Add ci_config_author_source column to ci_projec... (!232740 - merged)
- CI config commit events: Add `author_source` property to CI config inter... (!232453 - merged)
Edited by Sahil Sharma