Page MenuHomePhabricator

Add 'test' as a server option for Wikipedia projects within REST Sandbox
Closed, ResolvedPublic3 Estimated Story Points

Description

Description

By default, our API sandboxes (Action & REST) execute calls against the production environment they are running in. While this is safe and convenient for pulling real world data for GET requests, it introduces some risk of erroneous edits going through unintentionally for endpoints that edit content (eg POST, PUT, PATCH, and DELETE endpoints). It is also slightly confusing since it is called a Sandbox even though the calls are executed in production.

Conditions of acceptance

OpenAPI specs allow for specifying multiple servers the APIs are associated with. Users are then able to select their desired server before executing the calls within the Sandbox. We should utilize this feature to minimize the risk of executing test calls within the API Sandbox.

  • Include test.wikimedia.org as a server option within all Wikipedia Special:RestSandbox instances for:
    • MediaWiki REST API
    • Wikimedia REST API
  • Update the server descriptions to clearly specify (Production) and (Sandbox) after the URL body
  • Include a small description in the spec info header that recommends using the test wiki for all editing calls, as production is default

OPEN QUESTION: Are there test sites available for other types of projects? Like Wiktionary, Wikivoyage, etc? --> This will be covered in another story; insight from @ArielGlenn

Implementation details

  • Wikimedia REST API specs are within the MediaWiki config -- these will have to be updated manually & deployed
  • MediaWiki will require a handler/module update for including the new servers in the generated spec process

Event Timeline

HCoplin-WMF set the point value for this task to 3.
HCoplin-WMF renamed this task from Add 'test' as a server option within REST Sandbox to Add 'test' as a server option for Wikipedia projects within REST Sandbox.Nov 3 2025, 4:05 PM
HCoplin-WMF updated the task description. (Show Details)
HCoplin-WMF updated Other Assignee, added: BPirkle.
aaron triaged this task as Medium priority.Feb 20 2026, 6:48 AM
OWresch-WMF removed KineticPelagic as the assignee of this task.
OWresch-WMF assigned this task to KineticPelagic.
OWresch-WMF added a subscriber: KineticPelagic.
OWresch-WMF removed a subscriber: Atieno.
aaron set Due Date to Tue, Jul 28, 7:00 AM.Tue, Jul 14, 6:46 PM

Change #1313760 had a related patch set uploaded (by KineticPelagic; author: KineticPelagic):

[mediawiki/core@master] rest: Add test server option to REST Sandbox for Wikipedia projects

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

Change #1313827 had a related patch set uploaded (by KineticPelagic; author: KineticPelagic):

[operations/mediawiki-config@master] rest: Add test server option to REST Sandbox for Wikipedia projects

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

In reply to an implied question in the task description:

There is a test-commons.wikimedia.org and a test.wikipedia.org but no other test projects. The test-commons project is intended to go away "Soon", whatever that means.

In reply to an implied question in the task description:

There is a test-commons.wikimedia.org and a test.wikipedia.org but no other test projects. The test-commons project is intended to go away "Soon", whatever that means.

Thank you for the information, which can inform the "another story" that is to come.

Change #1313760 merged by jenkins-bot:

[mediawiki/core@master] rest: Add test server option to Sandbox for Wikipedia via config setting

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

Change #1313827 merged by jenkins-bot:

[operations/mediawiki-config@master] rest: Add test server option to REST Sandbox for Wikipedia projects

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

Mentioned in SAL (#wikimedia-operations) [2026-08-04T20:15:32Z] <samtar@deploy1003> Started scap sync-world: Backport for [[gerrit:1313827|rest: Add test server option to REST Sandbox for Wikipedia projects (T408816)]]

Mentioned in SAL (#wikimedia-operations) [2026-08-04T20:21:21Z] <samtar@deploy1003> samtar, kineticpelagic: Backport for [[gerrit:1313827|rest: Add test server option to REST Sandbox for Wikipedia projects (T408816)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-08-04T20:40:13Z] <samtar@deploy1003> Finished scap sync-world: Backport for [[gerrit:1313827|rest: Add test server option to REST Sandbox for Wikipedia projects (T408816)]] (duration: 24m 40s)

I additionally included: In the configuration for REST external modules, add a '+wikipedia' override, which has the caution message in the OpenAPI spec info header.

Thanks Aaron for this suggestion and coordinating with Gerrit change I06951a (Git commit hash a5f13403078798964b9923fbeb4dda76c91c944a).

Change #1321892 had a related patch set uploaded (by KineticPelagic; author: KineticPelagic):

[mediawiki/core@master] REST: Remove fragmentation and patchwork in i18nable system message

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