feat: multiple pydantic 2 fixes and papercuts
Metadata
Current evaluation
Merged Pydantic 2 fixes for rockcraft: root error conversion, updated platform dict, public regex validator, YAML utility, per-part validation, and refined error messages. Approved by two reviewers and merged across 9 files.
Suggested action: —
No scores available.
Issue body
This PR has multiple Pydantic 2-related changes (mostly fixes), needed for rockcraft. One per commit:
- correctly convert root-level errors;
- have `_populate_platforms()` return a dict of dicts;
- make `get_validator_by_regex()` public (rockcraft has a different project name regex);
- add `to_yaml_string()` utility method, analogous to `to_yaml_file()`;
- validate each part individually;
- drop the `value error, ` prefix in validation errors.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged Pydantic 2 fixes for rockcraft: root error conversion, updated platform dict, public regex validator, YAML utility, per-part validation, and refined error messages. Approved by two reviewers and merged across 9 files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged Pydantic 2 fixes for rockcraft. Corrected root-level error conversion, updated _populate_platforms return type, exposed get_validator_by_regex, added to_yaml_string, implemented per-part validation, and removed value error prefix. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #663 chore!: migrate to pydantic 2 | rockcraft | merged | Merged after approval by four reviewers, migrating the codebase to Pydantic 2. The update drops the Rockcraft Platform model, applies necessary cleanups, and resolves issue #657 across 27 files. | |
| #401 build!: update to pydantic 2 | craft-application | merged | Merged to update the codebase to Pydantic 2. Approved by two reviewers and passed CI. The change modified 23 files (+531/-342). Initial test failures were resolved after the craft-grammar dependency received a corresponding update. | |
| #103 feat: upgrade to pydantic 2.x | craft-archives | merged | Merged the pydantic 2.x upgrade after passing CI and receiving three approvals. The maintainer moved the 13 unresolved review comments to a follow-up issue. | |
| #33 chore!: update to Pydantic 2 | craft-grammar | merged | Merged update to Pydantic 2. Resolves issue #32 by addressing breaking changes in grammar validation error messages. Approved by two reviewers, passed CI checks, and modified five files (+40/-41 lines). | |
| #36 chore!: update to pydantic 2 | craft-grammar | merged | Merged the Pydantic 2 migration across five files. Approved by two reviewers and passed CI. The maintainer manually verified the author's Canonical employment to override an automated CLA check failure before finalizing the merge. |