Skip to content

Conversation

@vzhou-p
Copy link

@vzhou-p vzhou-p commented Dec 22, 2025

add PodGroup dashboard support

  • Add backend API endpoints for PodGroups (list, details, YAML)
  • Add frontend route and navigation for PodGroups
  • Create PodGroup list view with filtering and sorting
  • Add PodGroup details dialog
  • Update tests
image

@volcano-sh-bot
Copy link
Contributor

Welcome @vzhou-p! It looks like this is your first PR to volcano-sh/dashboard 🎉

@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 significantly enhances the dashboard's capabilities by integrating full support for Kubernetes PodGroups. It provides users with a dedicated section to monitor and manage their PodGroups, offering a clear overview through a sortable and filterable list, and the ability to inspect detailed YAML configurations. This feature improves visibility and control over PodGroup resources within the application.

Highlights

  • PodGroup API Endpoints: New backend API endpoints have been added to support listing, retrieving details, and fetching YAML for PodGroups.
  • Frontend Integration: A new frontend route and navigation item for PodGroups have been introduced, making them accessible in the dashboard.
  • PodGroup List View: A dedicated list view for PodGroups has been implemented, featuring filtering by namespace and status, and sorting by creation time.
  • PodGroup Details Dialog: A dialog component has been added to display the detailed YAML configuration of a selected PodGroup.
  • Test Coverage: Backend and frontend tests have been updated to reflect the new PodGroup functionality and API changes.

🧠 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 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 adds dashboard support for PodGroups, including backend API endpoints and a full frontend implementation with list and detail views. The changes are well-structured and reuse existing components effectively. I've identified a potential Cross-Site Scripting (XSS) vulnerability in how YAML is displayed, which should be addressed. I've also left a couple of minor suggestions to remove debug logging and improve the UI feedback during data loading.

Comment on lines +48 to +52
<pre
dangerouslySetInnerHTML={{
__html: selectedYaml,
}}
/>

Choose a reason for hiding this comment

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

security-high high

Using dangerouslySetInnerHTML with data that originates from an external source (the Kubernetes API in this case) can introduce a Cross-Site Scripting (XSS) vulnerability. The YAML content, especially keys and values, is being wrapped in HTML without proper escaping in frontend/src/components/podgroups/PodGroups.jsx. If a PodGroup name or another value in its YAML contains malicious HTML, it will be executed by the browser.

To fix this, you should either use a dedicated syntax highlighting library that handles sanitization safely (like react-syntax-highlighter), or ensure all content is properly HTML-escaped before being passed to dangerouslySetInnerHTML. The logic for formatting the YAML is in PodGroups.jsx inside the handleClick function and should be updated to escape HTML characters.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed. I've updated the YAML formatting logic in PodGroups.jsx to use lodash.escape on both the keys and values before constructing the HTML string. This ensures that any user-supplied content is sanitized while still allowing us to wrap the keys in our custom tags for highlighting. The PodGroupDialog then safely renders this pre-sanitized string.

Comment on lines +147 to +151
console.log("Fetching podgroups with params:", {
namespace,
searchTerm,
statusFilter,
});

Choose a reason for hiding this comment

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

medium

This console.log statement appears to be for debugging purposes. It's best to remove such logs from production code to avoid cluttering the logs and potentially leaking sensitive information.

@vzhou-p vzhou-p force-pushed the feature/pod-group branch 3 times, most recently from 1f97fdc to c24675b Compare December 23, 2025 02:21
- Add backend API endpoints for PodGroups (list, details, YAML)
- Add frontend route and navigation for PodGroups
- Create PodGroup list view with filtering and sorting
- Add PodGroup details dialog
- Update tests

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

@vzhou-p There are some CI failures, could you take a look?

Copy link

@mtian29 mtian29 left a comment

Choose a reason for hiding this comment

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

Thanks @vzhou-p

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mtian29
Once this PR has been reviewed and has the lgtm label, please assign william-wang 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

@JesseStutler
Copy link
Member

@vzhou-p Seems that still have some lint erorrs, please take a look

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants