-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(schema): add ReferenceType interface #21692
Conversation
WalkthroughWalkthroughThe changes introduce a new method, Changes
Possibly related PRs
Tip OpenAI O1 model for chat
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
@aaronc your pull request is missing a changelog! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
schema/enum.go (1)
45-45
: Add documentation for the new method.The new
isReferenceType
method is correctly implemented and follows the Golang naming convention. However, it lacks documentation.Please add a comment above the method to document its purpose and usage. For example:
// isReferenceType indicates that the EnumType can be used as a reference type. func (EnumType) isReferenceType() {}
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- schema/enum.go (1 hunks)
- schema/type.go (1 hunks)
Additional context used
Path-based instructions (2)
schema/type.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.schema/enum.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (2)
schema/type.go (1)
16-23
: LGTM!The new
ReferenceType
interface follows the Uber Go Style Guide and enhances the type system by clearly delineating reference types from other types. The interface name is clear and descriptive, and the comments provide a good explanation of its purpose and current implementation. The unexportedisReferenceType()
method is consistent with the existingisType()
method in theType
interface.Overall, this change improves type safety and clarity in the codebase.
schema/enum.go (1)
44-44
: LGTM!The method declaration is correctly formatted as per the Uber Golang style guide.
Was holding off a bit to see if @testinginprod had an alternate name because you said "reference type" is confusing. Anyway, we can rename in a follow-up, if needed. @testinginprod do you have a better name or is this okay? |
Description
This adds a small marker interface
ReferenceType
which can be used by frameworks likecollections
to refer to the types which can be referred to in fields (currently only enum types, but I expect we'll support structs, oneof's, etc.).Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
New Features
ReferenceType
interface to enhance type safety and clarity.EnumType
as a reference type.Bug Fixes