Skip to content

cleanup code, fix tests, and improve linting config#185

Merged
JesseStutler merged 2 commits intovolcano-sh:mainfrom
vzhou-p:feature/fix-ci
Jan 8, 2026
Merged

cleanup code, fix tests, and improve linting config#185
JesseStutler merged 2 commits intovolcano-sh:mainfrom
vzhou-p:feature/fix-ci

Conversation

@vzhou-p
Copy link
Contributor

@vzhou-p vzhou-p commented Jan 6, 2026

Cleans up codes and fixes linting/test issues across the repo.

  • CI: Enforce backend test in workflow
  • Backend: Enabled tests and aligned test mocks with API response structure.
  • Frontend:
    • Refactored QueueResourcesBarChart helpers for lint error.
    • Removed unused code and relaxed ESLint rules.
    • Fixed PodRow click handler and lint errors.

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kevin-wangzefeng for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Backend Testing and Configuration: The backend now includes a test script using Vitest, and its test mocks have been updated to align with the current API response structure, removing an unnecessary body wrapper.
  • Frontend Code Cleanup and Linting Improvements: Frontend code has been refactored to address linting errors, remove unused imports and variables, and simplify component logic. ESLint rules were also relaxed for react/prop-types and no-unused-vars to improve development workflow.
  • Linting Configuration Updates: The .prettierignore file now includes the .github/ directory, and the frontend ESLint configuration has been updated to include Node.js globals and refine variable usage rules.
  • Dependency Updates: Numerous development and production dependencies across the project have been updated to their latest versions, including axios, body-parser, express, playwright, qs, raw-body, tar-fs, and vite, along with various @esbuild and @rollup packages.

🧠 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
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/test.yml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using parseInt here can lead to incorrect parsing if the memory value is fractional (e.g., "1.5Gi" would be parsed as 1). It's safer to use parseFloat to handle these cases correctly.

Suggested change
const value = parseInt(memoryStr);
const value = parseFloat(memoryStr);

Copy link
Contributor Author

@vzhou-p vzhou-p Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using parseInt here will truncate fractional CPU values (e.g., "0.5" cores would be parsed as 0). This can lead to incorrect data visualization. Using parseFloat is recommended for correctness.

Suggested change
const value = parseInt(cpuStr);
const value = parseFloat(cpuStr);

@JesseStutler
Copy link
Member

@vzhou-p Don't forget to sign off your commit using git commit -s thanks

Signed-off-by: Victor Zhou <binghua.zhou.ca@gmail.com>
@JesseStutler
Copy link
Member

/lgtm

Signed-off-by: Victor Zhou <binghua.zhou.ca@gmail.com>
@JesseStutler
Copy link
Member

/lgtm
help merged /cc @Monokaix

@JesseStutler JesseStutler merged commit dca5472 into volcano-sh:main Jan 8, 2026
4 of 5 checks passed
@JesseStutler
Copy link
Member

/approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments