-
Notifications
You must be signed in to change notification settings - Fork 8
MUT-1123 : SDK Support for CDF Service metrics_marvels/limits #421
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @arnav-cognite, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates the new 'Limits' service, currently in its alpha phase, into the Java SDK. It provides a dedicated client for interacting with the Limit Values API, enabling users to programmatically fetch and manage limit data from Cognite Data Fusion. The changes encompass the necessary client-side API exposure, data modeling, parsing logic, and robust integration tests to ensure functionality. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a Java SDK for the new limits-svc. The implementation is mostly good, with a new LimitValues client that correctly handles the alpha API requirements. However, there are a few issues to address. A new method in ConnectorServiceV1 is non-functional as it doesn't include the required API version header. The LimitValueParser has a critical bug that can lead to a StringIndexOutOfBoundsException. There are also some opportunities for improving efficiency and maintainability in the LimitValues client, such as removing misleading throws clauses, using constants instead of magic numbers, and optimizing JSON parsing.
src/main/java/com/cognite/client/servicesV1/ConnectorServiceV1.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cognite/client/servicesV1/parser/LimitValueParser.java
Show resolved
Hide resolved
src/main/java/com/cognite/client/servicesV1/ConnectorServiceV1.java
Outdated
Show resolved
Hide resolved
|
/gemini review |
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.
Code Review
This pull request introduces a Java SDK for the new limits-svc. The changes are well-structured and include a new API client LimitValues, a Protobuf definition, a JSON parser, and integration tests, following the existing patterns of the SDK. My feedback focuses on two main areas: improving exception handling by replacing generic Exception with more specific ones for better error management, and enhancing performance and consistency by reusing a shared ObjectMapper instance. These changes will contribute to making the SDK more robust and efficient.
|
/gemini review |
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.
Code Review
This pull request introduces a Java SDK for the new limits-svc. The changes include a new LimitValues API client, a Protobuf DTO, a parser, and integration tests. The overall structure is consistent with the existing SDK. My review includes feedback on improving the API design by using more specific exceptions instead of the generic Exception, which will enhance error handling for clients. I've also included a suggestion to make one of the new integration tests more robust by avoiding a hardcoded value.
Background
Adds SDK support for the Limits API to query and retrieve limit values from Cognite Data Fusion.
API Docs: https://api-docs.cognite.com/20230101-alpha/tag/Limits/
Limits service is in
alphaphase, and the relevant details are present here