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

chore: remove quality gate Makefile db age check #2036

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions test/quality/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ RESULT_SET = pr_vs_latest_via_sbom
TEST_DB_URL_FILE = ./test-db-url
TEST_DB_URL = $(shell cat $(TEST_DB_URL_FILE))
TEST_DB = db.tar.gz
LISTING_FILE = https://toolbox-data.anchore.io/grype/databases/listing.json

# formatting variables
BOLD := $(shell tput -T linux bold)
Expand All @@ -34,15 +33,9 @@ validate: venv $(VULNERABILITY_LABELS)/Makefile ## Run all quality checks agains
capture: sboms vulns ## Collect and store all syft and grype results

.PHONY: capture
vulns: venv $(TEST_DB) check-db ## Collect and store all grype results
vulns: venv $(TEST_DB) ## Collect and store all grype results
$(YARDSTICK) -v result capture -r $(RESULT_SET)

.PHONY: check-db
check-db:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to set a DB max age in yardstick config or something to ensure that we don't run grype quality against a super old DB forever?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@echo "Looking for test DB within the hosted listing file (which prunes DBs older that 90 days or the last 90 objects)"
@curl -sSL $(LISTING_FILE) | jq '.available[][] | select(.url == "$(TEST_DB_URL)") ' --exit-status || (echo "$(RED)DB is too stale to be used for testing. Please re-pin with a more up-to-date version.$(RESET)" && false)
@echo "DB is fresh enough to be used for testing!"

$(TEST_DB):
@curl -o $(TEST_DB) -SsL $(TEST_DB_URL)

Expand Down
Loading