feat(models): make the Platforms schema and processing work the same
Metadata
Current evaluation
Merged #735 in commit 6efd2941, adding generic platform dictionaries so Pydantic/JSON schemas match platform processing; it fixes #688 (CRAFT-4421).
Resolution: closed resolved
Reason: PR #735 was approved and merged as commit 6efd2941. Its generic Platforms dictionary implementation resolves the schema/processing discrepancies tracked by #688.
Evaluated by: mr-cal-bot
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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged #735 in commit 6efd2941, adding generic platform dictionaries so Pydantic/JSON schemas match platform processing; it fixes #688 (CRAFT-4421). | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/craft-application#735 (commit 6efd2941), adding generic platform dictionaries so Pydantic schemas and platform processing agree. Fixes #688/CRAFT-4421. | |
| 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. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/craft-application#688
(confidence 100%)
The merged PR explicitly states that it fixes issue #688.
-
Related To:
canonical/rockcraft#862
(confidence 95%)
Rockcraft PR #862 demonstrated usage of the new generic platform dictionary.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #736 docs(models): add reference and how-to for Platforms models. | craft-application | merged | Merged in canonical/craft-application#736 via commit 469bf24f, adding Platforms/PlatformsDict reference docs and a guide for app-specific platform models. | |
| #936 feat!(platform): add reserved platform names | craft-application | merged | Merged PR #936 (commit b534c8a8) adding RESERVED_PLATFORM_NAMES in craft_application/models/platforms.py, blocking '*' and 'any'; fixes #890 (CRAFT-4747). Includes ruff 0.14.0 bump. |