Skip to content

👷 Add help message when publish fail - #4690

Merged
bdibon merged 2 commits into
mainfrom
boris.dibon/suggest-renew-token-on-publish-fail
May 29, 2026
Merged

👷 Add help message when publish fail#4690
bdibon merged 2 commits into
mainfrom
boris.dibon/suggest-renew-token-on-publish-fail

Conversation

@bdibon

@bdibon bdibon commented May 28, 2026

Copy link
Copy Markdown
Contributor

Motivation

When scripts/deploy/publish-npm.ts fails during npm publish, print an actionable message so CI operators know what to check next, while preserving the original command diagnostics.

Changes

  • Add a try/catch block to log the help message while preserving the original error
  • Matching unit test

Test instructions

You can run the following command, make sure to not be logged on aws.

> node ./scripts/deploy/publish-npm.ts 
Building
Publishing

Script exited with error: Error: NPM publish failed. Run `node ./scripts/release/renew-token.ts` and retry the job.
...

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@bdibon
bdibon requested a review from a team as a code owner May 28, 2026 08:43

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efb83a65e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/deploy/publish-npm.ts Outdated
try {
command`yarn workspaces foreach --verbose --all --topological --no-private npm publish --tolerate-republish --access public ${dryRun ? ['--dry-run'] : []}`
.withEnvironment({
YARN_NPM_AUTH_TOKEN: dryRun ? '' : getNpmToken(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid masking token lookup failures as publish failures

When the AWS SSM lookup in getNpmToken() fails before yarn ... npm publish is even started (for example missing AWS credentials or an SSM outage), this try block now rethrows it as "NPM publish failed" and tells operators to renew the npm token. That is misleading for failures that happen while fetching the token rather than during npm publish; keep the token lookup outside this publish-failure wrapper or only wrap the command execution so the new help message is limited to actual publish failures.

Useful? React with 👍 / 👎.

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 175.47 KiB 175.47 KiB 0 B 0.00%
Rum Profiler 8.08 KiB 8.08 KiB 0 B 0.00%
Rum Recorder 21.23 KiB 21.23 KiB 0 B 0.00%
Logs 57.01 KiB 57.01 KiB 0 B 0.00%
Rum Slim 133.08 KiB 133.08 KiB 0 B 0.00%
Worker 22.99 KiB 22.99 KiB 0 B 0.00%

🔗 RealWorld

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented May 28, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.57% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6455064 | Docs | Datadog PR Page | Give us feedback!

@bdibon
bdibon merged commit 42dc96b into main May 29, 2026
30 checks passed
@bdibon
bdibon deleted the boris.dibon/suggest-renew-token-on-publish-fail branch May 29, 2026 09:31
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants