← Back to issue list

Use pydantic instead of jsonschema for legacy store

View original Github issue

Metadata

Project
snapcraft
Number
#5655
Type
issue
State
open
Author
bepri
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed

Current evaluation

Enhancement to migrate legacy store response parsing (channel_map.py) from pinned jsonschema 2.6.0 to Pydantic models. Triaged by a maintainer with Jira ticket SNAPCRAFT-1203, but no activity for over a year; code at HEAD still uses jsonschema, so the work remains.

Suggested action: keep open

Reason: The issue is labelled 'Status: Triaged' and 'Type: Enhancement', was filed by maintainer bepri, and has an internal Jira ticket (SNAPCRAFT-1203). Verification at HEAD confirms it is still applicable: pyproject.toml pins jsonschema==2.6.0 and snapcraft/store/channel_map.py still makes 7 jsonschema.validate() calls, so it is not stale-irrelevant despite 384 days without activity. Sibling issue #5654 (legacy project) was closed as abandoned, but this store-side issue remains open and valid.

Impact: 25 Quick Win: 13.75 Staleness: 70 Complexity: 45 Confidence: 80 Support Request: 5

Issue body

### What needs to get done The legacy code for parsing the store responses should use Pydantic models instead of validating with the `jsonschema` library. ### Why it needs to get done The current legacy code uses a pinned version of jsonschema that is very difficult to upgrade. Instead of upgrading, the code should just move over to using the more modern pydantic models.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 25
Quick Win: 13.75
Staleness: 70
Complexity: 45
Confidence: 80
Support Request: 5
keep open Enhancement to migrate legacy store response parsing (channel_map.py) from pinned jsonschema 2.6.0 to Pydantic models. Triaged by a maintainer with Jira ticket SNAPCRAFT-1203, but no activity for over a year; code at HEAD still uses jsonschema, so the work remains.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 40
Confidence: 85
Support Request: 5
keep open Enhancement to replace pinned jsonschema with pydantic for legacy store parsing. Triaged by a maintainer, currently inactive for over a year with no assigned work or progress.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 85
Support Request: 0
keep open Enhancement to replace pinned jsonschema with Pydantic models for legacy store response parsing. Triaged by maintainer, inactive for over a year, awaiting implementation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 30
Confidence: 80
Support Request: 5
keep open Replace jsonschema with Pydantic models for legacy store parsing to unblock dependency upgrades. Triaged enhancement awaiting implementation. Jira ticket SNAPCRAFT-1203 created.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#5653 (confidence 85%)

    Open sibling issue for the same pydantic-over-jsonschema migration, but targeting legacy project parsing rather than store parsing.

  • Related To: snapcraft#5654 (confidence 75%)

    Closed sibling issue for legacy project parsing, abandoned without implementation; indicates the project-side migration was dropped while this store-side issue stays open.

Related issues

Issue Project State Summary Similarity
#5653 Use pydantic instead of jsonschema for legacy project snapcraft open Migrate legacy snapcraft project parsing from jsonschema to Pydantic models. Issue was closed as abandoned, but the legacy code (snapcraft_legacy) has since been removed entirely from the codebase, making the issue moot.
80%
#5654 Use pydantic instead of jsonschema for legacy project snapcraft closed Abandoned. Closed without implementation or associated pull request. The legacy codebase retains the pinned jsonschema dependency, and no migration to Pydantic models was executed.
79%
#118 Make Pydantic models more idiomatic craft-archives open Task to modernize pydantic models for idiomatic pydantic 2 usage and better JSON schema generation. Filed by maintainer 817 days ago; pydantic 2 upgrade (#103) and follow-up commits have largely addressed the core concerns. No labels or maintainer response beyond Jira bot sync.
72%