Continuous integration/Quibble

(Redirected from Quibble)


Quibble is a Python script for setting up a MediaWiki instance and running various tests against it.

It works by cloning MediaWiki core and several extensions, installing dependencies, creating the database, and running one or more test commands.

Further reading

edit

Creating and deploying a new Quibble release

edit

This is moderately fiddly and stressful, and should be done when you have a fair amount of time free and CI is relatively quiet; Fridays are commonly picked.

Creating the release

edit

The run-book to release a new version of Quibble is described in its online documentation: Release check list (source).

Creating images

edit

On Wikimedia CI we use OCI image which have a specific version of Quibble installed. Each time a new version is release, the image have to be rebuild in order to install the newer version. The image are built using our homemade docker-pkg which is run remotely the continuous integration server.

As a prerequisite you will need the dch Debian utility (sudo apt -y install devscripts).

In the integration-config repository run the utils/update-quibble script. The script:

  1. find the latest tag in the Quibble repository
  2. update Debian changelog entries for the Quibble images under ./dockerfiles/
  3. generate the git commit
  4. ask confirmation before sending it for review to Gerrit (example)

You can then build the images locally to ensure they still build:

docker-pkg -c dockerfiles/config.yaml --info build --use-cache dockerfiles/

Check the locally-built images to ensure that Quibble correctly updated: ./dockerfiles/debug-image quibble-bullseye-php83 and then head /usr/local/bin/quibble and see that the correct version number is shown.

Create and publish the new images on the CI production server: ./fab deploy_docker (remember to !log this action in IRC) – 🐌 this will take a while, perhaps an half an hour or more.

Update Jenkins jobs

edit

On Wikimedia CI we use Jenkins job which points to a specific version of the OCI images that were published to our registry. We thus need to update the Jenkins jobs to switch them to use the newer version of the image.

As prerequisites you will need:

Switch CI jobs over to the new image (example)

  1. In integration-config's verify images that requires an update ./utils/docker-updates
  2. Verify only quibble image get affected then apply the update ./utils/docker-updates --apply
  3. Verify that these jobs build correctly either:
    • ./jjb-test -o output/
    • ./utils/jjb-diff.sh
  4. Create a git commit (git commit -a m 'Upgrade Quibble jobs to X.YY.Z)
  5. Push the commit to Gerrit for code review.

Based on your knowledge of the changes in Quibble, pick a likely simple, infrequent, fast-running job to manually change over, and push it: ./jjb-update 'quibble-vendor-mysql-php72-docker'

  1. Manually trigger run a run of this job through the Jenkins Web interface, and carefully watch the output to ensure it works as it used to where it should, and in a different way where Quibble's changes should change things.
  2. If you spot an error, rollback the job to the definition in master immediately rather than debugging live; remember that other people's workflows depend on CI continuing to work.
  3. Repeat this with increasingly major/high-profile jobs until you are satisfied that you or someone else on IRC would have noticed if the jobs were broken.
  4. Update the rest of the jobs in your list.
  5. Merge the commit as deployed.

You most probably want to verify that a recheck on mediawiki/core and mediawiki/extensions/Wikibase pass fully.

You must continue to monitor CI for a while, in case things blow up despite your hard work. This can be done by:

If it does fail, revert the Jenkins jobs modification by:

  1. reverting the commit which has switched the jobs to the new version of the image (git revert)
  2. running Jenkins Job Builder to deploy the revert: ./jjb-update
  3. Revert the change in Gerrit by using the Revert button and immediately Code-Review +2 to get it merged
edit