Follow-up from "Implement enabled field in runner controller"
Summary
This issue tracks a follow-up from !215485 (merged) to standardize the error response format in the runner controllers API endpoints.
Problem
The runner controllers API endpoints currently return validation errors as a sentence string using errors.full_messages.to_sentence:
bad_request!(controller.errors.full_messages.to_sentence)
This is one of the only places in the entire codebase where to_sentence is used for error responses. The typical pattern in GitLab's REST API returns errors as an array of strings for consistency.
Proposal
Refactor the error responses in lib/api/ci/runner_controllers.rb to use the standard array format, aligning with the majority of the API codebase.
Timeline
This should be addressed before GA to avoid introducing a breaking change to the API response format.
The following discussion from !215485 (merged) should be addressed:
-
@habdul-razak started a discussion: (+2 comments)
Questions (non-blocking):
Why choose to return a sentence vs the usual array of strings? Is it a runner controller/cells specific thing?