Implement Cloud Run no build feature.#171
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a "no-build" deployment workflow for Google Cloud Run, enabling direct source deployment via a new MCP tool and supporting Node.js, Python, and Go. The implementation includes updates to the Cloud Run client, registration of the new tool, and detailed documentation guides. Review feedback highlights a critical error regarding an invalid Go version in the workspace configuration and identifies a potential bug in how command-line arguments and environment variables are delimited. Additionally, the reviewer suggested using more idiomatic Go patterns, such as strings.Join, to improve code efficiency and readability.
| @@ -0,0 +1,7 @@ | |||
| go 1.25.5 | |||
| argStr += a | ||
| } | ||
| if argStr != "" { | ||
| args = append(args, "--args", argStr) |
There was a problem hiding this comment.
The gcloud CLI's --args and --set-env-vars flags use commas as delimiters. If any argument or environment variable value contains a comma, gcloud will split it incorrectly. To handle values with commas safely, you should either escape them (e.g., using the ^ delimiter prefix supported by gcloud) or use a more robust method like --env-vars-file for environment variables.
| var argStr string | ||
| for i, a := range cmdArgs { | ||
| if i > 0 { | ||
| argStr += "," | ||
| } | ||
| argStr += a | ||
| } |
There was a problem hiding this comment.
Using strings.Join is more idiomatic and efficient than manual string concatenation in a loop, as it avoids multiple allocations. Note that this requires importing the strings package.
| var argStr string | |
| for i, a := range cmdArgs { | |
| if i > 0 { | |
| argStr += "," | |
| } | |
| argStr += a | |
| } | |
| argStr := strings.Join(cmdArgs, ",") |
| var envStr string | ||
| i := 0 | ||
| for k, v := range envVars { | ||
| if i > 0 { | ||
| envStr += "," | ||
| } | ||
| envStr += fmt.Sprintf("%s=%s", k, v) | ||
| i++ | ||
| } |
There was a problem hiding this comment.
Added Cloud Run no build support for the following cases:
The implementation is done as a dedicated MCP tool
deploy_cloudrun_service_no_build. Currently using gcloud cmd as placeholder, will replace it with RestAPI call as the next step.Also tried creating more structured subfolders rather than putting all in reference and it seems to work very well (ease the burden of SKILL.md). Maybe we can adopt this structure to other workflows as well.