-
Notifications
You must be signed in to change notification settings - Fork 615
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
ignore minor parsing error when reading dpkg status files #786
Conversation
28b3ab8
to
75e5b0f
Compare
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.
A couple suggestions I think might help maintainability and unclear about a couple error handling path changes. The main bit of the go-humanize
addition looks great, though!
75e5b0f
to
63f75cc
Compare
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.
This comment: #786 (comment) was resolved but it doesn't look like there's a corresponding change or additional conversation here.
63f75cc
to
0b97c2f
Compare
helps with anchore#733 Question: should we add a smarter parser to guess approximate installed-size value? Signed-off-by: Jonas Galvão Xavier <[email protected]>
added unit tests to expand coverage of dpkg parsing Signed-off-by: Jonas Galvão Xavier <[email protected]>
added unit tests to handleNewKeyValue Signed-off-by: Jonas Galvão Xavier <[email protected]>
Signed-off-by: Jonas Galvão Xavier <[email protected]>
Signed-off-by: Jonas Galvão Xavier <[email protected]>
Signed-off-by: Jonas Galvão Xavier <[email protected]>
Signed-off-by: Jonas Galvão Xavier <[email protected]>
Signed-off-by: Jonas Galvão Xavier <[email protected]>
log warning with relevant context Signed-off-by: Jonas Galvão Xavier <[email protected]>
Signed-off-by: Jonas Galvão Xavier <[email protected]>
simpler error assertion Signed-off-by: Jonas Galvão Xavier <[email protected]>
Signed-off-by: Jonas Galvão Xavier <[email protected]>
3c83f16
to
75b0fde
Compare
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.
LGTM; just a couple suggestions that I wouldn't hold this up for
}{ | ||
{ | ||
name: "Test Single Package", | ||
name: "Test Single Package", | ||
fixturePath: filepath.Join("test-fixtures", "status", "single"), |
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.
FWIW all OSes can handle test-fixtures/status/single
, including Windows
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.
small comment about how we are parsing the size variables
* ignore minor parsing error when reading dpkg status files helps with #733 Question: should we add a smarter parser to guess approximate installed-size value? Signed-off-by: Jonas Galvão Xavier <[email protected]> * add datasize lib to help dpkg parsing added unit tests to expand coverage of dpkg parsing Signed-off-by: Jonas Galvão Xavier <[email protected]> * drop parse error added unit tests to handleNewKeyValue Signed-off-by: Jonas Galvão Xavier <[email protected]> * don't return parsing errors from dpkg Signed-off-by: Jonas Galvão Xavier <[email protected]> * go mod tidy Signed-off-by: Jonas Galvão Xavier <[email protected]> * test higher level functions Signed-off-by: Jonas Galvão Xavier <[email protected]> * return parsing err to let cataloger handle it Signed-off-by: Jonas Galvão Xavier <[email protected]> * feedback changes Signed-off-by: Jonas Galvão Xavier <[email protected]> * ignore key parsing error log warning with relevant context Signed-off-by: Jonas Galvão Xavier <[email protected]> * go mod tidy Signed-off-by: Jonas Galvão Xavier <[email protected]> * add context info to log lines simpler error assertion Signed-off-by: Jonas Galvão Xavier <[email protected]> * use error.As to assert error in chain Signed-off-by: Jonas Galvão Xavier <[email protected]>
…hore/syft into 510-attach-sbomb-attestation * '510-attach-sbomb-attestation' of https://github.com/anchore/syft: (63 commits) adjust attest options to be 12-factor-like update go.mod to latest cosign version update go mod update exported function for tests tests are passing configure failing tests ignore minor parsing error when reading dpkg status files (#786) update nit comments test harness for password verification update password select mechanism comment out test for future work Base64 encoder closing (#822) dog food attestation on syft image update function usage update correct predicate type formats for JSON update ci workflow to boostrap tools on cli tests update to bootstrap go update to find cosign temp access local temp directory check if cache issue ...
* ignore minor parsing error when reading dpkg status files helps with anchore#733 Question: should we add a smarter parser to guess approximate installed-size value? Signed-off-by: Jonas Galvão Xavier <[email protected]> * add datasize lib to help dpkg parsing added unit tests to expand coverage of dpkg parsing Signed-off-by: Jonas Galvão Xavier <[email protected]> * drop parse error added unit tests to handleNewKeyValue Signed-off-by: Jonas Galvão Xavier <[email protected]> * don't return parsing errors from dpkg Signed-off-by: Jonas Galvão Xavier <[email protected]> * go mod tidy Signed-off-by: Jonas Galvão Xavier <[email protected]> * test higher level functions Signed-off-by: Jonas Galvão Xavier <[email protected]> * return parsing err to let cataloger handle it Signed-off-by: Jonas Galvão Xavier <[email protected]> * feedback changes Signed-off-by: Jonas Galvão Xavier <[email protected]> * ignore key parsing error log warning with relevant context Signed-off-by: Jonas Galvão Xavier <[email protected]> * go mod tidy Signed-off-by: Jonas Galvão Xavier <[email protected]> * add context info to log lines simpler error assertion Signed-off-by: Jonas Galvão Xavier <[email protected]> * use error.As to assert error in chain Signed-off-by: Jonas Galvão Xavier <[email protected]>
Fixes #733
Question: should we add a smarter parser to guess approximate installed-size
value?
A: yes, this PR uses go-humanize to parse storage metadata better
This PR also drops dpkg cataloger from returning parsing errors, they should not stop Syft. Warning with context were added.
Signed-off-by: Jonas Galvão Xavier [email protected]