- Scope of this ticket **
This ticket is done when it's possible to locally edit a MediaWiki interface page to display a message box. Using the box is not in scope for this ticket.
- The message is disabled by default
- When set a message appears above the editor when the user edits JS/CSS code.
QA steps
- Get a developer to set [[MediaWiki::editpage-code-guidelines]] on a wiki
- Edit a JavaScript or CSS page e.g. User:<username>/common.js
Expected: a message box with the text of the page https://en.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Editpage-code-message shows at the top of the page.
QA in production
No change is expected
Background
Despite gadgets and user scripts (which will be referred from now on as wiki-based code) being a key component of MediaWiki projects, up until now frontend APIs (e.g. how wiki-based code should interact with source control provided code) have been ill-defined leading to misunderstandings between engineers and wiki-based code developers when wiki-based code breaks. This also leads to code rot, where developers do not feel empowered to make changes as it's unclear how their changes will impact wiki-based code developers.
On top of this, when wiki-based code breaks it's not clear who can and will fix them.
A gadget policy document was written in 2021 which later became a set of recommendations. This policy should be considered a living document that can evolve over time with discussion, like any other wiki page.
I would like us to surface this policy from the editor on pages which are of content type JavaScript or CSS like so:
Benefits (why should this be implemented?):
Given wiki-based code can impact users and site reliability (now that we log JavaScript errors) and is impacted by changes in the core platform, it's important that we have shared understanding of how we can work together best. This should lead to a better experience for both parties and will go a long way to restoring trust and good faith between the two parties.