fix: convert build-for to a string before serializing to metadata
Metadata
Current evaluation
Merged PR #1014 as commit e5ee496e, fixing #992 by converting build-for to a plain string before YAML metadata serialization and preventing architecture-specific YAML tags.
Resolution: closed resolved
Reason: PR #1014 was merged as commit e5ee496e. Its fix explicitly resolves #992 by ensuring build-for is serialized as a plain string.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `make lint && make test`?
---
The `build-for` field was not being passed appropriately to `yaml.dump`. Since `DebianArchitecture` inherits from `str`, linters did not complain that `DebianArchitecture != str`, but `yaml.dump` was selecting `DebianArchitecture` as the object type to serialize. This led to yaml tags being dumped in, instead of plain strings.
Fixes #992.
ROCKCRAFT-271
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1014 as commit e5ee496e, fixing #992 by converting build-for to a plain string before YAML metadata serialization and preventing architecture-specific YAML tags. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #1014 (e5ee496e), fixing #992 by converting build-for to a plain string before YAML serialization, preventing DebianArchitecture YAML tags in metadata. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix converting the build-for field to a string before YAML serialization. This prevents yaml.dump from adding unwanted object tags caused by DebianArchitecture inheriting from str. Resolves #992 and ROCKCRAFT-271. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for #992 resolving a serialization bug where build-for generated unwanted YAML tags. The change converts the DebianArchitecture object to a string before yaml.dump, ensuring plain string metadata output. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/rockcraft#992
(confidence 100%)
PR #1014 states that it fixes the incorrectly serialized architecture field reported in issue #992.
Related issues
No related issues found above the similarity threshold.