← Back to Pull requests

fix: skip non-Kubernetes entries in analyze output #484

Open
immanuwell opened this pull request with 62 lines diff across 2 files
View on GitHub
immanuwell immanuwell commented on Jun 01, 2026 05:12 UTC
Author

this fixes a panic in auger analyze when the db has non-Kubernetes keys like compact_rev_key.

it was assuming every entry had TypeMeta, so the Largest objects section could blow up. this skips entries without Kubernetes metadata and adds a regression test.

how to repro

go run . analyze -f cmd/testdata/boltdb/db

before this panics with a nil pointer dereference

after it prints the report and exits cleanly

Diff: 62 lines (+48 / -14) across 2 files Reviewer: siyuanfoundation Review duration: 267581m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.59) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 62 lines diff across 2 files
0.59
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 5 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
84%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.248
Sensitive Paths sensitive_paths
0.059
Real PR Conversation Timeline
6 items
k8s-ci-robot k8s-ci-robot commented on Jun 01, 2026 05:12 UTC
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: <a href="https://github.com/etcd-io/auger/pull/484#" title="Author self-approved">immanuwell</a>
Once this PR has been reviewed and has the lgtm label, please assign wenjiaswe for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

<details open>
Needs approval from an approver in each of these files:

  • OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["wenjiaswe"]} -->

    siyuanfoundation siyuanfoundation commented on code on Jun 01, 2026 07:26 UTC
    Code Review
    cmd/analyze.go:1
    @@ -45,7 +47,11 @@ func init() {
     }
     
     func analyzeValidateAndRun() error {

    is this func still needed?

    siyuanfoundation siyuanfoundation commented on code on Jun 01, 2026 07:26 UTC
    Code Review
    cmd/analyze.go:1
    @@ -82,28 +88,33 @@ func analyzeValidateAndRun() error {
     		totalAllVersionsValueSize += summary.Stats.AllVersionsValueSize
     	}
     
    -	fmt.Printf("Total kubernetes objects: %d\n", len(summaries))
    -	fmt.Printf("Total (all revisions) storage used by kubernetes objects: %d\n", totalAllVersionsKeySize+totalAllVersionsValueSize)
    -	fmt.Printf("Current (latest revision) storage used by kubernetes objects: %d\n", totalKeySize+totalValueSize)
    -	fmt.Printf("\n")
    -	fmt.Printf("Most common kubernetes types:\n")
    +	fmt.Fprintf(out, "Total kubernetes objects: %d\n", len(summaries))
    +	fmt.Fprintf(out, "Total (all revisions) storage used by kubernetes objects: %d\n", totalAllVersionsKeySize+totalAllVersionsValueSize)
    +	fmt.Fprintf(out, "Current (latest revision) storage used by kubernetes objects: %d\n", totalKeySize+totalValueSize)
    +	fmt.Fprintln(out)
    +	fmt.Fprintln(out, "Most common kubernetes types:")
     	for i, entry := range entries {
    -		fmt.Printf("\t%d\t%s\n", entry.count, entry.gvk)
    -		if i > 10 {
    +		if i >= 10 {

    Thanks for the fix. is the change from i > 10 to i >= 10 relevant to the fix?

    hwdef hwdef commented on code on Jun 01, 2026 08:20 UTC
    Code Review
    cmd/analyze.go:1
    @@ -82,28 +88,33 @@ func analyzeValidateAndRun() error {
     		totalAllVersionsValueSize += summary.Stats.AllVersionsValueSize
     	}
     
    -	fmt.Printf("Total kubernetes objects: %d\n", len(summaries))
    -	fmt.Printf("Total (all revisions) storage used by kubernetes objects: %d\n", totalAllVersionsKeySize+totalAllVersionsValueSize)
    -	fmt.Printf("Current (latest revision) storage used by kubernetes objects: %d\n", totalKeySize+totalValueSize)
    -	fmt.Printf("\n")
    -	fmt.Printf("Most common kubernetes types:\n")
    +	fmt.Fprintf(out, "Total kubernetes objects: %d\n", len(summaries))

    	fmt.Fprintf(out, "Total objects: %d\n", len(summaries))
    

    siyuanfoundation siyuanfoundation commented on Nov 11, 2026 18:18 UTC
    Contributor

    @immanuwell Are you still interested in working on this PR?

    Assignees
    immanuwell immanuwell
    Labels
    risk: low confidence: 84.9% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 59.4% (MEDIUM) · Higher = larger blast radius
    59.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 84.9% · Lower = rushed or shallow review
    84.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 9% · Safe to merge
    9%
    Repository