Conversation
|
@sentry review |
| args: | ||
| - run | ||
| - deploy | ||
| - --region | ||
| - $_DEPLOY_REGION | ||
| - --project | ||
| - $_DEPLOY_PROJECT | ||
| - --image=$_REPO_URL/$_CONTAINER_NAME:latest | ||
| - $_SERVICE_NAME |
There was a problem hiding this comment.
Bug: The gcloud run deploy command in cloudbuild.yaml has the $_SERVICE_NAME argument in the wrong position. It should be placed immediately after deploy.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The gcloud run deploy command requires the service name as a positional argument immediately following deploy. In the current cloudbuild.yaml, the $_SERVICE_NAME argument is placed at the end of the command, after all the flags like --region and --image. This incorrect ordering will cause the gcloud command to fail with a syntax error, which will break the CI/CD pipeline and prevent the Cloud Run service from being deployed.
💡 Suggested Fix
Reorder the arguments for the gcloud run deploy command in cloudbuild.yaml. The $_SERVICE_NAME positional argument should be moved to be immediately after the deploy argument and before any flags like --region or --project.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: cloudbuild.yaml#L19-L27
Potential issue: The `gcloud run deploy` command requires the service name as a
positional argument immediately following `deploy`. In the current `cloudbuild.yaml`,
the `$_SERVICE_NAME` argument is placed at the end of the command, after all the flags
like `--region` and `--image`. This incorrect ordering will cause the `gcloud` command
to fail with a syntax error, which will break the CI/CD pipeline and prevent the Cloud
Run service from being deployed.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8236718
While our cloud build trigger automatically builds on container on push to main, it doesn't automatically push the change to cloudrun.
After this gets merged, we can reconfigure the trigger to read from
cloudbuild.yamlinstead of ourdockerfile