CanastaWiki / Canasta

MediaWiki Docker image for Canasta, an all-in-one MediaWiki stack for easy deployment and management of enterprise-ready MediaWiki on production environments.
https://www.canasta.wiki
MIT License
36 stars 27 forks source link

Fully install Email Authorization extension #402

Open yaronkoren opened 1 month ago

yaronkoren commented 1 month ago

The Email Authorization documentation doesn't really make this clear, but this extension requires the DataTables JavaScript library as a dependency. Right now this dependency is defined as a Git submodule (see .gitmodules), so the command git submodule update --init needs to be called after the code is downloaded. Email Authorization is the only extension I know of in Canasta that has Git submodules (the others use Composer for their dependencies) - and, unfortunately, this command is not being called right now, so some of EA's special pages don't work.

I can think of various solutions to this problem:

  1. Just add the hardcoded "git submodule" call to Dockerfile, to be called after extensions.yaml is handled.
  2. Add some syntax to the extensions.yaml/skins.yaml format to indicate that an extension/skin has Git submodules, then add handling for that syntax (and add this syntax to the Email Authorization declaration).
  3. Convince the EA developers (er, @cicalese) to add DataTables to composer.json as well, as a dependency, and then add EA to the composer.canasta.json file.
  4. Locally patch EA to add DataTables to its composer.json, then add EA to composer.canasta.json.
  5. Convince the EA developers to handle DataTables in what I would call the right way, which is to add this library directly to the extension code - the same way that other extensions (Cargo, Semantic Result Formats) include it. This prevents the code from breaking if there are any unexpected changes to DataTables in the future.

Of these, 1 is by far the easiest, though 5 is the best. @cicalese - any thoughts?

yaronkoren commented 1 month ago

I realized that option 5 would actually not that be hard to implement, so I just created a patch for it, here:

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/EmailAuthorization/+/1036659

Hopefully this works. It looks like a few other changes need to be made to EmailAuthorization before it can pass validation again, but anyway, this does seem to me like the best approach.