User:DAlangi (WMF)/Sandbox/MediaWiki-vendor-package-upgrade How-to
If you're making an attempt to release/upgrade a new version of a MediaWiki composer packagist package/library, follow the steps below.
NOTE: Feel free to improve the steps below if you see any loop holes.
Steps
edit- Ensure that you have the correct composer version (see mediawiki/vendor README [1])
- Pick a library or package that you want to upgrade on our infrastructure. Example could be
utfnormal
. - Clone the
utfnormal
repository locally and update itsCHANGELOG.md
orHISTORY.md
file with the format already used in the file. The heading section is usually the version that needs to be released e.g. 4.0.0 - Once you've updated the changelog in step 3 above, make a patch to the
utfnormal
repository on Gerrit [2].- Once the patch is merged, git tag a new release and push this tag to Gerrit (which will also reflect on Github). Command for doing this is something like:
git tag -s 4.0.0 -m "Release 4.0.0"
where the-s
is for signing the release and-m
is for specifying a release message [3]. - Push the new release tag using:
git push --tags
- As an extra step, ensure all other libraries or packages that depends on the
utfnormal
package are also updated with the correct tag by making patches to these libraries (updating the composer file with the new release[4]).
- Once the patch is merged, git tag a new release and push this tag to Gerrit (which will also reflect on Github). Command for doing this is something like:
- Once all the patches above have been merged, make a patch to MediaWiki-Vendor repository, updating it to the latest release of the package (utfnormal).
- DON'T FORGET to run
composer update --no-dev
to pick up the changes in the packages that were merged in the patches above. You can also use the docker command in the mediawiki vendor directly to do the update for you if you're unsure about your local composer version.
- DON'T FORGET to run
- Make a corresponding patch to the MediaWiki-core repository which depends on the patch on Step (5) above.
- Both patches of step 5 and 6 will be merged at the same time, updating MediaWiki core to the latest upgrade.
- Congratulations 🎉, you're made a new package release. Now watch Wikipedia and the world burn 🔥.
NOTE: Make sure you use the appropriate Depends-On:
commit footer if a patch depends on another in the order of committing.
References
edit[1] https://github.com/wikimedia/mediawiki-vendor/blob/master/README.md#adding-or-updating-libraries
[2] gerrit:c/utfnormal/+/953240
[3] https://github.com/wikimedia/utfnormal/releases/tag/4.0.0