Skip to content
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: enable v6 database #2439

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

feat: enable v6 database #2439

wants to merge 38 commits into from

Conversation

kzantow
Copy link
Contributor

@kzantow kzantow commented Feb 11, 2025

This PR removes v5 database support from Grype, moving support to v6 databases. The db/v5 package needs to remain, however, as we will continue building v5 databases with functionality from that package in grype-db.

Closes #2129
Closes #2126
Fixes #2459
Fixes #1648
Fixes #2077

Enables previously implemented functionality:

kzantow and others added 22 commits February 11, 2025 15:03
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
Signed-off-by: Keith Zantow <[email protected]>
return nil, fmt.Errorf("unable to get vulnerability store metadata: %w", err)
}

_, err = c.validate(db.DescriptionFromMetadata(m), c.config.ValidateChecksum)
Copy link
Contributor Author

@kzantow kzantow Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing the db to be hashed twice, since the .Status() call is also hashing the db and validating age and is required (db status is required to be passed to the presenters), I've removed the validation from this call altogether.

@kzantow kzantow marked this pull request as ready for review February 20, 2025 14:26
},
},
{
name: "db status: valid db fails with hash mismatch",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case handles: #1648

},
},
{
name: "db status: missing db returns error",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case handles: #2077

Signed-off-by: Keith Zantow <[email protected]>
"github.com/anchore/clio"
"github.com/anchore/grype/grype/db"
)

// Experimental options are opt-in features that are...
// ...not stable
// ...not yet fully supported
// ...not necessarily tested
// ...not ready for production use
// these may go away at any moment, do not depend on them
type Experimental struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove this struct altogether?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment