ResourceLoader/Version 2 Design Specification/Testing
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. |
Testing strategy for Gadgets 2.0, a project run by Roan Kattouw and Timo Tijhof that involves a rewrite of the Gadgets extension to add support for sharing Gadgets across wikis. For more information about what this project will implement, see ResourceLoader/Version 2 Design Specification.
NOTE: RL2 is still in development, so not everything is perfect, but we wanted to get it out there for testing as soon as the core features were working reasonably well. Some things may be ugly, ill-conceived, not thought through very well, or just plain broken; if you notice any of these things, please let us know after checking the list of known issues.
RL2 in a nutshell
edit- RL2 enables sharing Gadgets across wikis, localizing them, and loading them through ResourceLoader
- Support for non-ResourceLoader-compatible Gadgets will be dropped
- A repository wiki is a wiki that contains Gadgets that can be used by other wikis, much like Commons contains files that are used on other wikis
- A client wiki can pull Gadgets from a repository wiki through either the database (DB; only available within wiki farms) or the API (always available).
- RL2 also allows Gadgets to use MediaWiki's i18n system
- Gadget definitions are no longer maintained on the MediaWiki:Gadgets-definition page in a crazy wikitext format. Instead, each Gadget has its own definition page called Gadget definition:Gadgetname.js, with the gadget definition in JSON. There is a gadget manager which provides a nice interface for editing these definitions
- Gadget code now lives in the Gadget: namespace instead of the MediaWiki: namespace
- Access restrictions for the MediaWiki: namespace, Gadget: namespace and Gadget definition: namespace are separate
How RL2 would be set up at WMF
edit- One central wiki for global scripts (which one?) would be set up as a repository.
- Most Gadgets would eventually live on the central wiki (just like most files are on Commons).
- All other wikis would be configured to use this central wiki as its foreign repository (through DB).
- 3rd party wikis can be configured to use this central wiki as their foreign repository (through the API, like InstantCommons does for files).
Testing tasks
edit- Import popular Gadgets to the repository wiki
- Test whether the imported Gadgets work with RL and RL2
- Fix broken Gadgets
- Test whether loading a Gadget from another wiki works
- Test the Gadget manager
- Test the separation of rights and the enforcement of these restrictions (proper error messages)
- Test what happens when multiple wikis have a Gadget with the same name
After testing something, please share your findings, even if they're positive (e.g. I had no problems when I tried XYZ), on the talk page. Please look at the list of known issues before reporting a problem.
Enabling Gadgets from another wiki
edit- Log in and go to your preferences
- Gadgets that exist on the local wiki will be shown in the "Gadgets" tab
- Gadgets that come from other wikis will be shown in the "Shared gadgets" tab, and will be listed by wiki of origin
Separation of rights
editOn the prototype wikis, there are four new groups. Each of these groups corresponds to a new right introduced by RL2. On a production setup, there probably wouldn't be a separate group for each right, but we want to be able to test each right separately. Any logged-in user can add themselves to these groups using SpecialUserrights.
- Users in the "gadgetauthor" group can edit pages in the "Gadget" namespace ("gadgets-edit" user right)
- Users in the "gadgetcreator" group can create pages in the "Gadget definition" namespace ("gadgets-definition-create" user right)
- Users in the "gadgetmanager" group can edit pages in the "Gadget definition" namespace, either directly or through the gadget manager ("gadgets-definition-edit" user right)
- Users in the "gadgetdeleter" group can delete pages in the "Gadget definition" namespace ("gadgets-definition-delete" user right)
Known issues
edit- Separation in preferences:
- We are not at all sure yet whether the separation between the two tabs, or listing the remote gadgets by wiki of origin, is a good idea.
- Timo is working on a redesign of the preferences interface
Manager always loads the same gadget:- Clicking any Gadget on Special:Gadgets will always open the definition editor popup for the same Gadget, regardless of which Gadget was clicked.
- This can be worked around by clicking "Permalink" before editing a definition
- This bug is fixed!
Special:Gadgets has no facility for creating new Gadgets- This feature has been implemented.
The definition editor on Special:Gadgets has no facility for creating new categories- This feature has been implemented.
Importing Gadgets from a wiki is not automated. It will be once a migration script has been written that migrates old-style Gadgets on a wiki to the new style- Q: Mixup of terminology ? What kind of importing do you mean, I don't see why/how that is ever supposed to be "automated"
- I've imported some gadgets from meta and mw.org, essentially by importing their pages plus MediaWiki:Gadgets-definition, then running the migration script. This is an imperfect way of importing gadgets, should only really be done for testing on the prototype wikis, and for those reasons can't really and shouldn't really be automated. Striking.
- Q: Mixup of terminology ? What kind of importing do you mean, I don't see why/how that is ever supposed to be "automated"