Page MenuHomePhabricator

Produnto sandbox: previewing unreleased changes
Closed, ResolvedPublic

Description

Idea summary

  • An IDE plugin will authenticate with MW using OAuth and then post a bundle of modified files to a REST API.
  • The preview form will then have a sandbox checkbox. When it is checked, the most recently posted sandbox bundle will be used, falling back to the deployed packages if a file is not in the bundle.
  • The sandbox will eventually expire.

Discussion

Users want to be able to edit a file in a Produnto package and preview the result on Wikipedia, without having an MR be merged, and ideally without doing a git push.

From the loader (T412181) point of view, a sandbox is an overlay. It is a map of package/path to file contents to be used in preference to the cached file contents for that package.

A client-side script will post a bundle of files to MediaWiki, establishing a sandbox scoped to the authenticated MW user. On preview, we only need to show a boolean option asking the user whether they want to use a sandbox or not.

I considered having sandbox files represented as pages on the wiki in the user namespace, but this would be slow, complicated to implement, and is never going to be as nice to use as a proper IDE like VS Code Web.

GitLab has its own branded VS Code Web which allows users to easily edit files in the browser and submit MRs. It would be nice if we could extend it to add a button to deploy to a wiki sandbox.

@SD0001 suggested using the File System API, but note that Mozilla is intractably opposed to implementing showDirectoryPicker. VS Code Web uses this API to load files, and I think we could have a VS Code Web extension that posts modified files to MediaWiki. Also, if VS Code Web can do it, the desktop version of VS Code can probably do it too without too much extra effort.

Event Timeline

tstarling renamed this task from Produnto previewing unreleased changes to Produnto sandbox: previewing unreleased changes.Mar 25 2026, 1:34 AM

Change #1261926 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Produnto@master] Produnto Sandbox backend

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

Change #1268447 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Produnto@master] Sandbox activation

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

Change #1267210 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Produnto@master] Sandbox parser integration

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

Change #1261926 merged by jenkins-bot:

[mediawiki/extensions/Produnto@master] Sandbox backend

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

Change #1268447 merged by jenkins-bot:

[mediawiki/extensions/Produnto@master] Sandbox activation

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

Change #1267210 merged by jenkins-bot:

[mediawiki/extensions/Produnto@master] Sandbox parser integration

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

Change #1278768 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Produnto@master] Add Special:ProduntoSandbox

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

Change #1278768 merged by jenkins-bot:

[mediawiki/extensions/Produnto@master] Add Special:ProduntoSandbox

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

MSantos moved this task from Next to Now on the Produnto board.
tstarling claimed this task.

I wrote a Node.js file watcher which I think is good enough for now. I split the VS Code plugin idea out to T425500 so that this task can be closed.