Skip to content

ci: post a stale dd-trace v5 pin to Slack instead of failing - #870

Draft
cbeauchesne wants to merge 1 commit into
DataDog:mainfrom
cbeauchesne:cbeauchesne/dd-trace-v5-pin-slack
Draft

cbeauchesne wants to merge 1 commit into
DataDog:mainfrom
cbeauchesne:cbeauchesne/dd-trace-v5-pin-slack

Conversation

@cbeauchesne

Copy link
Copy Markdown
Collaborator

What does this PR do?

Changes the weekly dd-trace v5 pin freshness / check-pin job so that a stale v5 pin no longer fails it:

  • Pin current: the job succeeds, as before.
  • Pin stale (schedule, push to main, manual run): the job posts a reminder to #apm-serverless through the SLACK_ALERTS_WEBHOOK incoming webhook, then succeeds.
  • The check itself fails, or the Slack post fails: the job fails. That covers a wrong peerDependencies range, an npm registry error, a missing secret, or a revoked webhook.
  • Pin stale on a pull request that touches the pin files: the job still fails, and nothing is posted.

scripts/check_dd_trace_v5_pin.sh now exits 2 for a stale pin, instead of 1. When it runs in GitHub Actions, it also writes configured/latest to $GITHUB_OUTPUT. A stale pin still makes the script exit non-zero, so the GitLab npm publish gate (.gitlab/scripts/publish_npm.sh, build.yaml.tpl) behaves exactly as before.

Motivation

Slack thread: the job failed on purpose whenever a new dd-trace v5 came out (5 of its 7 runs in 30 days). Each of those failures counted as a CI infra failure in the repo's Green CI metric, even though the job had done its work. The team chose option 1: the job succeeds and posts to #apm-serverless.

Testing Guidelines

  • Ran scripts/check_dd_trace_v5_pin.sh locally with GITHUB_OUTPUT set. It exits 2 and writes configured=5.136.0 / latest=5.137.0, since the pin is stale right now.
  • Ran the Slack step's script against a fake local endpoint. With a 200 reply, the message is sent and the step passes. With a 404 no_service reply, the step fails with exit code 22 and prints Slack's reply.
  • Not tested end to end yet. That needs the SLACK_ALERTS_WEBHOOK repo secret, which a repo admin has to add before this is merged. After that, a manual workflow_dispatch run should post the real reminder, since the pin is currently stale.

Additional Notes

The webhook is bound to #apm-serverless, so the workflow doesn't set a channel.

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

🤖 Generated with Claude Code

The weekly check-pin job failed on purpose whenever a new dd-trace v5
was published, which counted as a CI infra failure in Green CI. Outside
of pull requests, a stale pin now posts a reminder to #apm-serverless and
the job succeeds; it fails only when the check itself or the Slack post
fails.

check_dd_trace_v5_pin.sh exits 2 for a stale pin (still non-zero, so the
GitLab npm publish gate is unchanged) and reports both versions through
$GITHUB_OUTPUT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant