Skip to content

Add support for materialized-ops workflow - #243

Open
BojanOro wants to merge 1 commit into
masterfrom
bojanoro/prodeng-1716-add-gocd-support-for-writing-deployment-materializations
Open

Add support for materialized-ops workflow#243
BojanOro wants to merge 1 commit into
masterfrom
bojanoro/prodeng-1716-add-gocd-support-for-writing-deployment-materializations

Conversation

@BojanOro

Copy link
Copy Markdown

Adds support for writing git commits to materialized-ops during its code deployment pipeline.

Re: https://github.com/getsentry/devinfra-deployment-service/pull/907

@linear-code

linear-code Bot commented Aug 10, 2026

Copy link
Copy Markdown

PRODENG-1716

Comment on lines +12 to +16
&& materialized-ops-set-image \
--service="chartcuterie" \
--label-selector="${LABEL_SELECTOR}" \
--container-name="chartcuterie" \
--image="${IMAGE}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The materialized-ops-set-image command runs unconditionally in a shared script, causing it to execute during canary deployments, which may be unintended.
Severity: MEDIUM

Suggested Fix

Add conditional logic to deploy.sh to ensure materialized-ops-set-image only executes during the primary deployment. This can be done by checking an environment variable that distinguishes between canary and primary stages before invoking the command.

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/bash/deploy.sh#L12-L16

Potential issue: The `deploy.sh` script is shared between `deploy-canary` and
`deploy-primary` stages. The newly added `materialized-ops-set-image` command runs
unconditionally in both. This causes it to execute during canary deployments with a
canary-specific `LABEL_SELECTOR` (`'service=chartcuterie,env=canary'`), which may be
unintended. The expected behavior is often for such tracking commands to run only during
the primary deployment. This could lead to incorrect or duplicate deployment records in
the `materialized-ops` system, potentially complicating deployment monitoring and
rollbacks.

Did we get this right? 👍 / 👎 to inform future reviews.

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