Repository navigation
Conversation
A path listed with both "mutable: true" and "until: mutate" is accepted by the release validation, but writing it from a mutation script failed the whole cut with "cannot mutate path in report: ... not previously added". Such paths are kept out of the manifest report when they are created, so the write callback has to skip the report as well.
mutable: true, until: mutate
A path listed with both "mutable: true" and "until: mutate" passed release validation but failed the whole cut when a mutation script wrote it, with "cannot mutate path in report: ... not previously added", since such paths are kept out of the manifest report. The combination is now rejected when the release is read instead of being special-cased in the slicer, which keeps the manifest rules simple. No release branch uses it.
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain.
0 open findings
What changed in this PR
Adds release validation to reject mutable: true combined with until: mutate, preventing a cut-time failure.
Changes:
- Rejects the incompatible path options.
- Adds regression coverage for the validation error.
| File | Summary |
|---|---|
internal/setup/yaml.go |
Validates incompatible path options. |
internal/setup/setup_test.go |
Tests the new validation rule. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
upils
left a comment
There was a problem hiding this comment.
@lczyk This is an interesting one because I don't think it is obvious that this case must be invalid.
I think we could have situation were we extract a path foo, mutate it, use the result to mutate another path bar and then get rid of foo. I am thinking about inter-script communication. But I will need to check if we want to allow that or not.
yeah, i've thought about this afterwards, but decided ultimately to go with this because it's easier to allow smth in the future rather than then disallow it (regression). also we're not doing anything like this atm so disllowing it wouldn't hurt. kindof like the "if in doubt, don't include it" principle for making slices |
did some formal verification (fizzbee, my specs are here and here) of the
cutpath and found 7 minor bugs:preferignores x-arch paths #330mutable: true, until: mutate#331 (this PR)until: mutate#333$ chisel info --release ./ test-package_myslice package: test-package slices: myslice: contents: /dir/text-file: {text: data1, mutable: true, until: mutate} mutate: content.write("/dir/text-file", "data2") $ chisel cut --release ./ --arch amd64 --root $rootfs test-package_myslice Extracting files from package "test-package"... error: slice test-package_myslice: cannot mutate path in report: /dir/text-file not previously addedthe release validates fine but does not cut.
repro using
chisel-proxy(which does not reimplement any of the chisel logic, so definitely not a proxy bug)fix
a path that is removed after mutate has no business being mutable. the combination is now rejected at validation time.
mutable: true, until: mutatedoes not appear in any of the ubuntu branches on chisel-reelases: