Loading
Use risk classification flow 2.0.0 behind a feature flag
What does this MR do and why?
The Risk Assessment flow runs on every new merge request, and every run clones the full repository first. On gitlab-org/gitlab, that clone takes about 5 minutes and loads Gitaly, but the flow hardly uses it.
Flow version 2.0.0 in the AI Gateway reads files through the API only. This MR makes the flow use 2.0.0 for projects with the duo_mr_risk_classification_no_checkout feature flag. The flow still clones the repository, so we can compare the classification quality with 1.0.0 before we remove the clone.
This is the first of two steps:
- This MR: use 2.0.0, still with a clone.
- Skip the clone: !268121
References
- Work item: #634931
- Flow version 2.0.0 in the AI Gateway: gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!7854 (merged)
- Feature flag rollout: #638483
Screenshots or screen recordings
Not applicable. There is no UI change.
How to set up and validate locally
- In GDK, check out the AI Gateway from gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!7854 (merged) and restart DWS.
- In a Rails console, enable the Risk Assessment flow for
gitlab-duo/test. You will need to enable these flags before:Feature.enable(:show_duo_mr_risk_classification_widget) Feature.enable(:duo_mr_risk_classification) - Create a merge request in
gitlab-duo/test. Make sure that the CI job of the session clones the repository and that DWS loadsrisk_classification1.0.0. - Enable the new flag:
Feature.enable(:duo_mr_risk_classification_no_checkout) - Create a merge request that changes a migration or an authorization-related file. The CI job still clones the repository, but DWS now loads 2.0.0.
- Make sure that the merge request widget shows the risk assessment.
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 Wanderson Policarpo