Skip to content

datadog-ci dora deployment exits with status code 0 despite authorization error #2301

Description

@MartinAltmayerTMH

Bug description

When running datadog-ci dora deployment with an invalid API key, the command exits with status code 0.

export DATADOG_API_KEY="invalid"
npx @datadog/datadog-ci dora deployment --service my-service --env beta --version 1.0.0  --started-at $(date +%s)
datadog-ci v5.15.0
@datadog/datadog-ci-plugin-dora v5.15.0
⚠ --git-repository-url or --git-commit-sha not provided.
Assuming deployment of the current HEAD commit: <REDACTED>
This warning can be disabled with --skip-git but git data is required for Change Lead Time.
Sending DORA deployment event for service: my-service
[attempt 1] Retrying to send DORA deployment event for service: my-service: Request failed with status code 401
[attempt 2] Retrying to send DORA deployment event for service: my-service: Request failed with status code 401
[attempt 3] Retrying to send DORA deployment event for service: my-service: Request failed with status code 401
[attempt 4] Retrying to send DORA deployment event for service: my-service: Request failed with status code 401
[attempt 5] Retrying to send DORA deployment event for service: my-service: Request failed with status code 401
❌ Failed to send DORA deployment event for service: my-service: {
  "errors": [
    "Unauthorized"
  ]
}
✅ Successfully sent DORA deployment event for service: my-service

The last line cannot be correct, because the API key is invalid.

Describe what you expected

datadog-ci should exit with status code > 0. In the best case, it should not even retry on 401 errors (and other non-transient errors).

Steps to reproduce the issue

Run the following in any Git repository:

export DATADOG_API_KEY="invalid"
npx @datadog/datadog-ci dora deployment --service my-service --env beta --version 1.0.0  --started-at $(date +%s)
echo $?

The last command shows exit code 0.

Additional context

Linux, Node v25.9.0, NPM

Command

None

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions