Jump to content

User:DAlangi (WMF)/Sandbox/MediaWiki-vendor-package-upgrade How-to

From mediawiki.org

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]
  1. Ensure that you have the correct composer version (see mediawiki/vendor README [1])
  2. Pick a library or package that you want to upgrade on our infrastructure. Example could be utfnormal.
  3. Clone the utfnormal repository locally and update its CHANGELOG.md or HISTORY.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
  4. Once you've updated the changelog in step 3 above, make a patch to the utfnormal repository on Gerrit [2].
    1. 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].
    2. Push the new release tag using: git push --tags
    3. 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]).
  5. 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).
    1. 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.
  6. Make a corresponding patch to the MediaWiki-core repository which depends on the patch on Step (5) above.
  7. Both patches of step 5 and 6 will be merged at the same time, updating MediaWiki core to the latest upgrade.
  8. 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

[4] gerrit:c/mediawiki/libs/RemexHtml/+/953247