-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/relations nil pointer #68
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
Conversation
WalkthroughAdds recursion-safe handling in schema generation and relation resolution by introducing nil and in-progress checks for cached GraphQL types. Introduces a new test suite targeting recursive/self-referencing OpenAPI definitions. Updates a CRD test data file with revised controller-gen version and shortened condition descriptions. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used🧬 Code graph analysis (1)gateway/schema/recursion_test.go (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (3)
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 |
* added nil checks in relation resovling On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
The panic occurred because the code used nil as a cache placeholder to prevent infinite recursion when processing circular type references, but failed to check for nil when retrieving cached types.
It was fixed by adding exists && existingType != nil checks in three cache retrieval locations (convertSwaggerTypeToGraphQL, handleObjectFieldSpecType, and findRelationTarget).
Summary by CodeRabbit
Bug Fixes
Tests
Chores