Skip to content

fix: Handle 429 Error in Enrich Malware in vet and Report Quota Error after Scan Completion#674

Merged
KunalSin9h merged 7 commits into
mainfrom
feat/ct-#758-quota-error-messages
Feb 3, 2026
Merged

fix: Handle 429 Error in Enrich Malware in vet and Report Quota Error after Scan Completion#674
KunalSin9h merged 7 commits into
mainfrom
feat/ct-#758-quota-error-messages

Conversation

@KunalSin9h
Copy link
Copy Markdown
Member

@KunalSin9h KunalSin9h commented Feb 3, 2026

@KunalSin9h KunalSin9h marked this pull request as ready for review February 3, 2026 06:41
@safedep
Copy link
Copy Markdown

safedep Bot commented Feb 3, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
icon cloud.google.com/go/compute/metadata @ v0.9.0
go.mod
ok icon
ok icon
ok icon
🔗
icon go.opentelemetry.io/auto/sdk @ v1.2.1
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/crypto @ v0.44.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/mod @ v0.29.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/net @ v0.47.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/oauth2 @ v0.32.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/sync @ v0.18.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/term @ v0.37.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/text @ v0.31.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/tools @ v0.38.0
go.mod
ok icon
ok icon
ok icon
🔗
icon google.golang.org/genproto/googleapis/api @ v0.0.0-20251029180050-ab9386a59fda
go.mod
ok icon
ok icon
ok icon
🔗
icon google.golang.org/genproto/googleapis/rpc @ v0.0.0-20251029180050-ab9386a59fda
go.mod
ok icon
ok icon
ok icon
🔗
icon google.golang.org/grpc @ v1.78.0
go.mod
ok icon
ok icon
ok icon
🔗
icon google.golang.org/protobuf @ v1.36.10
go.mod
ok icon
ok icon
ok icon
🔗

This report is generated by SafeDep Github App

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 3, 2026

vet Summary Report

This report is generated by vet

Policy Checks

  • ✅ Vulnerability
  • ✅ Malware
  • ✅ License
  • ✅ Popularity
  • ✅ Maintenance
  • ✅ Security Posture
  • ✅ Threats

Malicious Package Analysis

Malicious package analysis was performed using SafeDep Cloud API

Malicious Package Analysis Report
Ecosystem Package Version Status Report
ECOSYSTEM_GO go.opentelemetry.io/auto/sdk 1.2.1 🔗
ECOSYSTEM_GO google.golang.org/genproto/googleapis/rpc 0.0.0-20251029180050-ab9386a59fda 🔗
ECOSYSTEM_GO google.golang.org/protobuf 1.36.10 🔗
ECOSYSTEM_GO golang.org/x/oauth2 0.32.0 🔗
ECOSYSTEM_GO golang.org/x/sync 0.18.0 🔗
ECOSYSTEM_GO golang.org/x/term 0.37.0 🔗
ECOSYSTEM_GO cloud.google.com/go/compute/metadata 0.9.0 🔗
ECOSYSTEM_GO google.golang.org/genproto/googleapis/api 0.0.0-20251029180050-ab9386a59fda 🔗
ECOSYSTEM_GO golang.org/x/mod 0.29.0 🔗
ECOSYSTEM_GO google.golang.org/grpc 1.78.0 🔗
ECOSYSTEM_GO golang.org/x/crypto 0.44.0 🔗
ECOSYSTEM_GO golang.org/x/tools 0.38.0 🔗
ECOSYSTEM_GO golang.org/x/net 0.47.0 🔗
  • ℹ️ 13 packages have been actively analyzed for malicious behaviour.
  • ✅ No malicious packages found.

Note: Some of the package analysis jobs may still be running.Please check back later. Consider increasing the timeout for better coverage.

Changed Packages

Changed Packages

  • ✅ [Go] go.opentelemetry.io/auto/sdk@1.2.1
  • ✅ [Go] google.golang.org/genproto/googleapis/api@0.0.0-20251029180050-ab9386a59fda
  • ✅ [Go] golang.org/x/text@0.31.0
  • ✅ [Go] golang.org/x/sync@0.18.0
  • ✅ [Go] golang.org/x/term@0.37.0
  • ✅ [Go] golang.org/x/crypto@0.44.0
  • ✅ [Go] golang.org/x/tools@0.38.0
  • ✅ [Go] golang.org/x/net@0.47.0
  • ✅ [Go] cloud.google.com/go/compute/metadata@0.9.0
  • ✅ [Go] google.golang.org/genproto/googleapis/rpc@0.0.0-20251029180050-ab9386a59fda
  • ✅ [Go] google.golang.org/protobuf@1.36.10
  • ✅ [Go] golang.org/x/oauth2@0.32.0
  • ✅ [Go] golang.org/x/mod@0.29.0
  • ✅ [Go] google.golang.org/grpc@1.78.0

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses Malysis malware-analysis quota exhaustion by counting denied on-demand submissions and surfacing a quota message at the end of a scan (console/summary/markdown summary), while also refactoring malware enricher wiring to reuse a query enricher instance.

Changes:

  • Add quota-exceeded tracking on PackageManifest and aggregate/display it in console, summary, and markdown-summary reporters.
  • Update Malysis malware enricher construction to pass a query enricher (intended as a fallback / shared component).
  • Bump several Go module dependencies (grpc/protobuf/oauth2 and related indirect deps).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scan.go Refactors malware enricher setup; introduces shared query enricher construction.
pkg/scanner/enrich_malware.go Adds ResourceExhausted/quota handling and new constructor parameter for query enricher.
pkg/scanner/enrich_malware_test.go Updates tests for the new NewMalysisMalwareEnricher signature.
pkg/models/models.go Adds manifest-level internal quota counter and accessor methods (with RWMutex).
pkg/reporter/common.go Adds quota error counter type and quota-limit message renderer.
pkg/reporter/console.go Accumulates and prints quota-limit message on finish.
pkg/reporter/summary.go Accumulates and prints quota-limit message on finish.
pkg/reporter/markdown_summary.go Adds quota-limit message section to markdown summary output.
pkg/reporter/summary_test.go Adds unit test for quota-limit message rendering.
go.mod / go.sum Dependency updates consistent with go mod tidy output.
Comments suppressed due to low confidence (2)

pkg/scanner/enrich_malware.go:83

  • malysisMalwareAnalysisQueryEnricher is stored on the struct but never used, yet the comment says it is used as a fallback for entitlement issues. Either implement the fallback behavior (e.g., invoke the query enricher on entitlement errors) or remove/adjust this field/comment to avoid a misleading API expansion.

var _ PackageMetaEnricher = (*malysisMalwareEnricher)(nil)

pkg/scanner/enrich_malware.go:175

  • New quota-limit behavior should have a focused unit test (e.g., simulate a codes.ResourceExhausted submission error and assert it increments the manifest counter and does not fail the enrichment). This will also prevent regressions around gRPC error wrapping/status extraction.

		return fmt.Errorf("failed to submit package for analysis: %w", err)
	}

	// Wait for the analysis to complete

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/models/models.go Outdated
Comment thread pkg/scanner/enrich_malware.go Outdated
Comment thread pkg/scanner/enrich_malware.go Outdated
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional flags.

Open in Devin Review

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 10.25641% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 8.80%. Comparing base (43f23a0) to head (fa845a4).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pkg/models/models.go 0.00% 8 Missing ⚠️
pkg/scanner/enrich_malware.go 0.00% 8 Missing ⚠️
pkg/reporter/console.go 0.00% 5 Missing ⚠️
pkg/reporter/markdown_summary.go 0.00% 5 Missing ⚠️
pkg/reporter/summary.go 0.00% 5 Missing ⚠️
pkg/reporter/common.go 50.00% 4 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #674   +/-   ##
=====================================
  Coverage   8.79%   8.80%           
=====================================
  Files        302     302           
  Lines      42445   42484   +39     
=====================================
+ Hits        3735    3739    +4     
- Misses     38383   38418   +35     
  Partials     327     327           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread pkg/reporter/markdown_summary.go Outdated
Comment thread pkg/scanner/enrich_malware.go Outdated
@KunalSin9h
Copy link
Copy Markdown
Member Author

@abhisek resolved comments.

@KunalSin9h KunalSin9h merged commit 42f2e31 into main Feb 3, 2026
14 of 15 checks passed
@KunalSin9h KunalSin9h deleted the feat/ct-#758-quota-error-messages branch February 3, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants