[go: up one dir, main page]

Skip to content

Consistently disable Pipeline Must Succeed setting for security policy projects

What does this MR do and why?

In !162462 (merged) we introduced an override for the Pipeline success for auto-merge project setting for security policy projects. We enforce an effective value of false.

This merge request solves two related problems:

  • The override is not reflected in the project settings UI, which still allows users to tick the checkbox for the setting. But changes to the setting don't reflect in the checkbox state on save.
  • The API may still respond with a value of true instead of the overriding false.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Enable the feature flag:
echo "Feature.enable(:security_policy_project_pipeline_must_succeed)" | rails c
  1. Create two projects, A and B
  2. On the project-level of B, navigate to Settings > Merge requests, enable Pipelines must succeed and Save changes
  3. On the project-level of A, navigate to Secure > Policies, click Edit policy project, select project B and Save
  4. On the project-level of B, navigate to Settings > Merge requests and verify the Pipelines must succeed setting is locked with the expected popover message
  5. Note the project ID of B and verify its only_allow_merge_if_pipeline_succeeds property is false in API responses:
curl -sH "PRIVATE-TOKEN: $GITLAB_TOKEN" http://gdk.test:3000/api/v4/projects/$PROJECT_ID | jq '.only_allow_merge_if_pipeline_succeeds'
false
  1. Disable the feature flag and verify the current behaviour is restored:
echo "Feature.disable(:security_policy_project_pipeline_must_succeed)" | rails c

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 #534276 (closed)

Edited by Dominic Bauer

Merge request reports

Loading