Page MenuHomePhabricator

Set a default module sort order for the spec discovery endpoint + REST Sandbox
Closed, ResolvedPublic2 Estimated Story Points

Description

Description

As we add more modules, it is increasingly important to make them easy to reference and discover within the list. There is currently no way to intentionally sort the modules, meaning that they are presented in a seemingly random order. It is preferrable to have some obvious logic behind the sort order, even if it is as simple as alphabetical order. Additionally, because we cannot reliably infer what extensions (and therefore modules) are installed on a given instance of MediaWiki, we cannot easily implement a custom sort order.

NOTE: assumes that the 'default' module for the page will be set through T422211: Allow specifying default REST module in the Special:RestSandbox

Conditions of acceptance

  • Update the default sort order for modules to be the default module first, then alphabetical for all other modules
  • Alphabetic sort order reflects English (for now, as we do not have translation in the module definitions nor spec discovery; translation only happens at the spec level)
  • The discovery endpoint returns modules in the default sort order
  • REST Sandbox modules are listed in the default sort order

Details

Event Timeline

After discussion, T422211: Allow specifying default REST module in the Special:RestSandbox is not a prerequisite. We could implement a basic default sorting, and then add in the ability to set a per-wiki specific default later.

Also per discussion, we will likely elevate the "routes not in modules" to the top, and sort alphabetically after that. Need to confirm this with Product Management.

BPirkle set the point value for this task to 2.Jun 4 2026, 2:30 PM

Change #1298906 had a related patch set uploaded (by BPirkle; author: BPirkle):

[mediawiki/core@master] REST: sort /discovery and the REST Sandbox dropdown

https://gerrit.wikimedia.org/r/1298906

Change #1298906 merged by jenkins-bot:

[mediawiki/core@master] REST: sort /discovery and the REST Sandbox dropdown

https://gerrit.wikimedia.org/r/1298906

Resolving tasks as part of closing the sprint.