AI fix in progress badge
What does this MR do and why?
Removed the client side resolver for checking if an AI fix was in progress.
Added new workflow field to query.
Check the connected workflows to see if there is an active session.
This change is behind a feature flag agentic_sast_vr_ui.
References
Related to #556999
Screenshots or screen recordings
Youtube demo: https://www.youtube.com/watch?v=mWEXlPUA7IM
How to set up and validate locally
-
In rails console enable the feature flag
Feature.enable(:agentic_sast_vr_ui) -
Have a runner set up
-
Have a group with Duo set up
-
Visit a project with vulnerabilities in the Duo group
-
Manually kick off a workflow with curl command
curl -X POST 'http://host.docker.internal:3000/api/v4/ai/duo_workflows/workflows' \
--header 'Content-Type: application/json' \
--data '{
"project_id": "<project_id>",
"agent_privileges": [1, 2, 3, 4, 5],
"goal": "Fix vulnerability ID: <vulnerability_id>",
"start_workflow": true,
"workflow_definition": "resolve_sast_vulnerability/v1",
"environment": "web",
"source_branch": "security/sast/resolve-vulnerability-670"
}' \
--header 'Authorization: Bearer <PAT_token>'
- Verify that an agent session is created and get the ID
- Use rails console to connect the vulnerability with the agent session
vulnerability = Vulnerability.find(<vulnerability_id>)
workflow = Ai::DuoWorkflows::Workflow.find(<agent_session_id>)dWorkflow.create!(
vulnerability_occurrence = vulnerability.findings.first
triggered_workflow = Vulnerabilities::TriggeredWorkflow.create!(
vulnerability_occurrence: vulnerability_occurrence,
workflow: workflow,
workflow_name: :resolve_sast_vulnerability
)
- Refresh vulnerability report to verify that fix in progress badge renders
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.
