some commands, like clean, should not need schema validation
cjdcordeiro opened this issue · comments
Cristovao Cordeiro commented
Bug Description
Some commands, like clean, should not need such a strict schema validation, if all they gonna do is “clean”. IoW, if I want to clean
my project, the YAML shouldn't have an impact on the operation.
To Reproduce
Write a bogus rockcraft.yaml and run rockcraft clean
.
Environment
Any
rockcraft.yaml
name: my-rock
base: ubuntu@22.04 # the base environment for this rock
version: '0.1' # just for humans. Semantic versioning is recommended
summary: Single-line elevator pitch for your amazing rock # 79 char long summary
description: |
This is my-rock-name's description. You have a paragraph or two to tell the
most important story about it. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the
container registries out there.
platforms: # the platforms this rock should be built on and run on
amd64:
some-unsupported-field: foo
parts:
my-part:
plugin: nil
Relevant log output
Bad rockcraft.yaml content:
- extra field 'some-unsupported-field' not permitted in top-level configuration
For more information, check out: https://documentation.ubuntu.com/rockcraft/en/stable/reference/rockcraft.yaml
Tiago Nobrega commented
I agree in the general sense but not with the example: the name, platforms and base are how we keep track of the instances (so we wouldn't know what to clean without them):
❯ lxc --project=rockcraft list
+---------------------------------------------------------------+---------+------+------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+---------------------------------------------------------------+---------+------+------+-----------+-----------+
| base-instance-rockcraft-buildd-base-v7-c-a38d05774a6de0cf6ab1 | STOPPED | | | CONTAINER | 0 |
+---------------------------------------------------------------+---------+------+------+-----------+-----------+
| rockcraft-hello-on-amd64-for-amd64-16398450 | STOPPED | | | CONTAINER | 0 |
+---------------------------------------------------------------+---------+------+------+-----------+-----------+
| rockcraft-redis-on-amd64-for-amd64-16519802 | STOPPED | | | CONTAINER | 0 |
+---------------------------------------------------------------+---------+------+------+-----------+-----------+
Cristovao Cordeiro commented
True, good point. I choose the wrong attribute to remove 😆 (updating the description)