Page MenuHomePhabricator

Add patch creation interface
Open, Needs TriagePublic

Description

The current interface assumes the person git clones the repo, then uses the CLI to format a patch, and upload this. As an even more accessible workflow, especially for repos that contain e.g. Gadgets or Lua modules that people are used to editing on a wiki, I propose something that's akin to the web editor that Gerrit provides.

The reason to create this in Gerrit-patch-uploader is the same that Gerrit-patch-uploader exists in the first place; 1) to be inclusive to poeple using their pseudonymous Wikimedia global account (without needing to publicly expose and associate with an email address), and 2) to remove the need for SSH and Wikimedia Developer account setup.

It would further more 3) remove the time and/or skill needed to use the CLI with git-clone and git-format-patch.

Rough idea

var resp = await fetch('https://gerrit.wikimedia.org/g/mediawiki/gadgets/RTRC/+/HEAD/?format=JSON');
var data = JSON.parse((await resp.text()).slice(5));
var files = data.entries;

console.log(files);
//> [ { type: "blob", name: ".eslintignore", mode: 0o100644 }, { type: "tree", name: "src" }, .. ]

var resp = await fetch('https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/gadgets/RTRC/+/HEAD/src/rtrc.js?format=TEXT');
var data = await resp.text();
var contents = atob(data);

console.log(contents.slice(0, 100));
//> "/**
//>   * Real-Time Recent Changes
//>   ... "

Related: