Skip to content

Return empty array for approver and approver_group behind FF

What does this MR do and why?

We have both approvers and approver_groups marked as deprecated for project approvals API, but these fields are still returning values.

In this MR, we would introduce one FF. When FF down, it behaves like before; When FF up, we will return empty array for project approvals API, and also project/MR presenters.

References

Issue - Return Empty approvers and approver_groups from... (#573005 - closed)

Screenshots or screen recordings

For local gdk testing, when FF is turned off, we get values for approvers and approver_groups.

Screenshot_2025-09-30_at_5.38.05_pm

When FF is turned on, we get empty array.

Screenshot_2025-09-30_at_5.38.38_pm

How to set up and validate locally

  1. Find one project from local Rails console, and then create its approver and approver_group (should be simple, just some associations).
  2. Get GDK running locally
  3. ::Feature.disable(:deprecate_approver_and_approver_group) in Rails console
  4. Curl curl -H "PRIVATE-TOKEN: YOUR-TOKEN" "http://gdk.test:3000/api/v4/projects/28/approvals"
  5. And see approvers and approver_groups are returned as expected
  6. ::Feature.enable(:deprecate_approver_and_approver_group) in Rails console
  7. Curl curl -H "PRIVATE-TOKEN: YOUR-TOKEN" "http://gdk.test:3000/api/v4/projects/28/approvals"
  8. And see approvers and approver_groups are returned as empty array

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 zli

Merge request reports

Loading