labels= and milestone=: filter the issue and pull lists
The issue list (GET /api/v1/repos/OWNER/NAME/issues) and the pull list (…/pulls) read a fixed set of query parameters, and refuse any other.
GET /api/v1/repos/OWNER/NAME/issues?labels=P0%20Trust,bug
GET /api/v1/repos/OWNER/NAME/issues?milestone=731&state=all
GET /api/v1/repos/OWNER/NAME/pulls?labels=bug
labels=a,bkeeps the items carrying every label named (AND), each by name (case-insensitive) or id. It works on both lists and combines withlabel=,author=andstate=. More than 20 names is a 422invalid_labels.milestone=N(issues only) keeps the issues beneath issue N: everything it waits for, directly or through others. This is the tree the milestone page counts. The walk never passes through the plan's furniture (pillar umbrellas, the Later umbrella, the gate), and the sealed scope still applies to what it finds.milestone=refuses with a 422invalid_milestonewhen N is not a whole number, is not an issue of this repository the caller can see (a pull's number included), or is the Later umbrella or the Later gate. The plan counts as Later everything that waits behind the gate, which runs the other way through the graph from Later's own links, so a walk of Later's links would come up short of the plan. Read deferred work fromGET /api/v1/repos/OWNER/NAME/mapinstead.- Any other parameter is a 422
unknown_parameter. Itsmessagenames what the list does not read, andacceptedlists what it does:state, label, labels, author, cursor, limit, plusfields, milestoneon the issue list.fields=a,b(see fields) is read before this check, on both lists.
This breaks clients that send extra parameters. Before, the forge ignored a parameter it did not read. A typo such as ?lables=bug, or a filter the forge does not have such as ?milestone= on pulls, returned the whole list as if it were filtered. Now the same request is a 422. A client that adds its own parameters (a cache-buster such as ?_=123, tracking tags) must drop them for these two lists. ?page= and ?offset= keep their own 400 invalid_query (see the API reference).
Code: listQuery in src/http/api.ts (the accepted names, labels), milestoneScope in src/http/api/issues.ts, and the labels/beneath filters of listIssues in src/core/issues.ts. Tests: test/api-list-query.test.ts.