Help:Gadget-Cat-a-lot/Developing

This page describes how to edit, test, and deploy changes to the Cat-a-lot gadget on Wikimedia Commons. There is also separate guide on howto develop code locally and in Beta Commons:

General documentation

Source code

Dependencies

Files and categories suitable for testing

Wikimedia Commons test images. These are test images. Images can also be used for testing actions like moving, deleting etc. License may but does not have to apply. Images in this category may be deleted, moved or other images loaded on top of them.

Under the test images are also Cat-a-lot specific test files

It is also safe to add or remove following categories from files uploaded by FinnaUploadBot if you need to test mass editing. Categories itself are redundant for FinnaUploadBot this currently handled by code.

Setting up the onwiki development environment

Before starting development:

  1. Disable the production Cat-a-lot gadget in your Wikimedia Commons preferences to prevent conflicts with your development version.
  2. Create a sandbox copy of the gadget:
    1. Copy latest MediaWiki:Gadget-Cat-a-lot.js to your user page Special:Mypage/cat-a-lot.js
      • Sample: User:Zache/cat-a-lot.js (Warning: Do not copy this. Please use the latest version as sample version is outdated.)
    2. Copy latest MediaWiki:Gadget-Cat-a-lot.css to your user page Special:Mypage/cat-a-lot.css
      • Sample: User:Zache/cat-a-lot.css (Warning: Do not copy this. Please use the latest version as sample version is outdated.)
    3. Modify Cat-a-lot to use your local Cat-a-lot.css page. (example modification)
    4. Add the loading code to your common.js file (e.g., Special:Mypage/common.js

Editing the code

Creating a task

  1. Create a Phabricator ticket using the gadget-cat-a-lot tag to the Cat-a-lot workboard

Development best practices

  • Make incremental changes to your sandbox version
  • Use console.log for debugging
  • Add comprehensive code comments

Testing requirements

  1. Ensure no console errors or warnings appear
  2. Verify functionality works as expected
  3. Cross-browser testing:
    • Google Chrome
    • Mozilla Firefox
    • Safari
    • Microsoft Edge

Deploying the changes

Code preparation

  1. Consolidate changes into clean, focused edits
  2. Verify final version works as intended

Community review

  1. Post a message on MediaWiki talk:Gadget-Cat-a-lot.js

Deployment steps

  1. After testing submit a protected page edit request
  2. For simple changes, you can submit the edit request directly

Post-deployment

  1. Test that new version is working when it is merged to gadget code. There can be differences on how gadgets and user scripts are working because race conditions, security validations etc.
  2. Monitor for any issues
  3. Once stable, close the Phabricator ticket as resolved
  4. Update documentation if necessary
Category:Cat-a-lot Category:Wikimedia software development tutorials
Category:Cat-a-lot Category:Wikimedia software development tutorials