For JS dependencies, image optimizations etc the state of the art still seems to be to have a local one-off script and commit the build artifacts into the repo. (For instance TimedMediaHandler fetches some JS libs via npm and copies/patches them into the resources/ dir.)
For PHP deps we've got composer dependency installation for extensions, so it seems like there's an opportunity to do other build steps in this stage...
Not sure offhand if that can be snuck into composer directly or if we'd need to replace the "run composer" step with "run this script, which runs composer and also does other build steps".
-- brion
On Wed, Jun 7, 2017 at 10:18 AM, Joaquin Oltra Hernandez < jhernandez@wikimedia.org> wrote:
*Context*
We'd like to have a build script/process for an extension so that I can perform certain commands to install dependencies and perform optimizations on the extension sources. For example, on front-end sources.
Some examples could be:
- Installing libraries from bower or npm and bundling them into the
resources folder
- Applying post processing steps to CSS with something like post css
- Optimizing images
We are aware of other projects that have build processes for building deployables, but not extensions. Such projects have different ways of dealing with this. A common way is having a repository called <Project>/deploy and in there you pull from <Project> and run the build scripts, and that is the repository that gets deployed.
*Current system*
The current way we usually do this (if we do) is run those build scripts/jobs on the developers machines and commit them into the git repository on master.
With this system, if you don't enforce anything in CI, then build processes may be skipped (human error).
If you enforce it (by running the process and comparing with what has been committed in CI) then patches merged to master that touch the same files will produce merge conflicts with existing open patches, forcing a rebase+rebuild on open patches every time one is merged on master.
*Questions*
Can we have a shared configuration/convention/system for having a build step on mediawiki extensions?
- So that a build process is run
cluster and to production
- on CI jobs that require production assets like the selenium jobs
- on the deployment job that deploys the extension to the beta
How would it look like? Are any extensions doing a pre-deployment build step?
Thanks. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l