← Back to Pull requests

:bug: crd: do not add versions for same-named non-object types #1482

Open
unknown opened this pull request with 136 lines diff across 1 files
View on GitHub
unknown unknown commented on Oct 06, 2026 05:25 UTC
Author

Problem

When a kind is an object in one version of a group and a plain struct with the same name exists in another version, NeedCRDFor adds both as CRD versions. It looks the kind up by name in every package of the group without checking that the type there is an object.

Fix

NeedCRDFor now keeps only the versions where the type embeds metav1.TypeMeta and metav1.ObjectMeta. The check goes through go/types, so a version that aliases the object from another version still counts. If no version has an object type it behaves as before, since some tests call NeedCRDFor directly on plain types.

How tested

I added cbandy's reproducer from the issue to the multiple_versions testdata, plus a test that the Bar CRD only gets v1beta2. On main it fails with ["v1beta1", "v1beta2"]; with this change it passes. go test ./pkg/... and make lint pass.

Fixes #1137

Prepared with an AI agent operated by KR-Ravindra, who reviewed and tested it. The agent is pointed only at issues maintainers have confirmed and problems he has hit, not at producing contributions.

Diff: 136 lines (+102 / -34) across 1 files Reviewer: KR-Ravindra Review duration: 80376m
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.39) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 136 lines diff across 1 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
40%
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
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.294
Real PR Conversation Timeline
1 comments
"Review active on #1482"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 40.9% reviewed
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: 39.4% (MEDIUM) · Higher = larger blast radius
39.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: 40.9% · Lower = rushed or shallow review
40.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: 23.3% · Safe to merge
23.3%