← Back to issue list

feat(models): make the Platforms schema and processing work the same

View original Github issue

Metadata

Project
craft-application
Number
#735
Type
pull request
State
merged
Author
lengau
Labels
Created
Updated
Closed

Current evaluation

Merged after approvals and CI. Adds a generic PlatformDict class to standardize Pydantic schema and processing for Platforms, resolving #688 and CRAFT-4421. The 16-file change defers changelog updates to a separate PR.

Suggested action:

No scores available.

Issue body

This adds a PlatformDict class that behaves as a standard dictionary, but allows pydantic to model it and its schema correctly. The implementation is in a generic class (GenericPlatformsDict) that allows overriding of both the Platform type (if an application needs to modify its Platform model) and the keys that can be used as shorthands. Demo in Rockcraft: https://github.com/canonical/rockcraft/pull/862 Fixes #688 CRAFT-4421 - [x] Have you followed the guidelines for contributing? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint && make test`? - [x] Have you added an entry to the changelog (`docs/reference/changelog.rst`)? ---

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged after approvals and CI. Adds a generic PlatformDict class to standardize Pydantic schema and processing for Platforms, resolving #688 and CRAFT-4421. The 16-file change defers changelog updates to a separate PR.
qwen3.6-35b-a3b-mtp-q6 Merged. Adds a generic PlatformDict class to standardize pydantic schema and processing for platforms, allowing type and key overrides. Resolves #688 and CRAFT-4421. Changelog and documentation updates will follow separately.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#736 docs(models): add reference and how-to for Platforms models. craft-application merged Merged documentation update adding reference and how-to guides for Platforms models. Approved by four reviewers, passed all CI checks, and included in the changelog as part of CRAFT-4421 and CRAFT-4485.
75%
#867 feat(project): update Platform schema rockcraft merged Merged, updating the Platform schema and superseding #862. Approved by two reviewers with 96 additions and 19 deletions across 16 files. The merge proceeded despite a failing OSV-scanner CI check.
71%