Loading
Catalog the remaining CD deployment gate triggers
What does this MR do and why?
The CD deployment gate already consumes three trigger types (deployment_requested, environment_advanced, deployment_promoted), but only deployment_requested could be authored in the Policy Store (experimental).
- Adds
environment_advancedanddeployment_promotedto the gem catalogue (gems/gitlab-policy-store,Triggers::ALL) and to the frontend editor drawer catalog. - REST/GraphQL catalog endpoints and Grape parameter validation derive from the gem constant, so the new types are picked up automatically. The model enum (values 1 and 2) and
Triggers::TYPESalready existed, so no migration is needed. - Renames the first trigger's display name from "Deployment" to "Deployment requested" so it reads as an event alongside its new siblings and no longer collides with the "Deployment" category label. All three triggers sit under the Deployment category.
- Guard specs pin the catalogue bidirectionally to
Triggers::TYPESand the model enum to the gem, so the two sides cannot drift. - Updates
doc/api/policy_store.md.
References
- Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/604367
- The three trigger type ids come from the
Govern::Policytrigger_typeenum (ee/app/models/govern/policy.rb#L31-33), introduced in !247753 (merged). - The gem's canonical
Triggers::TYPESlist already mirrored all three (gems/gitlab-policy-store/.../triggers.rb#L9), introduced in !251595 (merged). This MR extendsTriggers::ALL(the authoring catalogue) to matchTYPES.
Screenshots or screen recordings
| Before | After |
|---|---|
| N/A (new triggers did not exist) |
Visual verification (local GDK): the Triggers drawer lists all three triggers under the Deployment category with their tooltips; a policy named "Deployment promotion gate" was created end-to-end with the deployment_promoted trigger and an Environment State rule, saved successfully, and appears in the policy list with the new trigger type label. Browser console clean (no errors).
How to set up and validate locally
- Enable the Policy Store experiment for a group in your GDK.
- Go to Secure > Policy store for that group.
- Select Create new policy.
- Open the Triggers tab and confirm the Deployment category lists Deployment requested, Environment advanced, and Deployment promoted.
- Add one of the new triggers plus any rule, then save.
- Confirm the policy appears in the policy list with the new trigger type.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
Edited by Alexander Turinske