Skip to content

Conversation

dekaihu
Copy link

@dekaihu dekaihu commented Oct 9, 2025

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@karmada-bot
Copy link
Collaborator

[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 chaunceyjiang for approval. For more information see the Kubernetes Code Review Process.

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

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

Copy link

Summary of Changes

Hello @dekaihu, 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 support for Kubeflow Notebook resources by adding a new resource interpreter. This interpreter provides essential logic for health checking, status aggregation, and status reflection, which are crucial for managing and observing Notebook instances within a Kubernetes environment. The addition ensures that Notebooks can be properly monitored and their states accurately represented.

Highlights

  • Kubeflow Notebook Resource Interpretation: Introduced custom resource interpretation for kubeflow.org/v1/Notebook resources, enabling the system to understand and manage their lifecycle more effectively.
  • Lua Scripted Logic: Implemented Lua scripts for healthInterpretation, statusAggregation, and statusReflection to define how Notebooks' health, aggregated status, and reflected status are determined.
  • Comprehensive Test Coverage: Added dedicated test configurations and sample YAML data (desired-notebook.yaml, observed-notebook.yaml, status-file.yaml) to validate the correctness of the new Notebook interpreter logic.
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.

@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 9, 2025
@dekaihu dekaihu force-pushed the interpreter-notebook branch from 5ed377c to 28ccf7a Compare October 9, 2025 07:23
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 a resource interpreter customization for Kubeflow Notebooks. The implementation has several issues in the Lua scripts for health interpretation, status aggregation, and status reflection that could lead to incorrect behavior. I've provided suggestions to fix these issues and improve the robustness of the scripts. Additionally, there's a minor inconsistency in the test configuration that should be addressed.

@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.83%. Comparing base (4594ca0) to head (14f50ea).
⚠️ Report is 42 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6814      +/-   ##
==========================================
+ Coverage   45.73%   45.83%   +0.10%     
==========================================
  Files         689      690       +1     
  Lines       57104    57300     +196     
==========================================
+ Hits        26114    26266     +152     
- Misses      29358    29403      +45     
+ Partials     1632     1631       -1     
Flag Coverage Δ
unittests 45.83% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@XiShanYongYe-Chang
Copy link
Member

/gemini review

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 introduces a resource interpreter customization for Kubeflow Notebooks. The changes include the customization definition with Lua scripts for health interpretation, status aggregation, and status reflection, along with corresponding tests and test data.

My review of the Lua scripts has identified a couple of issues that could affect the correctness and robustness of the interpreter:

  • In the statusAggregation script, the containerState is being overwritten in each loop iteration, which will result in loss of information from all but the last member cluster.
  • The statusReflection script performs unsafe access to status fields, which could lead to an inconsistent structure in the returned status if some fields are missing in the observed object.

I have provided specific suggestions to address these points. After these fixes, the PR should be in good shape.

@dekaihu dekaihu force-pushed the interpreter-notebook branch from a3a640b to 9412500 Compare October 9, 2025 11:01
@dekaihu dekaihu force-pushed the interpreter-notebook branch from 18f0f45 to 14f50ea Compare October 9, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants