Skip to content

fix(dora): treat 401 as non-retriable and exit non-zero#2303

Merged
ava-silver merged 1 commit into
masterfrom
ava.silver/chore/fix-dora-deployment-401-non-retriable-exit-code
May 5, 2026
Merged

fix(dora): treat 401 as non-retriable and exit non-zero#2303
ava-silver merged 1 commit into
masterfrom
ava.silver/chore/fix-dora-deployment-401-non-retriable-exit-code

Conversation

@ava-silver

@ava-silver ava-silver commented May 4, 2026

Copy link
Copy Markdown
Contributor

What and why?

Fixes #2301.

When dora deployment received a 401 (Unauthorized), it would retry 5 times and then silently swallow the error -- printing "✅ Successfully sent" and exiting with code 0 despite the API call having failed.

Two root causes:

  1. errorCodesNoRetry in retry.ts was missing 401, so the request was retried unnecessarily.
  2. nonRetriableErrorCodes in the DORA deployment command was also missing 401, so after all retries were exhausted the caught error was swallowed (returned instead of thrown), letting execute() fall through to the success log.

How?

Added 401 to both lists:

  • packages/base/src/helpers/retry.ts -- bail immediately on 401 (no retries)
  • packages/plugin-dora/src/commands/deployment.ts -- throw on 401 (propagates out of execute(), skips the success log, exits non-zero)

Added a test that mocks a 401 response and asserts exit code is non-zero and the success message is absent.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

ava-silver commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ava-silver ava-silver changed the title chore: fix dora deployment 401 non-retriable exit code fix(dora): treat 401 as non-retriable and exit non-zero May 4, 2026
@ava-silver ava-silver added bug Something isn't working software-delivery Related to [coverage, deployment, dora, junit, measure, tag, trace] labels May 4, 2026
@ava-silver
ava-silver marked this pull request as ready for review May 4, 2026 14:05
@ava-silver
ava-silver requested review from a team as code owners May 4, 2026 14:05
@ava-silver
ava-silver requested a review from borja-gomez May 4, 2026 14:05
@ava-silver
ava-silver merged commit 8bd248d into master May 5, 2026
30 of 32 checks passed
@ava-silver
ava-silver deleted the ava.silver/chore/fix-dora-deployment-401-non-retriable-exit-code branch May 5, 2026 16:00
@ava-silver ava-silver mentioned this pull request May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working software-delivery Related to [coverage, deployment, dora, junit, measure, tag, trace]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants