Skip to content

fix: track ui/dist, correct CI action versions, add API key support and Windows gcloud fix#289

Open
sonnyboybacus-cyber wants to merge 4 commits into
GoogleCloudPlatform:mainfrom
sonnyboybacus-cyber:main
Open

fix: track ui/dist, correct CI action versions, add API key support and Windows gcloud fix#289
sonnyboybacus-cyber wants to merge 4 commits into
GoogleCloudPlatform:mainfrom
sonnyboybacus-cyber:main

Conversation

@sonnyboybacus-cyber

@sonnyboybacus-cyber sonnyboybacus-cyber commented May 4, 2026

Copy link
Copy Markdown

Summary

  • fix: track ui/dist/ build artifactsdist/ in .gitignore was also excluding ui/dist/, so //go:embed in ui/ui.go failed when the module was downloaded from the Go proxy. Changed dist//dist/ and committed the built UI files.
  • fix(ci): correct action versionscheckout@v6, setup-go@v6, setup-node@v6, goreleaser-action@v7 do not exist; downgraded to valid versions. Added missing validate-skills CI job.
  • feat(config): API key support, env-var fallbacks, Windows gcloud fix — read GOOGLE_API_KEY/GEMINI_API_KEY, fall back to Gemini API when no GCP project is set; resolve config from env vars before gcloud; default location to us-central1; use cmd /c gcloud on Windows; fix embed.FS path joins.
  • chore: bump version to 0.11.2

Test plan

  • Verify go run github.com/GoogleCloudPlatform/gke-mcp@latest builds after merge
  • Verify CI passes (presubmit, validate-skills, release)
  • Verify gke-mcp works with GOOGLE_API_KEY and no gcloud project
  • Verify gke-mcp works on Windows

sonnyboybacus-cyber and others added 4 commits May 4, 2026 14:26
…ules

The dist/ gitignore pattern was also excluding ui/dist/, causing the
//go:embed directives in ui/ui.go to fail when the module is downloaded
from the Go proxy (missing dist/apps/dropdown/index.html).

Change dist/ to /dist/ so only the goreleaser root dist/ is excluded,
and track the built UI files so they are included in published module versions.

Also add gke-mcp.exe and gke-mcp.exe~ to .gitignore.

Generated with oh-my-agent

Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
- Downgrade actions/checkout v6→v4, actions/setup-go v6→v5,
  actions/setup-node v6→v4, goreleaser-action v7→v6 (v6/v7 do not exist)
- Add validate-skills job to presubmit.yaml to match dev/tasks/presubmit.sh

Generated with oh-my-agent

Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
…ows gcloud fix

- Read GOOGLE_API_KEY / GEMINI_API_KEY and fall back to Gemini API
  backend in manifestgen when no GCP project is set
- Resolve project/location from GKE_MCP_PROJECT, GOOGLE_CLOUD_PROJECT,
  GCP_PROJECT, GKE_MCP_LOCATION, GOOGLE_CLOUD_LOCATION, GCP_LOCATION
  env vars before invoking gcloud, and treat "(unset)" as empty
- Default location to us-central1 when nothing is configured
- Use cmd /c gcloud on Windows so gcloud.cmd is found on PATH
- Switch path/filepath → path for embed.FS joins (always forward slashes)

Generated with oh-my-agent

Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
Generated with oh-my-agent

Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
@sonnyboybacus-cyber sonnyboybacus-cyber requested a review from a team as a code owner May 4, 2026 07:08
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@google-cla

google-cla Bot commented May 4, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 support for Gemini API keys, enhances environment variable detection for project and location configurations, and improves Windows compatibility for gcloud commands. It also updates the .gitignore and dependency lock files. Feedback suggests removing the hardcoded default location 'us-central1' to require explicit configuration and recommends using the idiomatic 'runtime.GOOS' for more reliable operating system detection.

Comment thread pkg/config/config.go
return zone
}
return ""
return "us-central1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The function getDefaultLocation returns a hardcoded default value "us-central1" when no location is found in the environment or gcloud configuration. This violates the general rule that tools should not fall back to default values for parameters like project and location, and instead expect the calling agent to provide them explicitly.

Suggested change
return "us-central1"
return ""
References
  1. Tools should not fall back to default values for parameters like project and location. The calling agent is expected to provide these values explicitly.

Comment thread pkg/config/config.go
out, err := exec.Command("gcloud", "config", "get", key).Output()
// Use 'cmd /c gcloud' on Windows to ensure it finds gcloud.cmd or gcloud.ps1
var cmd *exec.Cmd
if os.Getenv("OS") == "Windows_NT" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Detecting the operating system via the OS environment variable is unreliable as it may not be set or could be modified. The idiomatic and robust way to check the operating system in Go is using runtime.GOOS.

@bradhoekstra bradhoekstra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the PR @sonnyboybacus-cyber ! I've left some comments, overall it would be simpler to review if the different unrelated changes were split into their own PRs.

permissions:
contents: "read"
steps:
- uses: actions/checkout@v6

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread gemini-extension.json
}
},
"name": "gke-mcp",
"version": "0.11.1"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Version changes should be their own PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@jayantid / @GinnyJI Can you please review the manifest gen changes?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm on the manifest gen agent change.

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.

3 participants