Expose reviewer_assignment_strategy project setting via the API

Summary

The reviewer_assignment_strategy project setting (which drives the native CODEOWNERS / DAP reviewer auto-assignment feature, FF auto_assign_code_owner_reviewers) can currently only be changed through the project settings UI (Settings → Merge requests → "Automatic reviewer assignment"). It is not exposed through any API, unlike most other project_setting columns.

Current state

  • Setting lives on project_setting.reviewer_assignment_strategy (enum: disabled: 0, code_owners: 1, dap_powered: 2) — app/models/project_setting.rb.
  • Write path is UI-only via EE::Projects::Settings::MergeRequestsController (ee/app/controllers/ee/projects/settings/merge_requests_controller.rb), gated by project.reviewer_auto_assignment_available?.
  • Not in the REST PUT /projects/:id permitted params (lib/api/helpers/projects_helpers.rb).
  • Not an argument of the GraphQL ProjectSettingsUpdate mutation (ee/app/graphql/mutations/projects/project_settings_update.rb).

Problem

While the feature flag rolls out (#590879 (closed)), there is no way to enable/configure the strategy programmatically or in bulk across projects. Admins must toggle each project by hand in the UI.

Scope

This is an edit-only capability — the setting should be exposed on the project update endpoint, not on project creation. The reviewer_auto_assignment_available? gate (license + availability) is evaluated against an existing project, so there's no meaningful create-time use.

Proposal

Expose reviewer_assignment_strategy through the API, respecting the same reviewer_auto_assignment_available? (license + availability) gate as the UI:

  1. REST (edit only) — add reviewer_assignment_strategy (values: disabled, code_owners, dap_powered) to the update-only EE params block optional_update_params_ee in lib/api/helpers/projects_helpers.rb (consumed by PUT /projects/:id via optional_update_params). Do not add it to the shared optional_project_params / optional_create_project_params blocks used by POST /projects. Surface it (read) on the project entity.
  2. GraphQL — add a reviewerAssignmentStrategy argument to Mutations::Projects::ProjectSettingsUpdate (an update mutation) and a field on Types::Projects::SettingType.

Acceptance criteria

  • reviewer_assignment_strategy can be read and updated via REST PUT /projects/:id.
  • reviewer_assignment_strategy is not accepted by POST /projects (create).
  • reviewer_assignment_strategy can be read and updated via GraphQL ProjectSettingsUpdate.
  • Both paths enforce reviewer_auto_assignment_available? and reject invalid enum values.
  • Docs and API specs updated.
Edited by 🤖 GitLab Bot 🤖