Skip to content

Add deploy markers configuration#97

Merged
LCSOGthb merged 1 commit into
mainfrom
deploy-markers-setup
Apr 5, 2026
Merged

Add deploy markers configuration#97
LCSOGthb merged 1 commit into
mainfrom
deploy-markers-setup

Conversation

@LCSOGthb
Copy link
Copy Markdown
Owner

@LCSOGthb LCSOGthb commented Apr 5, 2026

This PR adds Deploy Markers to your CircleCI configuration. Deploy Markers enable CircleCI to automatically track when deployments happen in your pipelines, giving you:

  • Deployment visibility in the CircleCI UI
  • Deployment frequency and success metrics
  • Better insights into your release pipeline
  • Integration with deployment tracking features
    Learn more about Deploy Markers in our documentation.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tools Ready Ready Preview, Comment Apr 5, 2026 10:05am

@LCSOGthb LCSOGthb merged commit 1ff8066 into main Apr 5, 2026
11 of 16 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 5f13811.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@LCSOGthb LCSOGthb deleted the deploy-markers-setup branch April 5, 2026 10:05
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add CircleCI Deploy Markers configuration to deployment job

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add deployment planning step using CircleCI release plan command
• Implement deployment status tracking with running, success, failed states
• Integrate CircleCI Deploy Markers for automated deployment visibility
• Configure environment and component metadata for deployment tracking
Diagram
flowchart LR
  checkout["Checkout code"]
  plan["Plan deployment<br/>circleci run release plan"]
  deploy["Deploy step"]
  running["Update status<br/>to RUNNING"]
  success["Update status<br/>to SUCCESS<br/>on_success"]
  failed["Update status<br/>to FAILED<br/>on_fail"]
  
  checkout --> plan
  plan --> deploy
  deploy --> running
  running --> success
  running --> failed
Loading

Grey Divider

File Changes

1. .circleci/config.yml ✨ Enhancement +18/-0

Integrate CircleCI Deploy Markers into deployment workflow

• Added deployment planning step with CircleCI release plan command
• Configured environment-name, component-name, and target-version parameters
• Added three status update steps for deployment tracking: RUNNING, SUCCESS, FAILED
• Implemented conditional status updates using when: on_success and when: on_fail

.circleci/config.yml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 5, 2026

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Action required

1. RUNNING set after deploy 🐞 Bug ≡ Correctness
Description
In the deploy job, the Deploy Marker is updated to RUNNING only after the deploy command executes,
so the recorded deployment start/status is wrong and RUNNING is never emitted when the deploy step
fails. This breaks the accuracy of deployment visibility and duration metrics.
Code

.circleci/config.yml[R27-33]

      - run:
          name: "Deploy step"
          command: echo "Deploying project..."
+      - run:
+          name: Update deployment status to running
+          command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
+      - run:
Evidence
The config runs the "Deploy step" first and only then runs the "Update deployment status to running"
step, meaning RUNNING is emitted after the deployment work (and is skipped entirely if the deploy
step fails).

.circleci/config.yml[27-33]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The deploy marker status is set to RUNNING after the deployment command, which makes the lifecycle tracking inaccurate and skips RUNNING on deployment failures.

## Issue Context
The current order is: plan -> deploy -> update RUNNING -> update SUCCESS/FAILED.

## Fix Focus Areas
- .circleci/config.yml[20-40]

## Suggested change
Move the "Update deployment status to running" step to immediately after "Plan deployment" and before the "Deploy step" so RUNNING reflects the actual start of deployment.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Non-unique deployment id 🐞 Bug ≡ Correctness
Description
All Deploy Marker plan/update commands use ${CIRCLE_JOB} as the deployment identifier, which
resolves to the constant job name "deploy" in this config. Multiple pipeline runs can overwrite each
other’s deployment records by updating the same id.
Code

.circleci/config.yml[R23-39]

+            circleci run release plan "${CIRCLE_JOB}" \
+              --environment-name="default" \
+              --component-name="${CIRCLE_PROJECT_REPONAME}" \
+              --target-version="1.0.${CIRCLE_BUILD_NUM}-${CIRCLE_SHA1:0:7}"
      - run:
          name: "Deploy step"
          command: echo "Deploying project..."
+      - run:
+          name: Update deployment status to running
+          command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
+      - run:
+          name: Update deployment status to success
+          command: circleci run release update "${CIRCLE_JOB}" --status=SUCCESS
+          when: on_success
+      - run:
+          name: Update deployment status to failed
+          command: circleci run release update "${CIRCLE_JOB}" --status=FAILED
Evidence
The job is named deploy, and every plan/update command uses ${CIRCLE_JOB} as the identifier, so
the identifier is identical across all runs of this workflow.

.circleci/config.yml[14-16]
.circleci/config.yml[20-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Using `${CIRCLE_JOB}` as the deploy marker identifier makes the id static (`deploy`), so different pipeline runs can update the same deployment record.

## Issue Context
The identifier passed as the first argument to both `circleci run release plan` and `circleci run release update` must be stable within a single run, but unique across runs.

## Fix Focus Areas
- .circleci/config.yml[20-40]

## Suggested change
Replace `${CIRCLE_JOB}` with a per-run unique id (while keeping it consistent across plan/update), for example:
- `${CIRCLE_WORKFLOW_ID}-${CIRCLE_JOB}`
- or `${CIRCLE_PIPELINE_ID}-${CIRCLE_JOB}`
Update all plan/update commands to use the same new identifier.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Marker updates fail deploy 🐞 Bug ☼ Reliability
Description
The marker update steps run circleci run release update ... without guarding failures, so
transient tracking call failures can fail the deploy job even if the deployment succeeded. The
on_fail marker step can also fail and obscure the original deployment failure.
Code

.circleci/config.yml[R30-40]

+      - run:
+          name: Update deployment status to running
+          command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
+      - run:
+          name: Update deployment status to success
+          command: circleci run release update "${CIRCLE_JOB}" --status=SUCCESS
+          when: on_success
+      - run:
+          name: Update deployment status to failed
+          command: circleci run release update "${CIRCLE_JOB}" --status=FAILED
+          when: on_fail
Evidence
The RUNNING/SUCCESS/FAILED status updates are plain run steps with no error handling; if any of
these commands exits non-zero, the job can fail due to marker reporting rather than deployment
outcome.

.circleci/config.yml[30-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Deploy marker reporting commands can fail for reasons unrelated to deployment (network/auth/transient), but currently they can fail the entire job.

## Issue Context
Marker steps are auxiliary telemetry; deployment success/failure should be driven by the actual deploy command.

## Fix Focus Areas
- .circleci/config.yml[30-40]

## Suggested change
Wrap marker commands so they do not fail the job, e.g.:
- `circleci run release update ... --status=RUNNING || echo 'Deploy marker update failed'`
Optionally add a small retry loop for the marker calls, and ensure the FAILED marker step also cannot fail the job (so it doesn’t mask the real failure).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

4. CLI dependency not explicit 🐞 Bug ⚙ Maintainability
Description
The deploy job invokes the circleci CLI but the config does not install or verify it, making the
pipeline dependent on implicit executor image contents. If the image changes (or lacks the CLI),
deploy will fail at runtime with command-not-found.
Code

.circleci/config.yml[R20-26]

+      - run:
+          name: Plan deployment
+          command: |
+            circleci run release plan "${CIRCLE_JOB}" \
+              --environment-name="default" \
+              --component-name="${CIRCLE_PROJECT_REPONAME}" \
+              --target-version="1.0.${CIRCLE_BUILD_NUM}-${CIRCLE_SHA1:0:7}"
Evidence
The job uses cimg/base:current and immediately calls circleci ... without any step that installs
or checks the CLI’s presence.

.circleci/config.yml[15-26]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The config assumes `circleci` CLI is available, but does not ensure it, which makes builds brittle across image updates or executor changes.

## Issue Context
This PR introduces a new runtime dependency in the deploy job (the `circleci` binary).

## Fix Focus Areas
- .circleci/config.yml[15-40]

## Suggested change
Add a step before the first `circleci run release ...` invocation to either:
- verify the CLI exists: `command -v circleci` and print a clear error, or
- install it explicitly (or switch to an executor/orb that guarantees it), and consider pinning the docker image tag instead of `:current` for reproducibility.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6bd1dfd3-4597-4217-bd1b-d725b64e0448

📥 Commits

Reviewing files that changed from the base of the PR and between 6c20486 and 5f13811.

📒 Files selected for processing (1)
  • .circleci/config.yml

📝 Walkthrough

Summary by CodeRabbit

No user-facing changes in this release. Internal deployment process improvements have been implemented to enhance reliability and status tracking during the release workflow.

Walkthrough

The deploy job in CircleCI configuration now includes pre- and post-deployment orchestration steps. A "Plan deployment" step invokes release planning, followed by explicit status tracking that updates the release status to RUNNING before deployment, then to SUCCESS or FAILED conditionally based on job outcome.

Changes

Cohort / File(s) Summary
Deployment Orchestration
.circleci/config.yml
Added three new steps to the deploy job: (1) "Plan deployment" step using circleci run release plan with version target derived from build number and short SHA, (2) "Update release status to RUNNING" before deployment, (3) conditional status updates to SUCCESS (when: on_success) and FAILED (when: on_fail) post-deployment.

Sequence Diagram(s)

sequenceDiagram
    participant CircleCI as CircleCI CI/CD
    participant ReleaseOrch as Release Orchestrator
    participant DeployAction as Deploy Action
    participant StatusService as Status Service

    CircleCI->>ReleaseOrch: Plan deployment with target version
    ReleaseOrch-->>CircleCI: Plan ready
    CircleCI->>StatusService: Update release status to RUNNING
    StatusService-->>CircleCI: Status updated
    CircleCI->>DeployAction: Execute deployment
    alt Deployment Succeeds
        DeployAction-->>CircleCI: Success
        CircleCI->>StatusService: Update release status to SUCCESS
    else Deployment Fails
        DeployAction-->>CircleCI: Failure
        CircleCI->>StatusService: Update release status to FAILED
    end
    StatusService-->>CircleCI: Status confirmed
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 The deployment hops with grace so fine,
Planning first, then status signs align,
From RUNNING state to SUCCESS so bright,
Or FAILED alerts to set things right,
CircleCI dances through the night! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deploy-markers-setup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@deepsource-io
Copy link
Copy Markdown
Contributor

deepsource-io Bot commented Apr 5, 2026

DeepSource Code Review

We reviewed changes in 6c20486...5f13811 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Scala Apr 5, 2026 10:06a.m. Review ↗
Swift Apr 5, 2026 10:06a.m. Review ↗
JavaScript Apr 5, 2026 10:06a.m. Review ↗
Ruby Apr 5, 2026 10:06a.m. Review ↗
C & C++ Apr 5, 2026 10:06a.m. Review ↗
C# Apr 5, 2026 10:06a.m. Review ↗
Rust Apr 5, 2026 10:06a.m. Review ↗
Shell Apr 5, 2026 10:06a.m. Review ↗
Terraform Apr 5, 2026 10:06a.m. Review ↗
Test coverage Apr 5, 2026 10:06a.m. Review ↗
SQL Apr 5, 2026 10:06a.m. Review ↗
Secrets Apr 5, 2026 10:06a.m. Review ↗
Ansible Apr 5, 2026 10:06a.m. Review ↗

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 5, 2026

Comment thread .circleci/config.yml
Comment on lines 27 to +33
- run:
name: "Deploy step"
command: echo "Deploying project..."
- run:
name: Update deployment status to running
command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
- run:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Running set after deploy 🐞 Bug ≡ Correctness

In the deploy job, the Deploy Marker is updated to RUNNING only after the deploy command executes,
so the recorded deployment start/status is wrong and RUNNING is never emitted when the deploy step
fails. This breaks the accuracy of deployment visibility and duration metrics.
Agent Prompt
## Issue description
The deploy marker status is set to RUNNING after the deployment command, which makes the lifecycle tracking inaccurate and skips RUNNING on deployment failures.

## Issue Context
The current order is: plan -> deploy -> update RUNNING -> update SUCCESS/FAILED.

## Fix Focus Areas
- .circleci/config.yml[20-40]

## Suggested change
Move the "Update deployment status to running" step to immediately after "Plan deployment" and before the "Deploy step" so RUNNING reflects the actual start of deployment.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread .circleci/config.yml
Comment on lines +23 to +39
circleci run release plan "${CIRCLE_JOB}" \
--environment-name="default" \
--component-name="${CIRCLE_PROJECT_REPONAME}" \
--target-version="1.0.${CIRCLE_BUILD_NUM}-${CIRCLE_SHA1:0:7}"
- run:
name: "Deploy step"
command: echo "Deploying project..."
- run:
name: Update deployment status to running
command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
- run:
name: Update deployment status to success
command: circleci run release update "${CIRCLE_JOB}" --status=SUCCESS
when: on_success
- run:
name: Update deployment status to failed
command: circleci run release update "${CIRCLE_JOB}" --status=FAILED
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Non-unique deployment id 🐞 Bug ≡ Correctness

All Deploy Marker plan/update commands use ${CIRCLE_JOB} as the deployment identifier, which
resolves to the constant job name "deploy" in this config. Multiple pipeline runs can overwrite each
other’s deployment records by updating the same id.
Agent Prompt
## Issue description
Using `${CIRCLE_JOB}` as the deploy marker identifier makes the id static (`deploy`), so different pipeline runs can update the same deployment record.

## Issue Context
The identifier passed as the first argument to both `circleci run release plan` and `circleci run release update` must be stable within a single run, but unique across runs.

## Fix Focus Areas
- .circleci/config.yml[20-40]

## Suggested change
Replace `${CIRCLE_JOB}` with a per-run unique id (while keeping it consistent across plan/update), for example:
- `${CIRCLE_WORKFLOW_ID}-${CIRCLE_JOB}`
- or `${CIRCLE_PIPELINE_ID}-${CIRCLE_JOB}`
Update all plan/update commands to use the same new identifier.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread .circleci/config.yml
Comment on lines +30 to +40
- run:
name: Update deployment status to running
command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
- run:
name: Update deployment status to success
command: circleci run release update "${CIRCLE_JOB}" --status=SUCCESS
when: on_success
- run:
name: Update deployment status to failed
command: circleci run release update "${CIRCLE_JOB}" --status=FAILED
when: on_fail
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. Marker updates fail deploy 🐞 Bug ☼ Reliability

The marker update steps run circleci run release update ... without guarding failures, so
transient tracking call failures can fail the deploy job even if the deployment succeeded. The
on_fail marker step can also fail and obscure the original deployment failure.
Agent Prompt
## Issue description
Deploy marker reporting commands can fail for reasons unrelated to deployment (network/auth/transient), but currently they can fail the entire job.

## Issue Context
Marker steps are auxiliary telemetry; deployment success/failure should be driven by the actual deploy command.

## Fix Focus Areas
- .circleci/config.yml[30-40]

## Suggested change
Wrap marker commands so they do not fail the job, e.g.:
- `circleci run release update ... --status=RUNNING || echo 'Deploy marker update failed'`
Optionally add a small retry loop for the marker calls, and ensure the FAILED marker step also cannot fail the job (so it doesn’t mask the real failure).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread .circleci/config.yml
Comment on lines +30 to +32
- run:
name: Update deployment status to running
command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
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 deployment status update step lacks when: always, so it won't run if the preceding deployment step fails, leading to incomplete deployment tracking.
Severity: MEDIUM

Suggested Fix

Add the when: always condition to the "Update deployment status to running" step. This ensures that the deployment status is updated regardless of whether the preceding deployment step succeeds or fails, providing more robust and accurate deployment tracking.

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: .circleci/config.yml#L30-L32

Potential issue: The CircleCI configuration places the "Update deployment status to
running" step after the deployment step. However, this status update step is missing the
`when: always` condition. While the current placeholder deployment command (`echo
"Deploying project..."`) will not fail, this configuration establishes a flawed pattern.
When a real, fallible deployment command replaces the placeholder, any failure in that
command will prevent the status update step from running. This will result in incomplete
deployment tracking.

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

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes. Give us feedback

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