snapcraft
snapcraft copied to clipboard
Refactor `platform` validation
Based on Rockcraft, the platform
validation occurs in snapcraft.models.SnapcraftBuildPlanner
and snapcraft.models.Project
. This can be combined in snapcraft.models.Project
.
Scope of work:
- [ ] move and rework validation code
- [ ] adjust unit tests
- [ ] adjust types in both models and satisfy the type checkers
Source
It feels that we handle this by defining a platform model separately and let pydantic do the heavylifting of hierarchically validating platforms
as a list of platform models, isn't that possible? It would reduce the complexity of this validator.
Originally posted by @cmatsuoka in https://github.com/canonical/snapcraft/pull/4630#discussion_r1517943384