← Back to issue list

Improve Pydantic schema for parts

View original Github issue

Metadata

Project
craft-parts
Number
#1330
Type
issue
State
open
Author
bepri
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Triaged enhancement to model source, override, build/stage package, and snap properties directly in the Pydantic part schema; the raw-dictionary workaround remains in the codebase.

Suggested action: keep open

Reason: The maintainer-authored request is explicitly scoped and triaged. The current schema still handles these keys through patternProperties, while PartsFile.parts remains dict[str, Any], so removing the raw-dictionary workaround requires further implementation.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 16 Complexity: 57 Confidence: 96 Actionability: 84

Issue body

### What needs to get done Support part properties such as `source-*`, `override-*`, and `build/stage-packages/snaps` directly in the Pydantic schema, instead of through raw dicts. ### Why it needs to get done Spawned by the following TODO comment: https://github.com/canonical/craft-parts/blob/a20b49d1b27ecd00ab74eb786d0f2403184adc97/craft_parts/pydantic_schema.py#L101

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 45
Quick Win: 16
Complexity: 57
Confidence: 96
Actionability: 84
keep open Triaged enhancement to model source, override, build/stage package, and snap properties directly in the Pydantic part schema; the raw-dictionary workaround remains in the codebase.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 13
Complexity: 40
Confidence: 70
Actionability: 70
keep open Enhancement to add typed support for source-*, override-*, and build/stage-packages/snaps in Pydantic schema instead of raw dicts. Triaged, open for 363 days with no activity.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 20
Staleness: 70
Complexity: 50
Confidence: 80
Support Request: 0
keep open Enhancement to model part properties (source-*, override-*, build/stage-packages/snaps) directly in the Pydantic schema instead of raw dicts. Triaged by a maintainer; no activity for ~11 months and the patternProperties workaround still exists in current code.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 55
Confidence: 85
Support Request: 5
keep open Enhancement to replace raw dicts with typed Pydantic models for part properties like source-*, override-*, and build/stage-packages. Triaged but inactive for 301 days with no maintainer progress.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 45
Confidence: 75
Support Request: 5
keep open Enhancement to replace raw dicts with typed Pydantic models for craft-parts properties. Triaged but inactive for ~9.5 months with no implementation progress.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-parts#781 (confidence 98%)

    Commit 09a99811 introduced the JSON-schema work and the TODO that spawned this enhancement.

Related issues

Issue Project State Summary Similarity
#118 Make Pydantic models more idiomatic craft-archives open Pydantic 2 modernization and schema-enabling model metadata now appear implemented through later cleanup and model-documentation changes, despite the issue remaining open.
71%
#776 feat: add pydantic models for all sources craft-parts merged Merged PR #776 added Pydantic models for every source, enabling whole-part JSON schema generation and building on prerequisite PR #775.
71%