Skip to content

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 07 Sep 19:15
· 35 commits to main since this release
v2.0.0
2fe80d8

This release adopts servicekit 2.0 (2.0.2 pinned) and carries the changes from the September 2026 review of chapkit itself. Several of them change public behavior, so the major version is bumped. chap-core integrates over the HTTP contract and every endpoint it uses keeps its shape, but its Python client on chapkit 1.x validates /api/v1/info strictly and rejects the three new provenance fields; chap-core needs the small fix in dhis2-chap/chap-core#564 (validate the service info with its tolerant local schema) before talking to 2.0 services.

Breaking changes

  • POST is create-only. Config and artifact routes answer 409 Problem Details when the supplied id already exists. PUT is the update path and applies exactly the fields sent; an explicit null clears a nullable field.
  • Every error is RFC 9457 Problem Details (application/problem+json) with a trace_id: request validation (422 with a structured errors list), database errors (409 for integrity violations with a constraint extension, 500 otherwise, SQL never leaks), the job router, and the config, ML and artifact routers, which now raise servicekit exceptions with an instance pointing at the resource. Clients that parsed the old {"detail": ...} bodies must switch.
  • GET /health returns 503 when unhealthy. degraded and healthy return 200.
  • Pagination bounds are enforced. page >= 1 and 1 <= size <= 100, else 422. Listings are ordered by id.
  • Failing shell scripts fail the job. A non-zero train or predict exit stores the diagnostic workspace artifact under the id returned by the 202 response and then fails the job; the artifact id is repeated in the job error and artifact_id on the failed job stays null.
  • JobStatus.canceling is reported for synchronous jobs still winding down after cancellation.
  • ConfigManager.unlink_artifact and ConfigRepository.unlink_artifact take (config_id, artifact_id). Unlinking through a config that does not own the link returns 404.
  • Custom operations follow CRUD permissions. $link-artifact and $unlink-artifact register only when updates are allowed; $artifacts, $tree, $expand and $config only when reads are allowed.
  • Artifact writes reject cycles and over-deep nesting. Self-parenting, reparenting beneath a descendant, and trees deeper than 64 levels return 400.
  • Application-scoped state. servicekit 2.0 removed the module-level set_database, set_scheduler and set_app_manager; lifespans capture the objects they need instead.

Added

  • MLServiceInfo gains git_revision, chapkit_version and servicekit_version, filled from the GIT_REVISION environment variable and installed package metadata when left unset. They appear on /api/v1/info, in registration, in the console Overview and in chapkit test --verbose.
  • Scaffold: ARG/ENV GIT_REVISION in the Dockerfile, forwarded by compose.yml and the migrate Makefile; chapkit init also writes a .dockerignore and a GHCR publish workflow with sha and semver tags.
  • Scaffold hardening matching chap-core: the image runs as the unprivileged chapkit user (created only when the base image lacks it) and compose.yml sets init, read_only, cap_drop: ALL, no-new-privileges, a tmpfs on /tmp and a named volume for /work/data. Migrated renv projects restore into /opt/renv/cache with the sandbox disabled.
  • Web console: schema-driven config form, deep-linkable Jobs with bulk remove and group-by-status, apply-from-dry-run on Train and Predict, resizable sidebar and master/detail panels, the canceling status, contiguous prediction sample data.
  • chapkit mlproject migrate lifts its chapkit floor to N.0.0 when the running major is newer, so 2.x emits chapkit>=2.0.0,<3.

Fixed

  • Config data is persisted fully validated, so defaults and default factories are frozen at write time instead of re-evaluated on every read.
  • The $schema operation keeps referenced $defs, including the root definition for recursive configs.
  • Cancelling a shell job kills the whole process group and removes the runner workspace; a failed prediction keeps its diagnostic workspace even when its output file is unparseable.
  • Console timestamps are parsed as UTC; the console manifest carries the chapkit version.
  • Scaffolded README $train and $predict examples use the accepted request shape; R scaffolds note the yaml package for local runs; SQLite sidecar files are excluded from workspace zips.

Upgrading

  • Pin chapkit>=2.0.0,<3. chapkit init and chapkit mlproject migrate emit this.
  • Add ARG GIT_REVISION="" and ENV GIT_REVISION=${GIT_REVISION} to existing Dockerfiles, and copy the USER chapkit and compose hardening blocks from a fresh scaffold if you want the same posture.
  • Handle 409 on POST with an existing id, Problem Details bodies for every error, and failed jobs for failing scripts.
  • Tooling: fastapi 0.141, starlette 1.6, uvicorn 0.52, ruff 0.16 (Markdown excluded from formatting), Playwright 1.63, uv_build 0.12 series. Run playwright install chromium locally after upgrading.

servicekit release notes: https://github.com/dhis2-chap/servicekit/releases/tag/v2.0.0, v2.0.1, v2.0.2

What's Changed

  • chore: bump version to 1.2.0.dev0 by @mortenoh in #73
  • feat: web console roadmap follow-ups by @mortenoh in #74
  • chore: add npm Dependabot updates for frontend by @mortenoh in #75
  • chore(deps): combine dependabot updates for github-actions, python, and frontend by @mortenoh in #88
  • chore: adopt servicekit 2.0.0 by @mortenoh in #93
  • chore(deps): bump the frontend-dependencies group across 1 directory with 16 updates by @dependabot[bot] in #92
  • chore: build GitHub release notes from the annotated tag message by @mortenoh in #95
  • fix: fail jobs on failing shell scripts, emit problem details, correct scaffolded README by @mortenoh in #96
  • docs: document failed shell-script jobs and servicekit 2.0 CRUD semantics by @mortenoh in #97
  • chore: require servicekit 2.0.2 and use the public JobOptions by @mortenoh in #98
  • feat: expose git revision and library versions on /api/v1/info by @mortenoh in #99
  • chore: harden scaffolded Dockerfile and compose to chap-core posture by @mortenoh in #100
  • chore: release prep, dependency upgrades and console fixes by @mortenoh in #101
  • fix: address pre-release review findings by @mortenoh in #102
  • build: create the scaffold's chapkit user only when the base image lacks it by @mortenoh in #103
  • chore: release 2.0.0 by @mortenoh in #104

Full Changelog: v1.1.0...v2.0.0