internal errors for platform string
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### Bug Description
Invalid platform that contain a string rather than a dict produce an internal error:
```bash
> testcraft pack
testcraft internal error: AttributeError("'str' object has no attribute 'get'")
Full execution log: '/home/callahan.kovacs@canonical.com/.local/state/testcraft/log/testcraft-20250428-081754.712525.log'
```
### To Reproduce
testcraft pack
### part yaml
```shell
name: testcraft
version: "0.1"
base: ubuntu@24.04
platforms:
my-platform:
amd64
parts:
my-test:
plugin: nil
```
### Relevant log output
```shell
2025-04-28 08:17:54.713 Starting testcraft, version dev
2025-04-28 08:17:54.713 Log verbosity level set to BRIEF
2025-04-28 08:17:54.716 Preparing application...
2025-04-28 08:17:54.716 Merging commands for group 'Lifecycle':
2025-04-28 08:17:54.716 Configuring application...
2025-04-28 08:17:54.716 Setting up ConfigService
2025-04-28 08:17:54.716 App is not running as a snap - snap config handler not created.
2025-04-28 08:17:54.716 Setting up ProjectService
2025-04-28 08:17:54.717 Loading project file '/home/callahan.kovacs@canonical.com/dev/craft/craft-application/testcraft/testcraft.yaml
2025-04-28 08:17:54.719 testcraft internal error: AttributeError("'str' object has no attribute 'get'")
2025-04-28 08:17:54.719 Traceback (most recent call last):
2025-04-28 08:17:54.720 File "/home/callahan.kovacs@canonical.com/dev/craft/craft-application/craft_application/application.py", line 615, in run
2025-04-28 08:17:54.720 return_code = self._run_inner()
2025-04-28 08:17:54.720 ^^^^^^^^^^^^^^^^^
2025-04-28 08:17:54.720 File "/home/callahan.kovacs@canonical.com/dev/craft/craft-application/craft_application/application.py", line 581, in _run_inner
2025-04-28 08:17:54.720 project_service.configure(platform=platform, build_for=build_for)
2025-04-28 08:17:54.720 File "/home/callahan.kovacs@canonical.com/dev/craft/craft-application/craft_application/services/project.py", line 75, in configure
2025-04-28 08:17:54.720 platforms = self.get_platforms()
2025-04-28 08:17:54.720 ^^^^^^^^^^^^^^^^^^^^
2025-04-28 08:17:54.720 File "/home/callahan.kovacs@canonical.com/dev/craft/craft-application/craft_application/services/project.py", line 268, in get_platforms
2025-04-28 08:17:54.720 self.__platforms = self._preprocess_platforms(raw_project["platforms"])
2025-04-28 08:17:54.720 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-28 08:17:54.720 File "/home/callahan.kovacs@canonical.com/dev/craft/craft-application/craft_application/services/project.py", line 242, in _preprocess_platforms
2025-04-28 08:17:54.720 cls._vectorise_platforms(platforms)
2025-04-28 08:17:54.720 File "/home/callahan.kovacs@canonical.com/dev/craft/craft-application/craft_application/services/project.py", line 228, in _vectorise_platforms
2025-04-28 08:17:54.720 if data.get("build-for") is None and name in (
2025-04-28 08:17:54.720 ^^^^^^^^
2025-04-28 08:17:54.720 AttributeError: 'str' object has no attribute 'get'
2025-04-28 08:17:54.720 Full execution log: '/home/callahan.kovacs@canonical.com/.local/state/testcraft/log/testcraft-20250428-081754.712525.log'
```
Evaluation history
No evaluation history available.