Fix nondeterministic NonNamespaced annotations in register generator - #12
Conversation
Two bugs caused nondeterministic NonNamespaced annotations in generated register files: 1. parse.go gated NonNamespaced detection behind next.Resource != nil, but types can be encountered first as subtypes (Resource=nil) via map iteration. Since processed types are skipped on re-encounter, the Resource version never runs, leaving NonNamespaced=false. 2. The template unconditionally emitted "// +genclient" on one line, then conditionally emitted "// +genclient:nonNamespaced" or a duplicate "// +genclient" on the next. Now the second line only emits when NonNamespaced is true.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 10 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
NonNamespaceddetection being gated behindnext.Resource != nil, which caused types discovered first as subtypes to lose the annotation// +genclientline whenNonNamespacedis false