cleanup code, fix tests, and improve linting config#185
cleanup code, fix tests, and improve linting config#185JesseStutler merged 2 commits intovolcano-sh:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello @vzhou-p, 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 focuses on enhancing code quality, improving the development experience, and ensuring the stability of both the backend and frontend. It introduces a dedicated test command for the backend, refines frontend components by removing dead code and simplifying event handlers, and updates linting configurations to be more permissive yet effective. Additionally, a comprehensive update of project dependencies ensures the use of the latest stable libraries. 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. Ignored Files
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.
Code Review
This pull request provides a good set of cleanups, test fixes, and configuration improvements across the repository. The changes enhance code quality by removing unused code and variables, and the linting configuration has been improved to enforce better practices.
I've identified a couple of potential issues in the resource conversion helper functions within QueueResourcesBarChart.jsx. Specifically, the use of parseInt could lead to incorrect parsing of fractional resource values, and the default unit handling for memory might not align with Kubernetes conventions, potentially causing incorrect data visualization. My review includes suggestions to address these points for improved accuracy and robustness.
|
|
||
| const convertMemoryToGi = (memoryStr) => { | ||
| if (!memoryStr) return 0; | ||
| const value = parseInt(memoryStr); |
There was a problem hiding this comment.
There was a problem hiding this comment.
This PR just reorganizes existing code to fix lint errors. Further refactoring is not in scope. Same for other comments.
| if (memoryStr.includes("Gi")) return value; | ||
| if (memoryStr.includes("Mi")) return value / 1024; // Mi to Gi | ||
| if (memoryStr.includes("Ki")) return value / 1024 / 1024; // Ki to Gi | ||
| return value; // default unit Gi |
There was a problem hiding this comment.
The comment // default unit Gi and the implementation return value; assume that memory values from the API without a suffix are in Gibibytes (Gi). According to Kubernetes conventions, memory quantities without a suffix are specified in bytes. If the API adheres to this, returning value directly will lead to massively inflated values on the chart. The value should be converted from bytes to Gi, for example: return value / (1024 * 1024 * 1024);. Please verify the unit of the raw data if no suffix is provided.
|
|
||
| const convertCPUToCores = (cpuStr) => { | ||
| if (!cpuStr) return 0; | ||
| const value = parseInt(cpuStr); |
There was a problem hiding this comment.
|
@vzhou-p Don't forget to sign off your commit using |
Signed-off-by: Victor Zhou <binghua.zhou.ca@gmail.com>
c8cbf22 to
9c905f5
Compare
|
/lgtm |
Signed-off-by: Victor Zhou <binghua.zhou.ca@gmail.com>
|
/lgtm |
|
/approve |
Cleans up codes and fixes linting/test issues across the repo.