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 byproject.reviewer_auto_assignment_available?. - Not in the REST
PUT /projects/:idpermitted params (lib/api/helpers/projects_helpers.rb). - Not an argument of the GraphQL
ProjectSettingsUpdatemutation (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:
- REST (edit only) — add
reviewer_assignment_strategy(values:disabled,code_owners,dap_powered) to the update-only EE params blockoptional_update_params_eeinlib/api/helpers/projects_helpers.rb(consumed byPUT /projects/:idviaoptional_update_params). Do not add it to the sharedoptional_project_params/optional_create_project_paramsblocks used byPOST /projects. Surface it (read) on the project entity. - GraphQL — add a
reviewerAssignmentStrategyargument toMutations::Projects::ProjectSettingsUpdate(an update mutation) and a field onTypes::Projects::SettingType.
Acceptance criteria
-
reviewer_assignment_strategycan be read and updated via RESTPUT /projects/:id. -
reviewer_assignment_strategyis not accepted byPOST /projects(create). -
reviewer_assignment_strategycan be read and updated via GraphQLProjectSettingsUpdate. - Both paths enforce
reviewer_auto_assignment_available?and reject invalid enum values. - Docs and API specs updated.
Related
- Epic: &20708 (closed)
- Rollout: #590879 (closed)
- Fix MR (context): !237226 (merged)