Skip to content

Makes cluster name resolution logic consistent across code paths#54

Merged
JyotinderSingh merged 2 commits intomainfrom
auto-login
Feb 25, 2026
Merged

Makes cluster name resolution logic consistent across code paths#54
JyotinderSingh merged 2 commits intomainfrom
auto-login

Conversation

@JyotinderSingh
Copy link
Collaborator

Summary

  • Add --cluster-name flag to down and status CLI commands (matching up)
  • Add KERAS_REMOTE_GKE_NAMESPACE to config show output
  • Add GOOGLE_CLOUD_PROJECT env var fallback in @run() project resolution (matching storage.py)
  • Document resource name resolution guidelines in AGENTS.md and styleguide.md

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @JyotinderSingh, 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 standardizes how resource names, such as project IDs, zones, and cluster names, are resolved across the keras-remote system. It ensures that CLI commands, the @run() decorator, and configuration displays follow a consistent hierarchy for parameter and environment variable lookup, improving predictability and ease of use for developers. The changes also enhance the transparency of current configurations and provide clear documentation for future extensions.

Highlights

  • CLI Commands: The --cluster-name flag has been added to the down and status CLI commands, aligning their behavior with the up command for consistent cluster name resolution.
  • Configuration Display: The KERAS_REMOTE_GKE_NAMESPACE environment variable is now displayed in the config show output, providing better visibility into the configured Kubernetes namespace.
  • Project Resolution Fallback: The @run() decorator's project resolution logic now includes GOOGLE_CLOUD_PROJECT as a fallback environment variable, matching the behavior in storage.py.
  • Documentation: New guidelines for resource name resolution have been documented in AGENTS.md and styleguide.md, ensuring clarity and consistency for future development.

🧠 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.

Changelog
  • AGENTS.md
    • Documented new resource name resolution guidelines.
    • Added a table detailing environment variables, @run() parameters, CLI flags, and config show support for various configurable names.
  • keras_remote/backend/execution.py
    • Modified project resolution logic to prioritize KERAS_REMOTE_PROJECT and fall back to GOOGLE_CLOUD_PROJECT environment variables.
  • keras_remote/backend/execution_test.py
    • Added a new test case to verify that JobContext.from_params correctly falls back to GOOGLE_CLOUD_PROJECT for project ID resolution.
  • keras_remote/cli/commands/config.py
    • Included KERAS_REMOTE_GKE_NAMESPACE in the config show output.
    • Added KERAS_REMOTE_GKE_NAMESPACE to the example environment variables printed by config show.
  • keras_remote/cli/commands/down.py
    • Imported DEFAULT_CLUSTER_NAME constant.
    • Added --cluster-name CLI option with KERAS_REMOTE_CLUSTER environment variable support.
    • Resolved cluster_name using the new CLI option or DEFAULT_CLUSTER_NAME.
    • Passed the resolved cluster_name to the InfraConfig constructor.
  • keras_remote/cli/commands/status.py
    • Imported DEFAULT_CLUSTER_NAME constant.
    • Added --cluster-name CLI option with KERAS_REMOTE_CLUSTER environment variable support.
    • Resolved cluster_name using the new CLI option or DEFAULT_CLUSTER_NAME.
    • Passed the resolved cluster_name to the InfraConfig constructor.
Ignored Files
  • Ignored by pattern: .gemini/** (1)
    • .gemini/styleguide.md
Activity
  • No human activity (comments, reviews, etc.) has occurred on this pull request yet.
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
Contributor

@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 does a good job of improving consistency in resource name resolution across different parts of the application, particularly for the CLI commands. The changes are well-documented in AGENTS.md and supported by new tests.

I've made a few suggestions to further improve consistency, specifically regarding the naming of the cluster flag in the CLI to better align it with the @run decorator's parameter. This should make the user experience even more uniform, in line with the project's design guidelines.

@JyotinderSingh JyotinderSingh merged commit 8c7e1fa into main Feb 25, 2026
4 checks passed
@JyotinderSingh JyotinderSingh deleted the auto-login branch February 25, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant