Skip to content

Add deploy markers configuration#2

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

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

Conversation

@LCSOGthb

@LCSOGthb LCSOGthb commented Apr 7, 2026

Copy link
Copy Markdown
Owner

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.

@LCSOGthb LCSOGthb merged commit 60a0407 into main Apr 7, 2026
7 of 13 checks passed
@LCSOGthb LCSOGthb deleted the deploy-markers-setup branch April 7, 2026 14:46
@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Add CircleCI Deploy Markers configuration to deployment job

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Adds CircleCI Deploy Markers to track deployments
• Implements deployment planning with release plan command
• Adds deployment status tracking (running, success, failed)
• Enables deployment visibility and metrics in CircleCI UI
Diagram
flowchart LR
  checkout["Checkout code"]
  plan["Plan deployment<br/>circleci run release plan"]
  deploy["Deploy application"]
  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 Deploy Markers into deployment workflow

• Added deployment planning step using circleci run release plan command
• Configured deployment status tracking with three new steps
• Tracks deployment lifecycle: RUNNING, SUCCESS, and FAILED states
• Includes conditional status updates based on job success/failure

.circleci/config.yml


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Apr 7, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3)   📘 Rule violations (0)   📎 Requirement gaps (0)   🎨 UX Issues (0)
🐞\ ≡ Correctness (2) ☼ Reliability (1)

Grey Divider


Action required

1. CircleCI CLI not installed 🐞
Description
The deploy job runs in cimg/base:current and calls circleci run release ... without
installing/providing the CircleCI CLI, which will fail the job with circleci: command not found
before deployment can run.
Code

.circleci/config.yml[R15-24]

      - image: cimg/base:current
    steps:
      - checkout
+      - 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 deploy job’s Docker image is cimg/base:current and the first added deploy-markers step invokes
the circleci executable, but there are no prior steps/orbs in this config that install the
CircleCI CLI binary.

.circleci/config.yml[13-24]

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` job invokes `circleci run release ...` but the job image/config does not install or provide the CircleCI CLI, causing an immediate `command not found` failure.

### Issue Context
`.circleci/config.yml` uses `cimg/base:current` for the job image and only checks out the repo before calling `circleci`.

### Fix Focus Areas
- .circleci/config.yml[13-38]

### Suggested change
Add a step to install the CircleCI CLI (e.g., via an orb install step or a `curl`/package install), or switch the job image to one that already includes the `circleci` CLI. Ensure any required auth token env var for the CLI is configured in the project/context.

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


2. RUNNING updated after deploy 🐞
Description
The config sets deployment status to RUNNING only after the Deploy step finishes, so successful
deploys will be marked RUNNING after completion and failed deploys may never be marked RUNNING at
all.
Code

.circleci/config.yml[R25-30]

      - run:
          name: Deploy
          command: echo "Deploying..."
+      - run:
+          name: Update deployment status to running
+          command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
Evidence
The Update deployment status to running step is placed after Deploy, meaning it can only run
once deployment work is already done (and will be skipped if Deploy fails).

.circleci/config.yml[25-38]

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

### Issue description
Deployment status is updated to RUNNING after the deployment step completes, which inverts the intended state transition semantics.

### Issue Context
In the `deploy` job, `Deploy` runs before the RUNNING update.

### Fix Focus Areas
- .circleci/config.yml[18-38]

### Suggested change
Reorder steps to:
1) plan
2) update status RUNNING
3) deploy
4) update SUCCESS on_success
5) update FAILED on_fail
So RUNNING reflects ‘in progress’ rather than ‘already finished’.

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


3. Non-unique deployment id 🐞
Description
Using ${CIRCLE_JOB} as the deploy marker identifier is constant (e.g., always deploy) across
runs, which can cause different pipeline runs/reruns to overwrite or update the wrong deployment
record.
Code

.circleci/config.yml[R21-33]

+            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
          command: echo "Deploying..."
+      - 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
Evidence
Both release plan and all release update calls pass only ${CIRCLE_JOB} as the identifier, and
${CIRCLE_JOB} is the job name rather than a per-run unique value.

.circleci/config.yml[21-24]
.circleci/config.yml[28-37]

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 ID is `${CIRCLE_JOB}`, which is not unique across pipeline runs, risking collisions between separate deployments.

### Issue Context
The same identifier is used for `circleci run release plan` and subsequent `circleci run release update` calls.

### Fix Focus Areas
- .circleci/config.yml[18-38]

### Suggested change
Create/use a per-run unique deployment ID and reuse it for both plan and update steps. For example, set and persist `DEPLOY_ID` using a combination like `${CIRCLE_WORKFLOW_ID}-${CIRCLE_JOB}-${CIRCLE_BUILD_NUM}` (or capture the ID output from the plan command if that’s the intended contract), then call:
- `circleci run release plan "$DEPLOY_ID" ...`
- `circleci run release update "$DEPLOY_ID" --status=...`
This prevents different runs from writing to the same deployment record.

ⓘ 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

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 503770fd-2dd5-4f73-9982-937e0e4b9c32

📥 Commits

Reviewing files that changed from the base of the PR and between da4c19e and 9fc190b.

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

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Enhanced the deployment pipeline with automated release planning and status tracking capabilities, providing real-time deployment progress monitoring with status updates throughout the operation lifecycle.

Walkthrough

The CircleCI deploy job configuration now includes a release planning step before deployment and conditional status update steps afterward. The planning step generates a versioned deployment plan using the build number and commit SHA. Status updates are sent after the deployment step, reporting either success or failure based on the outcome.

Changes

Cohort / File(s) Summary
CircleCI Deployment Pipeline
.circleci/config.yml
Added release planning step with generated target version (1.0.${CIRCLE_BUILD_NUM}-${CIRCLE_SHA1:0:7}) and conditional status updates (RUNNING/SUCCESS/FAILED) to the deploy job workflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop, a plan, a deploy so bright,
The rabbit ships code with CircleCI's might,
Status updates dance left and right,
Success or fail, we track the flight!

✨ 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.

@vercel

vercel Bot commented Apr 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
racs Error Error Apr 7, 2026 2:47pm

@sonarqubecloud

sonarqubecloud Bot commented Apr 7, 2026

Copy link
Copy Markdown

@deepsource-io

deepsource-io Bot commented Apr 7, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in da4c19e...9fc190b 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 7, 2026 2:47p.m. Review ↗
Swift Apr 7, 2026 2:47p.m. Review ↗
JavaScript Apr 7, 2026 2:47p.m. Review ↗
Ruby Apr 7, 2026 2:47p.m. Review ↗
C & C++ Apr 7, 2026 2:47p.m. Review ↗
C# Apr 7, 2026 2:47p.m. Review ↗
Rust Apr 7, 2026 2:47p.m. Review ↗
Shell Apr 7, 2026 2:47p.m. Review ↗
Terraform Apr 7, 2026 2:47p.m. Review ↗
Test coverage Apr 7, 2026 2:47p.m. Review ↗
SQL Apr 7, 2026 2:47p.m. Review ↗
Secrets Apr 7, 2026 2:47p.m. Review ↗
Ansible Apr 7, 2026 2:47p.m. Review ↗

@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

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

While the PR successfully introduces CircleCI release tracking markers, there is a critical sequencing error in the deployment job. The status update to RUNNING is currently placed after the deployment execution, which prevents accurate real-time monitoring and results in incorrect duration metrics.

Although Codacy indicates the file is up to standards, the logic fails to meet the intent of capturing the execution phase. Addressing the placement of these markers is necessary to ensure the release tracking provides the intended visibility into the deployment lifecycle.

About this PR

  • There is no automated validation or testing included to verify that the circleci CLI commands are correctly formed or that the YAML configuration is valid within the CircleCI environment before deployment.

Test suggestions

  • Verify the 'release plan' command uses correct environment and versioning variables.
  • Verify the deployment status is updated to 'RUNNING' before the deployment logic executes.
  • Verify the 'SUCCESS' status update only triggers on job success using the 'on_success' condition.
  • Verify the 'FAILED' status update only triggers on job failure using the 'on_fail' condition.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the 'release plan' command uses correct environment and versioning variables.
2. Verify the deployment status is updated to 'RUNNING' before the deployment logic executes.
3. Verify the 'SUCCESS' status update only triggers on job success using the 'on_success' condition.
4. Verify the 'FAILED' status update only triggers on job failure using the 'on_fail' condition.

🗒️ Improve review quality by adding custom instructions

Comment thread .circleci/config.yml
Comment on lines +28 to +30
- 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.

🟡 MEDIUM RISK

The deployment status is updated to RUNNING after the Deploy step has already finished. This should be moved before the Deploy step to correctly track the execution phase and provide accurate real-time visibility. Currently, the release remains in a 'Planned' state while the work is happening, only transitioning to 'Running' once the work is complete.

Try running the following prompt in your coding agent:

Move the 'Update deployment status to running' step (currently lines 28-30) so that it executes immediately before the 'Deploy' step (lines 25-27) in the deploy job of .circleci/config.yml.

Comment thread .circleci/config.yml
Comment on lines 15 to +24
- image: cimg/base:current
steps:
- checkout
- 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}"

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. Circleci cli not installed 🐞 Bug ☼ Reliability

The deploy job runs in cimg/base:current and calls circleci run release ... without
installing/providing the CircleCI CLI, which will fail the job with circleci: command not found
before deployment can run.
Agent Prompt
### Issue description
The `deploy` job invokes `circleci run release ...` but the job image/config does not install or provide the CircleCI CLI, causing an immediate `command not found` failure.

### Issue Context
`.circleci/config.yml` uses `cimg/base:current` for the job image and only checks out the repo before calling `circleci`.

### Fix Focus Areas
- .circleci/config.yml[13-38]

### Suggested change
Add a step to install the CircleCI CLI (e.g., via an orb install step or a `curl`/package install), or switch the job image to one that already includes the `circleci` CLI. Ensure any required auth token env var for the CLI is configured in the project/context.

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

Comment thread .circleci/config.yml
Comment on lines 25 to +30
- run:
name: Deploy
command: echo "Deploying..."
- 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.

Action required

2. Running updated after deploy 🐞 Bug ≡ Correctness

The config sets deployment status to RUNNING only after the Deploy step finishes, so successful
deploys will be marked RUNNING after completion and failed deploys may never be marked RUNNING at
all.
Agent Prompt
### Issue description
Deployment status is updated to RUNNING after the deployment step completes, which inverts the intended state transition semantics.

### Issue Context
In the `deploy` job, `Deploy` runs before the RUNNING update.

### Fix Focus Areas
- .circleci/config.yml[18-38]

### Suggested change
Reorder steps to:
1) plan
2) update status RUNNING
3) deploy
4) update SUCCESS on_success
5) update FAILED on_fail
So RUNNING reflects ‘in progress’ rather than ‘already finished’.

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

Comment thread .circleci/config.yml
Comment on lines +21 to +33
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
command: echo "Deploying..."
- 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

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. Non-unique deployment id 🐞 Bug ≡ Correctness

Using ${CIRCLE_JOB} as the deploy marker identifier is constant (e.g., always deploy) across
runs, which can cause different pipeline runs/reruns to overwrite or update the wrong deployment
record.
Agent Prompt
### Issue description
The deploy marker ID is `${CIRCLE_JOB}`, which is not unique across pipeline runs, risking collisions between separate deployments.

### Issue Context
The same identifier is used for `circleci run release plan` and subsequent `circleci run release update` calls.

### Fix Focus Areas
- .circleci/config.yml[18-38]

### Suggested change
Create/use a per-run unique deployment ID and reuse it for both plan and update steps. For example, set and persist `DEPLOY_ID` using a combination like `${CIRCLE_WORKFLOW_ID}-${CIRCLE_JOB}-${CIRCLE_BUILD_NUM}` (or capture the ID output from the plan command if that’s the intended contract), then call:
- `circleci run release plan "$DEPLOY_ID" ...`
- `circleci run release update "$DEPLOY_ID" --status=...`
This prevents different runs from writing to the same deployment record.

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

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