i/statemachine: fix manifest generation for classic image#288
i/statemachine: fix manifest generation for classic image#288
Conversation
2031a11 to
b3228f7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #288 +/- ##
==========================================
- Coverage 93.52% 93.40% -0.13%
==========================================
Files 19 19
Lines 3539 3563 +24
==========================================
+ Hits 3310 3328 +18
- Misses 150 153 +3
- Partials 79 82 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
(I'll do the coverage if you do accept the modification) |
| } | ||
|
|
||
| // GenerateClassicManifest generate the classic manifest file for the given rootfs | ||
| func GenerateClassicManifest(rootfs string, outputPath string, debug bool) error { |
There was a problem hiding this comment.
does this need to be exported?
There was a problem hiding this comment.
Yes, it is used in classic_state.go.
There was a problem hiding this comment.
that's in the same package though? my Go is a bit rusty but I'm not that out of it yet!
There was a problem hiding this comment.
My Go is a bit too new, so I did not know it works like this :)
mwhudson
left a comment
There was a problem hiding this comment.
i do want you to unexport GenerateClassicManifest please
| } | ||
|
|
||
| // GenerateClassicManifest generate the classic manifest file for the given rootfs | ||
| func GenerateClassicManifest(rootfs string, outputPath string, debug bool) error { |
There was a problem hiding this comment.
that's in the same package though? my Go is a bit rusty but I'm not that out of it yet!
Make the classic image manifest follow the same format as the one from livecd-rootfs. Changes: * Use tab instead of space in the manifest * Add snaps to the manifest
b3228f7 to
7d550e6
Compare
upils
left a comment
There was a problem hiding this comment.
The manifest currently produced is very likely consumed by some tools by some people. So this change would be a breaking change due to the 2 changes you mention in the description. I would like to avoid that if possible.
I am more inclined to post-process the output than change it. We have unfortunately no way to express the format version so this will be a surprising change for users.
I assume the space->tab issue could be solved with a call to sed. Is that so or is that more complex?
Also, in the README, it is clearly stated that the manifest lists packages, the current proposition would change this definition.
I agree the snaps list is currently missing and that would be nice to extract it. What do you think of generating another separate "snaps.manifest" file, listing snaps (and maybe using the tab separator?)? A bit a thinking is needed to define how that would be expressed in the image definition file but we can discuss it.
With that, the post-process would also be trivial before calling sbom-generate.
| return nil | ||
| } | ||
|
|
||
| // generateClassicManifest generate the classic manifest file for the given rootfs |
There was a problem hiding this comment.
| // generateClassicManifest generate the classic manifest file for the given rootfs | |
| // generateClassicManifest generates the classic manifest file for the given rootfs |
It is what I'm afraid of.
I guess the tab/space issue could be also solved on sbom side (i.e. accepting both). But we do need the snap list.
Could we add another artifact entry and generates that manifest (tab + snap) if specified? Not sure about a name tho, as it is also a manifest ^^´ |
This is another possibility but as you pointed out it might be tricky to find a good name (because the concept might be hard to express, which might indicate something is fishy). Side note: this is unlikely, but if we ever add another kind of object, the "full-manifest" name might be misleading or might see its definition change. Another approach would be to add a new "manifest-v2" (name TBD here too) that would accept a list of "kinds" (
|
The fishy part is that we have different tools that output different manfiests and we're trying to align them ^^´
Yeah, the point is to have the same manifest format everywhere, so I don't think it is a good idea to give user customization. |
Make the classic image manifest follow the same format as the one from livecd-rootfs.
Changes: