Migrate integration tests from static API key to dd-sts - #981
Conversation
Replace DD_TEST_CLIENT_API_KEY and DD_TEST_CLIENT_APP_KEY secrets with short-lived credentials from dd-sts-action, and switch DD_TEST_CLIENT_USER to a repo variable (non-secret).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20f9d69df5
ℹ️ 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".
| DD_TEST_CLIENT_USER: "${{ secrets.DD_TEST_CLIENT_USER }}" | ||
| DD_TEST_CLIENT_API_KEY: ${{ steps.dd-sts.outputs.api_key }} | ||
| DD_TEST_CLIENT_APP_KEY: ${{ steps.dd-sts.outputs.app_key }} | ||
| DD_TEST_CLIENT_USER: ${{ vars.DD_TEST_CLIENT_USER }} |
There was a problem hiding this comment.
Provision the repository variable before switching
When DD_TEST_CLIENT_USER has not yet been configured as a repository variable—as the commit's unchecked setup step indicates—GitHub expands this expression to an empty string. Both integration commands use --vcr-record=all, and tests/integration/conftest.py passes that empty value through its is not None check to the comment API tests, causing every labeled integration run to fail. Provision the variable before merging or retain a temporary fallback to the existing secret.
Useful? React with 👍 / 👎.
The reusable workflow's `telemetry` job no longer has any dd-sts/OIDC surface; it only accepts an optional `datadog_api_key` secret. Internal callers that want a short-lived key now mint it themselves in a dedicated job (see ai-review.yml's new `dd_sts` job) and pass it in via `needs.dd_sts.outputs.api_key`, matching the pattern used in DataDog/datadogpy#981. This accepts that GitHub job outputs aren't masked, which matters for public-repo callers; README.md documents the tradeoff and the fail-open, continue-on-error setup. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Add optional Datadog telemetry with dd-sts credential minting Consolidates telemetry into a single finish-time metrics submission from an isolated job, drops the datadog_environment gate (this workflow runs on pull_request/issue_comment, so a GitHub environment can't protect the secret), and adds an optional dd-sts path so internal callers can mint a short-lived Datadog API key at runtime instead of storing one. Enables telemetry on this repo's own ai-review.yml to dogfood the feature. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Move dd-sts credential minting to the caller workflow The reusable workflow's `telemetry` job no longer has any dd-sts/OIDC surface; it only accepts an optional `datadog_api_key` secret. Internal callers that want a short-lived key now mint it themselves in a dedicated job (see ai-review.yml's new `dd_sts` job) and pass it in via `needs.dd_sts.outputs.api_key`, matching the pattern used in DataDog/datadogpy#981. This accepts that GitHub job outputs aren't masked, which matters for public-repo callers; README.md documents the tradeoff and the fail-open, continue-on-error setup. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Correct README's dd-sts job-output exposure warning dd-sts-action calls ::add-mask:: on the key before writing it to GITHUB_OUTPUT, so GitHub redacts it from logs for the rest of the run, and there's no REST API exposing raw job outputs. The prior wording overstated the exposure risk without checking the action's source. Environment: Datadog workspace Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * less wording --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
https://datadoghq.atlassian.net/browse/ACIX-1817
Summary
DD_TEST_CLIENT_API_KEYandDD_TEST_CLIENT_APP_KEYsecrets with short-lived credentials fetched viadd-sts-actionid-token: writepermission required for OIDC token federationDD_TEST_CLIENT_USERfrom a secret to a repo variable (vars.DD_TEST_CLIENT_USER)This depends on the dd-source policy
datadogpy-integration-testsbeing merged and deployed before this workflow is enabled.Test plan
DD_TEST_CLIENT_USERas a repo variable in GitHub settingsDD_TEST_CLIENT_API_KEYandDD_TEST_CLIENT_APP_KEYsecrets from repo settings once confirmed workingci/integrationslabel to a PR and verify credentials are fetched successfully🤖 Generated with Claude Code