Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gocd/templates/bash/deploy-py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ IMAGE_TAG="${GO_REVISION_SNUBA_REPO}"
&& k8s-deploy \
--label-selector="${LABEL_SELECTOR}" \
--image="us-docker.pkg.dev/sentryio/snuba-mr/image:${IMAGE_TAG}" \
--container-name="snuba" \
Comment thread
cursor[bot] marked this conversation as resolved.
--container-name="api" \
--container-name="dlq-consumer" \
--container-name="eap-items-subscriptions-executor" \
Expand Down
13 changes: 0 additions & 13 deletions gocd/templates/bash/deploy-st-py.sh

This file was deleted.

5 changes: 0 additions & 5 deletions gocd/templates/bash/deploy-st-rs.sh

This file was deleted.

19 changes: 0 additions & 19 deletions gocd/templates/bash/deploy-st.sh

This file was deleted.

5 changes: 1 addition & 4 deletions gocd/templates/pipelines/snuba-py.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,7 @@ function(region) {
LABEL_SELECTOR: 'service=snuba',
},
tasks: [
if getsentry.is_st(region) then
gocdtasks.script(importstr '../bash/deploy-st-py.sh')
Comment thread
pbhandari marked this conversation as resolved.
else
gocdtasks.script(importstr '../bash/deploy-py.sh'),
gocdtasks.script(importstr '../bash/deploy-py.sh'),
],
},
},
Expand Down
6 changes: 1 addition & 5 deletions gocd/templates/pipelines/snuba-rs.libsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local getsentry = import 'github.com/getsentry/gocd-jsonnet/libs/getsentry.libsonnet';
local gocdtasks = import 'github.com/getsentry/gocd-jsonnet/libs/gocd-tasks.libsonnet';

// The return value of this function is the body of a GoCD pipeline.
Expand Down Expand Up @@ -202,10 +201,7 @@ function(region) {
LABEL_SELECTOR: 'service=snuba',
},
tasks: [
if getsentry.is_st(region) then
gocdtasks.script(importstr '../bash/deploy-st-rs.sh')
else
gocdtasks.script(importstr '../bash/deploy-rs.sh'),
gocdtasks.script(importstr '../bash/deploy-rs.sh'),
],
},

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.

Bug: The deploy-rs.sh script, now used for ST regions, attempts to update hardcoded container names that may not exist in ST deployments, likely causing deployment failures.
Severity: HIGH

Suggested Fix

Modify the deploy-rs.sh script to handle cases where a container does not exist in the target deployment. One approach is to check for a container's existence before attempting to update its image. Alternatively, if the underlying k8s-deploy tool supports it, use a flag to ignore missing containers gracefully.

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: gocd/templates/pipelines/snuba-rs.libsonnet#L206

Potential issue: The pull request makes `deploy-rs.sh` the standard deployment script
for all regions, including single-tenant (ST) environments. This script contains a
hardcoded list of container names, some of which are specific to the SaaS environment
and do not exist in ST deployments. The script uses `k8s-deploy` to update container
images. If this tool behaves like standard Kubernetes commands (`kubectl`), it will fail
when it tries to update a container that is not present in the target deployment
manifest. This would cause deployments to ST regions to fail, blocking updates for those
customers.

Also affects:

  • gocd/templates/pipelines/snuba-py.libsonnet:226~226

},
Expand Down
Loading