Updating the deployed versions of Scribunto external packages occurs after fetching of the new packages is complete.
There will be a wiki page holding JSON, which simply maps the name of each package to its deployed tag name. MediaWiki:Packages.json?
To authorise saving the page:
- Confirm that all package versions exist and are in the "ready" state (see T412320).
- Load the manifest files and file lists for the specified versions.
- Confirm that any cross-package dependencies are satisfied.
- Allow Scribunto to validate the manifest files.
After saving the page:
- Insert a row into the deployment state table.
- Allow Scribunto to build a runtime accelerator blob. This is a map of module name to package and file name which will be used by the runtime loader (T412181).
- Insert the runtime accelerator blob, linked to the deployment state ID.
- Insert rows linking the package version ID (see T412320) to the deployment state ID.
- If the elapsed time is greater than the purge sleep time (T412473) then it's necessary to recheck the package states and potentially abort the deployment.
- There will be a table with a single row which links to the active deployment state ID. Update this table.