Skip to content

Migrate integration tests from static API key to dd-sts - #981

Open
chouetz wants to merge 1 commit into
DataDog:masterfrom
chouetz:nicolas.schweitzer/dd-sts
Open

Migrate integration tests from static API key to dd-sts#981
chouetz wants to merge 1 commit into
DataDog:masterfrom
chouetz:nicolas.schweitzer/dd-sts

Conversation

@chouetz

@chouetz chouetz commented Aug 20, 2026

Copy link
Copy Markdown
Member

https://datadoghq.atlassian.net/browse/ACIX-1817

Summary

  • Replaces DD_TEST_CLIENT_API_KEY and DD_TEST_CLIENT_APP_KEY secrets with short-lived credentials fetched via dd-sts-action
  • Adds id-token: write permission required for OIDC token federation
  • Switches DD_TEST_CLIENT_USER from a secret to a repo variable (vars.DD_TEST_CLIENT_USER)

This depends on the dd-source policy datadogpy-integration-tests being merged and deployed before this workflow is enabled.

Test plan

  • Confirm dd-source policy PR is merged and deployed see https://github.com/ddoghq/dd-source/pull/62067
  • Set DD_TEST_CLIENT_USER as a repo variable in GitHub settings
  • Remove DD_TEST_CLIENT_API_KEY and DD_TEST_CLIENT_APP_KEY secrets from repo settings once confirmed working
  • Trigger the workflow by adding the ci/integrations label to a PR and verify credentials are fetched successfully

🤖 Generated with Claude Code

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).
@chouetz
chouetz marked this pull request as ready for review August 20, 2026 16:00
@chouetz
chouetz requested a review from a team as a code owner August 20, 2026 16:00

@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: 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 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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