Releasing new STACK versions
Note
These notes are designed for developers releasing a new version through the Moodle plugin database. They are probably not useful for anyone else.
Release needs to be done for the whole "set". Do we increment the numbers of all components, e.g. behaviours, or just the qtype_stack?
- for key releases, we do them all.
- for bug fixes just the question type.
0. Code on GitHub
The STACK code is stored on GitHub, e.g. in https://github.com/maths/moodle-qtype_stack. In general the code branches are arranged as follows.
- The
masterbranch should always be either (i) an official release, (ii) contain minor but critical bug fixes, or (iii) contain updates to the docs. The STACK documentation on https://docs.stack-assessment.org/ auto-builds from the master branch, and so it is normal to update the docs between official releases. - The
devbranch normally contains features which will be in the next release. Thedevbranch should normally work out of the box, but expect unfinished features and bugs! - Development of new features often takes place in a specific branch named to correspond to an issue in the GitHub issue tracker, normally forked from
dev. E.g. if you raise issue 802 then code related to this can start life in a branchiss802. If you put#802in the commit message then GitHub will pick this up in the issue discussion. New features can be merged back intodevbefore they are completely finished, but please do add documentation, unit tests etc. first and make sure we at least have consensus on the design!
Unless you want to discuss something confidential with the developers, please do raise issues on GitHub!
1. Pre-release checks
Check
- Readme.md
- Check docs
- development history and development track
history/track. - Write the release notes from the change log: see the change log below.
- Execute
php cli/answertests_docs.phpto update the static docs about answertests. - Execute
doc/maintenance.phpto search for broken links etc. - Run
php cli/stacklibrarycheck.phpto check filenames in the stacklibrary do not have special characters, particularly'(which breaks the .zip download in the plugin directory!) - Run
php cli/unicode_data_process.phpto update unicode mappings. - Run
php cli/ast_test_generator.phpto confirm if auto-generated tests have not changed. - Run
php cli/stack_maxima_compiler.phpto processstack/maximasrcand generatestack/maxima/maximasrccompiled.mac, the test version, and the documentation. - Run Maxima unit tests for the
stack/maximasrccontent withload("maximasrccompiled_tests.mac");, it should say"All tests successfully executed." - Run Maxima unit tests of contributed packages by re-defining
stacklocationand runnings_test_case.macin the sandbox. E.g.
stacklocation:"/var/www/m501/public/question/type/stack"$
load("s_test_case.mac");
- Run tests of JavaScript in
tests/jest. Seetests/jest/Readme.md. - Remove
QTYPE_STACK_TEST_CONFIG_CI_LIGHTfrom CI config to run all unit tests. (If this constant is defined, the tests are skipped). - Run PHP unit tests.
- Run code checker.
- Is JSXGraph up to date? Check if the commit message for
corsscripts/jsxgraphcore.min.jsstates the same version number as jsxgraph.org. - If needed re-build the minified JavaScript (e.g.
npx grunt --root=question/type/stack). - Check version of JSXGraph.
- Ensure that
db/upgrade.phphas no additions that are dated older than the last release but were not present in the last release.
Check API
- Spin up the STACK API in Docker and check it still works with a selection of questions, including download and JSXGraph.
- Chances are it won't work because even the latest version of goemaxima is out of date.
- You will need to create a local up-to-date image of goemaxima:
- Clone the goemaxima repo and create a folder stack/STACKVERSION e.g.
stack/2024072400matching the latest STACK version. - Copy the stack/maxima folder from STACK into this new folder.
- Create
maximalocal.mac.templateas described inAdding_new_version.mdin goemaxima docs (or just copy from previous goemaxima version). - In
buildimage.shsetmaximaverandsbclvere.g.maximaver="5.45.1" sbclver="2.2.6". (maximavershould matchmaximalocal.mac.template) ./buildweb.sh(You may need to installgofirst:sudo snap install go --classic)../buildimage.sh 2024072400(If Docker struggles to fetch metadatasudo vi ~/.docker/config.jsonand changecredsStoretocredStore).- You should have now created a
goemaxima:2024072400-devimage locally. - Temporarily update STACK API locally:
- Update maxima image in STACK API to
goemaxima:2024072400-devindocker-compose.dev.yml. - The API reads
stackmaximaversionandversionfromstack/maxima/stackmaxima.macandversion.php, soconfig.phpdoes not need them. docker compose -f docker-compose.dev.yml up
Version numbers
- version.php
- stackmaxima.mac
-
Update Goemaxima docker image versions in
api/docker/docker-compose.dev.ymlandapi/docker/docker-compose.ymlE.g. seehttps://hub.docker.com/r/mathinstitut/goemaximafor latest versions. -
Run
php cli/getversionstring.phpand add output todoc/en/Installation/STACK_versions.md. - Change to
MATURITY_STABLEin version.php - Check both the Moodle versions, and the required number. (https://moodledev.io/general/releases) Update
Installation/index.md
Commit all changes to git, e.g. "Update version number for the 4.6.0 release."
The change log
Since 4.16.0 every significant change in functionality is recorded in agents/changelog.json, a file designed for AI agents, and the release notes in development history are generated from it. Each entry records the nature of the change, a workaround for earlier versions where there is one, the GitHub issue, and the version of the first release with the change, and empty for a known defect not yet fixed. Before the release the version is "dev" for a change on dev only, and "master" for a change committed directly to master (documentation, the question library, contributed Maxima code, agents). A change to contributed Maxima code or CASText templates on master is available between releases, to questions that load it with stack_include_contrib or template://, and "master" records that. A change on master must never depend on a core change that is only on dev: it has to work on the current release. Merging master into dev brings those entries with it, unchanged. A change made on dev and then also committed to master changes from "dev" to "master". The format is described in the file's about field.
The steps below are run on dev, before it is merged into master for the release.
- Run
php cli/changelog.php --check. The unit testtests/changelog_test.phpruns the same checks. - Run
php cli/changelog.php --heading="Version 4.16.0 (2026120100)", with the new release name and$plugin->version, and put the output at the top of development history, adding any introduction by hand. Edit the wording inagents/changelog.json, not in the history, and run it again. - Once
version.phphas the new number, runphp cli/changelog.php --release=2026120100, with the same number. This gives every"master"and"dev"entry that version. - Commit the change log with the version numbers.
2. Create new tag with version name
E.g. "v4.15.0".
- Push to GitHub.
- Push tags to GitHub
- TortoiseGit: pulldown from push
- Linux:
git tag -a v4.15.0 -m "Update version number for the 4.15.0 release." - Linux:
git push - Linux:
git push --tags
3. Moodle marketplace entry for the plugin
- Add a new version to the Moodle marketplace entry for the plugin.
- Copy development history to marketplace release notes.
4. Releasing a new version of the API to take advantage of the new release
- Prompt to update the Goemaxima image,
mathinstitut/goemaxima:VERSION-latest, whereVERSIONis$plugin->version. - Pushing the release tag runs the GitHub workflow
publish_api_image, which builds the API image from the tag and publishes it asstackmaths/stackapi:VERSION-latest. Check the workflow succeeded and the image is on Docker Hub. It needs the repository secretsDOCKERHUB_USERNAMEandDOCKERHUB_TOKEN. To publish an image for an earlier release, run the workflow by hand with that release's tag. - Users need both images with the same
VERSION: one API image for every release keeps the API usable whichever release a site runs.