Page MenuHomePhabricator

Write a documentation to set up local development environment for Cat-a-lot
Open, In Progress, Needs TriagePublic

Description

The Cat-a-lot gadget on Wikimedia Commons currently lacks detailed technical documentation for setting up its local development environment. This gap makes it difficult for new contributors to develop, test, and debug the gadget locally.

Goal:
Develop comprehensive documentation that includes:

  • Creation of pages related to Cat-a-lot
  • Testing procedures
  • Clearing the local cache
  • Debugging guidelines

Current status:
An initial draft of the developer documentation is available at:

Next steps:

  • Review and feedback from current Wikimedia Commons interface editors
  • Seek reviews from contributors experienced in Cat-a-lot’s local development setup

Event Timeline

Hridyesh_Gupta changed the task status from Open to In Progress.Feb 24 2025, 4:25 PM

I’ve tweaked the Enable the Gadgets extension section to better reflect reality. Other points at which I don’t agree (but I don’t think they’re obvious enough to just boldly edit):

  • Installation:
    • Currently the primarily listed installation method is installing the release version of MediaWiki. This is constantly months out of date compared to Commons, which runs the latest alpha version (updated every week). While the JS environment fortunately rarely changes, it still means you test something else than what you develop for. If one installs from Git, they’re much closer to what’s on Commons – the Git master is a few days ahead of Commons.
    • For the Git installation, only local development quickstart is listed, even though there are a number of options. I couldn’t find a portal page describing them, but https://www.mediawiki.org/wiki/Category:Development_environments at least collects a few. (I myself use MediaWiki-Docker, by the way.)
  • Create required gadget pages:
    • Creating MediaWiki:Gadget-Cat-a-lot isn’t necessary. If one doesn’t create it, the preferences page won’t be that welcoming, but that’s fine in a dev environment.
    • In the MediaWiki:Gadgets-definition line,
      • |type=general is obsolete and doesn’t do anything (probably we should remove it from the live Commons version as well);
      • adding |default in the brackets may be convenient – it enables the gadget for everyone (including logged-out users) on the wiki, so you don’t have to fiddle with your preferences (of course, this shouldn’t be done in the live version, as the gadget should remain opt-in on Commons).

Thanks @Tacsipacsi for the update you provided, we'll review and change the documentation accordingly.

@Hridyesh_Gupta I added wgMaxArticleSize to increase the wikipage size as it was too small by default to copy the Cat-a-lot.js to the documentation. I also added howto create admin user.

I used the Local development quickstart for installing the mediawiki. However, when i installed Gadgets extension it failed to load properly. It is listed in Special:Version, but it is not visible in Special:Preferences I am just asking if you have encountered to the same problem?

Screenshot 2025-03-03 at 14.24.24.png (1×2 px, 2 MB)

Screenshot 2025-03-03 at 14.23.53.png (1×2 px, 2 MB)

Problem solved. I cleared the MediaWiki:Gadgets-definition page and recreated it and it resolved a problem. I do not know what was the actual difference. (ie. i didn't delete the page)

@Hridyesh_Gupta I added wgMaxArticleSize to increase the wikipage size as it was too small by default to copy the Cat-a-lot.js to the documentation. I also added howto create admin user.

Okay, @Zache thanks for the update.

I used the Local development quickstart for installing the mediawiki. However, when i installed Gadgets extension it failed to load properly. It is listed in Special:Version, but it is not visible in Special:Preferences I am just asking if you have encountered to the same problem?

Screenshot 2025-03-03 at 14.23.53.png (1×2 px, 2 MB)

Yes, I also faced this same issue. This mainly occurs, afaik, when you don't create the dependency files: MediaWiki:Gadget-SettingsManager.js and MediaWiki:Gadget-SettingsUI.js, as these are required for the gadget's per-user settings. So, as soon as I created both these, the problem got resolved.

Problem solved. I cleared the MediaWiki:Gadgets-definition page and recreated it and it resolved a problem. I do not know what was the actual difference. (ie. i didn't delete the page)

Maybe, in your case, this file and its content were the reason of this problem and as soon as you updated it, the problem got resolved. As in my case, I already updated the MediaWiki:Gadgets-definition page earlier before checking for the gadget's visibility in
Special:Preferences.

I made some updates to local development page

1.) Added a script for populating local wiki with js, css, and some test images: copy_cat-a-lot-files_to_local wiki.py

2.) Added image upload settings LocalSettings.php configuration (so that the script will run)

3.) Added FAQ section for miscellaneous solutions to problems

One major thing what is missing is that the Special:Search and Special:MediaSearch pages cannot be tested as it would require ElasticSearch to be configured and running which feeled rather complex task.

I made some updates to local development page

1.) Added a script for populating local wiki with js, css, and some test images: copy_cat-a-lot-files_to_local wiki.py

2.) Added image upload settings LocalSettings.php configuration (so that the script will run)

3.) Added FAQ section for miscellaneous solutions to problems

Okay @Zache, thanks for the update!

One major thing what is missing is that the Special:Search and Special:MediaSearch pages cannot be tested as it would require ElasticSearch to be configured and running which feeled rather complex task.

Oh, but we can work on it together. Doing so will surely reduce its difficulty level. Are there any initial steps you can suggest?