Store the created filter on Risk and Reviewers flow triggers

What does this MR do and why?

The Risk Classification ("Risk Assessment" in the UI) and Recommend Reviewers flows have a precondition in code: action eq created. Their triggers are stored with an empty filter. So the "Run when" field in the triggers UI is empty, and a customer cannot see when the flow runs.

This MR provisions new triggers for both flows with the filter action in [created]. Existing triggers still use precondition, so runtime behavior does not change (P AND P = P). The triggers UI now shows "Run when = Created".

This MR also fixes a spec that validates the default_trigger_filter of every flow. The spec now asks the trigger model to validate the filter, because a different allow list checks merge request actions.

This is the first of 3 stacked MRs. Each MR must be deployed before the next one merges.

References

Screenshots or screen recordings

Before After
Screenshot_2026-10-07_at_20.40.37 Screenshot_2026-10-07_at_20.39.11

How to set up and validate locally

  1. In a Rails console, enable the feature flag: Feature.enable(:duo_mr_risk_classification). Risk Classification is behind this flag and needs Ultimate.
  2. Go to the gitlab-duo group, then Settings > General. Expand GitLab Duo features.
  3. Under Flow execution, turn on Risk Assessment and Recommend Reviewers. Select Save changes.
  4. If they were already on, turn them off and save. Then turn them on again and save. This provisions the triggers again with the new code. Wait a moment for the triggers to be created.
  5. Go to http://gdk.test:3000/gitlab-duo/test/-/automate/triggers.
  6. Open the trigger for each flow. Confirm that "Run when" shows Created.
  7. Create a merge request in gitlab-duo/test. Go to Automate > Sessions. Confirm that sessions start for both flows.

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

Merge request reports

Loading
Loading