Refactor platform validation
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### What needs to get done
`platform` validation occurs in `rockcraft.models.BuildPlanner` and `rockcraft.models.Project`. This can be combined in `rockcraft.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_
### Why it needs to get done
Code debt
Evaluation history
No evaluation history available.