Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,27 @@ jobs:
- 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}"
Comment on lines 15 to +24

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

- run:
name: Deploy
command: echo "Deploying..."
- run:
name: Update deployment status to running
command: circleci run release update "${CIRCLE_JOB}" --status=RUNNING
Comment on lines +28 to +30

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 on lines 25 to +30

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

- run:
name: Update deployment status to success
command: circleci run release update "${CIRCLE_JOB}" --status=SUCCESS
Comment on lines +21 to +33

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

when: on_success
- run:
name: Update deployment status to failed
command: circleci run release update "${CIRCLE_JOB}" --status=FAILED
when: on_fail

workflows:
say-hello-workflow:
Expand Down
Loading