Stop documenting None and Any for reviewer_username
What does this MR do and why?
The merge request list APIs describe reviewer_username with two sentences copied from reviewer_id: "None returns merge requests with no reviewers. Any returns merge requests with any reviewer." The parameter has always read its value as a username, so both look for a user with that name and return [] on GitLab.com.
Following the product decision in the issue, this MR drops the two sentences instead of making the wildcards work, so reviewer_username stays a plain username, like assignee_username in REST and reviewerUsername in GraphQL. reviewer_id keeps them, since it accepts both wildcards.
The two sentences go from:
- the
reviewer_usernamedescription inlib/api/helpers/merge_requests_helpers.rb, which also describesnot[reviewer_username]; - the
not[reviewer_id]description in the same file: that parameter is declaredIntegerand refusesNoneandAnywith400; - the three
reviewer_usernamerows ofdoc/api/merge_requests.md, which lists the negated parameters only undernot; doc/api/openapi/openapi_v3.yaml, regenerated: 12 descriptions, three on each of the four merge request lists.
No behavior changes.
References
Closes #636377 (closed)
Earlier versions of this MR made the wildcards work; the issue thread explains why that changed.
Screenshots or screen recordings
| Before | After |
|---|---|
Returns merge requests which have the user as a reviewer with the given username. None returns merge requests with no reviewers. Any returns merge requests with any reviewer. |
Returns merge requests which have the user as a reviewer with the given username. |
How to set up and validate locally
- In
doc/api/openapi/openapi_v3.yaml, findreviewer_username,not[reviewer_username]andnot[reviewer_id]under the four merge request lists (global, group, project and deployment): none of them mentionsNoneorAny, andreviewer_idstill does. - In
doc/api/merge_requests.md, the threereviewer_usernamerows no longer mention them.
How I checked it
On master at 73b11879e427, with the descriptions changed and the committed document untouched, gitlab:openapi:v3:check_docs failed with a diff of exactly those 12 descriptions. After bin/rake gitlab:openapi:v3:generate it reports the document up to date, and the regenerated file differs from master only in them. RuboCop reports no offenses on the helper, markdownlint and Vale report nothing on the changed rows of merge_requests.md, and scripts/lint/commit_linter.rb passes the commit.
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.