feat: Send the workload user's email with the start flow request
What does this MR do and why?
This MR adds the StartWorkflowRequest's workload_user 's (the user triggering the workflow or the service account, if enabled) email address to the request as an ENV variable. The priority for which email to use is commit email > email > static default email.
References
gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#1487 (closed)
gitlab-org/duo-workflow/duo-workflow-executor!239 (merged)
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Enable the composite identity FF
Feature.enable(:duo_workflow_use_composite_identity)
- Add this file to the repository at
.gitlab/duo/agent-config.yml
setup_script:
- echo "$DUO_WORKFLOW_GIT_USER_EMAIL". # To verify the email address
- exit 0 # To skip the actual workflow execution
- Start a new workflow
curl --location 'http://gdk.test:3000/api/v4/ai/duo_workflows/workflows' \
--header 'Content-Type: application/json' \
--header 'PRIVATE-TOKEN: $TOKEN' \
--data '{
"project_id": "1000000",
"goal": "JenkinsFile",
"workflow_definition": "convert_to_gitlab_ci",
"start_workflow": true
}'
Feature.disable(:duo_workflow_use_composite_identity)
-
Repeat step 3, this time, the user's email address will be there
-
Change the user's commit email (preferences -> profile -> main settings) and verify that it changes in the output as well
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 gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#1487 (closed)


