Add deploy markers configuration#2
Conversation
Review Summary by QodoAdd CircleCI Deploy Markers configuration to deployment job
WalkthroughsDescription• 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 Diagramflowchart 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
File Changes1. .circleci/config.yml
|
Code Review by Qodo
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe CircleCI Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
|
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 ↗ |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
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
circleciCLI 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
| - run: | ||
| name: Update deployment status to running | ||
| command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING |
There was a problem hiding this comment.
🟡 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.
| - 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}" |
There was a problem hiding this comment.
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
| - run: | ||
| name: Deploy | ||
| command: echo "Deploying..." | ||
| - run: | ||
| name: Update deployment status to running | ||
| command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING |
There was a problem hiding this comment.
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
| 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 |
There was a problem hiding this comment.
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



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