Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: make failed CPE validation correctly return error #2762

Merged
merged 4 commits into from
Oct 3, 2024

Conversation

willmurphyscode
Copy link
Contributor

@willmurphyscode willmurphyscode commented Apr 9, 2024

Previously, this method incorrectly return an empty Attributes object and a nil error, leading to callers attempting to use the empty attributes object.

We need to be careful with this, because turning on validation that previously had no effect is always a little scary. Creating for discussion for now.

This is one aspect of the cause of anchore/grype#1792

TODO:

  • look for callers of NewAttributes and make sure they have the right behavior when it returns an error; someone might be unintentionally counting on the error being nil.

willmurphyscode and others added 4 commits April 9, 2024 14:05
Previously, this method incorrectly return an empty Attributes object
and a nil error, leading to callers attempting to use the empty
attributes object.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
* main: (343 commits)
  feat: update haproxy classifier (#3277)
  chore(deps): update tools to latest versions (#3291)
  fix: don't use builtin scanner in licensecheck (#3290)
  chore(deps): update CPE dictionary index (#3288)
  chore(deps): bump github/codeql-action from 3.26.9 to 3.26.10 (#3289)
  update redis classifier (#3281)
  fix: improve node classifier version matching (#3284)
  fix: update ruby classifier for -rc, -dev, etc. versions (#3285)
  chore(deps): update CPE dictionary index (#3262)
  chore(deps): bump github.com/docker/docker (#3264)
  chore(deps): bump github/codeql-action from 3.26.8 to 3.26.9 (#3275)
  chore(deps): update stereoscope to dc10ea61fd18efa45b516eda4de8bc19d8322429 (#3280)
  chore(deps): bump actions/checkout from 4.1.7 to 4.2.0 (#3283)
  add awaiting response management (#3272)
  fix: correct excluded mount point comparison to file paths (#3269)
  Add JVM cataloger (#3217)
  feat: classifier for Dart lang binaries (#3265)
  Add compliance policy for empty name and version (#3257)
  chore(deps): bump github.com/github/go-spdx/v2 from 2.3.1 to 2.3.2 (#3254)
  chore(deps): bump peter-evans/create-pull-request from 7.0.3 to 7.0.5 (#3255)
  ...
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
@spiffcs spiffcs marked this pull request as ready for review October 2, 2024 20:23
@spiffcs
Copy link
Contributor

spiffcs commented Oct 2, 2024

@willmurphyscode - I merged this with upstream and found the NewAttributes case you mentioned in TODO and added a test. I think this is ready for review. If you 🟢 my follow up work I 🟢 the work that come before and we can merge as paired

@willmurphyscode willmurphyscode self-assigned this Oct 3, 2024
@willmurphyscode willmurphyscode added the bug Something isn't working label Oct 3, 2024
@willmurphyscode willmurphyscode changed the title FIx: CPE validation correctly returns error FIx: make failed CPE validation correctly return error Oct 3, 2024
@willmurphyscode willmurphyscode changed the title FIx: make failed CPE validation correctly return error Fix: make failed CPE validation correctly return error Oct 3, 2024
@willmurphyscode willmurphyscode merged commit 770fdc5 into main Oct 3, 2024
12 checks passed
@willmurphyscode willmurphyscode deleted the fix-cpe-validation branch October 3, 2024 20:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants