Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • slapos slapos
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 136
    • Merge requests 136
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • slaposslapos
  • Merge requests
  • !2085

slapconfiguration: support jsonschema >= 4.18 via the referencing library

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Cédric Le Ninivin requested to merge cedric.leninivin/slapos:slapconfiguration-jsonschema-referencing into master May 07, 2026
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 2

jsonschema 4.18 deprecated the in-tree RefResolver and routes cross-file $ref resolution through the new referencing library. It also inlined Validator.descend so it no longer goes through iter_errors, which breaks the recipe's collect-defaults / unstringify scheme that relies on seeing every descended sub-schema. Without this fix bumping jsonschema above 4.17.x causes 40 errors + 18 silent failures in the JsonSchema* test classes (PointerToNowhere on cross-file $ref, plus defaults and unstringification silently noop'ing).

The fix is gated on a runtime detection of referencing so older Python 2 / jsonschema 3.0.2 environments keep working unchanged:

  • Build a referencing.Registry(retrieve=...) driven by SoftwareReleaseSchema._readAsJson to lazily load sibling schema files; pass it via a new registry= kwarg on DefaultValidator and forward it to the validator constructor in validate().
  • Add helpers (_capture_scope, _apply_scope, _resolver_of) that switch between validator.resolver.base_uri / push_scope (RefResolver) and validator._resolver / evolve(_resolver=...) (referencing.Resolver). Use them in iter_errors, memoize_defaults, collect_defaults, apply_unstringify, fetch_key.
  • Re-route kls.descend through evolved.iter_errors(instance) on jsonschema >= 4.18 so the recipe's iter_errors wrapper observes every sub-schema descent again.

stack/slapos.cfg: bump jsonschema 4.17.3 -> 4.23.0 and pin its new transitive deps (referencing, jsonschema-specifications, rpds-py) so the stack can carry the new resolver chain. Wheel-only because rpds-py builds with maturin and referencing / jsonschema-specifications use hatchling.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: slapconfiguration-jsonschema-referencing
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7