-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: validate manifest before writing #159
Conversation
letFunny
commented
Oct 2, 2024
- Have you signed the CLA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I left a comment below about a function name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks. Only a trivial adding some notes to fastValidate.
internal/manifest/manifest.go
Outdated
@@ -301,3 +306,105 @@ func unixPerm(mode fs.FileMode) (perm uint32) { | |||
} | |||
return perm | |||
} | |||
|
|||
// fastvalidate validates the data to be written into the manifest on disk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please add:
// fastValidate validates the data to be written into the manifest.
// This is validating internal structures which are supposed to be correct unless there is
// a bug. As such, only assertions that can be done quickly are performed here, instead
// of it being a comprehensive validation of all the structures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and edited it as it's just an additional comment.
Name: "slice2", | ||
} | ||
|
||
var generateManifestTests = []struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new tests.
Sorry to make the question here. What's the plan, add a an essential manifest slice to all packages like we have for copyright? ex.: package: libc6
essential:
- libc6_copyright
- libc6_manifest
slices:
(...)
copyright:
contents:
/usr/share/doc/libc6/copyright:
manifest:
contents:
/var/lib/chisel/**: {generate: manifest} |
It doesn't need to be in We actually do provide the slice as of this writing. It's |
So, what I understood was:
And Am I right? |
Correct.
Nope. |