← Back to issue list

fix(project): raise a validation error for non-mapping platforms

View original Github issue

Metadata

Project
craft-application
Number
#1241
Type
pull request
State
open
Author
18Abhinav07
Labels
—
Created
Updated
Closed
—

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

Fixes #750 A platform given as a string or list (e.g. `my-platform: amd64`) crashed with an AttributeError, since both `_vectorise_platforms` and `Platform._validate_platform_set` call `.get()` on it. Both now pass non-mappings through so pydantic reports a normal validation error for `platforms.my-platform`. Added string and list cases to `test_get_platforms_bad_value`. I ran ruff, ty, codespell and the full test suite in a Linux container rather than `make lint && make test`. No new failures: the tests that fail there fail on main too. --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/craft-application/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [ ] I've successfully run `make lint && make test`. - [ ] I've added or updated any relevant documentation. - [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing. - [x] I've updated the relevant release notes.

Evaluation history

No evaluation history available.

Update history

Date Change
updated
created

Related issues

No embedding available for this issue yet. Run scripts/run_llm.py evaluate to enable similarity search.