Skip to content

ci(test-optimization): make STS API key fetch non-fatal#9320

Merged
BridgeAR merged 1 commit into
masterfrom
rochdev/ci-test-optimization-sts-continue-on-error
Jul 14, 2026
Merged

ci(test-optimization): make STS API key fetch non-fatal#9320
BridgeAR merged 1 commit into
masterfrom
rochdev/ci-test-optimization-sts-continue-on-error

Conversation

@rochdev

@rochdev rochdev commented Jul 14, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Adds continue-on-error: true to the dd-sts-api-key step in all 7 jobs of the Test Optimization workflow (playwright, mocha, jest, cucumber, selenium, cypress, vitest).

Motivation

Each job independently exchanges a GitHub OIDC token for a Datadog API key via STS. If this exchange fails due to a transient infrastructure issue, the entire job fails before any tests run — producing false failures unrelated to the code under test.

ci/init.js already handles a missing DD_API_KEY gracefully: when DD_CIVISIBILITY_AGENTLESS_ENABLED is set but no key is present, it logs an error and skips initialization rather than crashing. So making the STS step non-fatal is safe — tests still run and results are still reported if the key is available.

Alternative considered

A more robust long-term approach would be to intercept the agentless intake requests in each job and forward them to a single final job for batched submission. This is possible because DD_CIVISIBILITY_AGENTLESS_URL can redirect all intake traffic (citestcycle, citestcov, etc.) to an arbitrary URL. Each job would run a local proxy that saves payloads to disk, upload them as GitHub Actions artifacts, and a single final job would download all artifacts, fetch one STS key, and replay the payloads to the real Datadog intake. This would eliminate per-job STS exchanges entirely but requires building a proxy server and replayer. Left as a future improvement.

Checklist

  • continue-on-error: true added to all 7 dd-sts-api-key steps

Generated by Claude Code

If the OIDC token exchange fails due to a transient infrastructure
issue, jobs were failing before tests even ran. With continue-on-error,
ci/init.js gracefully skips reporting when DD_API_KEY is absent and the
tests still execute normally.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@dd-octo-sts

dd-octo-sts Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.71 MB
Deduped: 7.37 MB
No deduping: 7.37 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 438.86 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@rochdev
rochdev marked this pull request as ready for review July 14, 2026 02:50
@rochdev
rochdev requested a review from a team as a code owner July 14, 2026 02:50
@rochdev
rochdev requested a review from juan-fernandez July 14, 2026 02:50

@datadog-prod-us1-3 datadog-prod-us1-3 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.

Datadog Autotest: PASS

More details

PR adds continue-on-error: true to all 7 dd-sts-api-key steps in test-optimization.yml. Verification confirms ci/init.js gracefully handles missing API keys when agentless mode is enabled—it logs an error and skips initialization, allowing tests to run. The change is safe: it prevents transient STS failures from breaking CI runs when the test initialization already tolerates missing keys.

Was this helpful? React 👍 or 👎

📊 Validated against 4 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 1350e45 · What is Autotest? · Any feedback? Reach out in #autotest

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Jul 14, 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: 96.57% (+0.00%)

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

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (eb8e5b6) to head (1350e45).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #9320    +/-   ##
========================================
  Coverage   96.60%   96.60%            
========================================
  Files         919      919            
  Lines      121692   121692            
  Branches    21027    20895   -132     
========================================
+ Hits       117562   117564     +2     
+ Misses       4130     4128     -2     
Flag Coverage Δ
aiguard 53.56% <ø> (-0.05%) ⬇️
aiguard-integration 57.01% <ø> (ø)
apm-bucket-0 53.79% <ø> (-0.05%) ⬇️
apm-bucket-1 58.07% <ø> (-0.05%) ⬇️
apm-bucket-2 56.11% <ø> (-0.05%) ⬇️
apm-capabilities-tracing 60.34% <ø> (ø)
apm-integrations-aerospike 52.94% <ø> (-0.05%) ⬇️
apm-integrations-confluentinc-kafka-javascript 57.06% <ø> (-0.05%) ⬇️
apm-integrations-couchbase 53.27% <ø> (-0.05%) ⬇️
apm-integrations-http 57.96% <ø> (-0.05%) ⬇️
apm-integrations-kafkajs 57.71% <ø> (-0.05%) ⬇️
apm-integrations-next 54.24% <ø> (-0.05%) ⬇️
apm-integrations-prisma 54.17% <ø> (-0.05%) ⬇️
apm-integrations-tedious 53.04% <ø> (-0.05%) ⬇️
appsec 68.95% <ø> (-0.09%) ⬇️
appsec-express_fastify_graphql 65.68% <ø> (-0.04%) ⬇️
appsec-integration 51.98% <ø> (ø)
appsec-kafka_ldapjs_lodash 59.09% <ø> (-0.04%) ⬇️
appsec-mongodb-core_mongoose_mysql 62.25% <ø> (-0.04%) ⬇️
appsec-next 52.85% <ø> (-0.04%) ⬇️
appsec-node-serialize_passport_postgres 61.88% <ø> (-0.04%) ⬇️
appsec-sourcing_stripe_template 60.34% <ø> (-0.04%) ⬇️
debugger 65.72% <ø> (+0.01%) ⬆️
instrumentations-bucket-0 48.75% <ø> (-0.05%) ⬇️
instrumentations-bucket-1 54.96% <ø> (-0.05%) ⬇️
instrumentations-bucket-10 56.62% <ø> (-0.05%) ⬇️
instrumentations-bucket-11 48.74% <ø> (-0.05%) ⬇️
instrumentations-bucket-12 48.85% <ø> (-0.05%) ⬇️
instrumentations-bucket-13 48.68% <ø> (-0.05%) ⬇️
instrumentations-bucket-2 49.75% <ø> (-0.05%) ⬇️
instrumentations-bucket-3 53.83% <ø> (-0.05%) ⬇️
instrumentations-bucket-4 49.16% <ø> (-0.05%) ⬇️
instrumentations-bucket-5 53.01% <ø> (-0.05%) ⬇️
instrumentations-bucket-6 55.60% <ø> (-0.05%) ⬇️
instrumentations-bucket-7 53.61% <ø> (-0.05%) ⬇️
instrumentations-bucket-8 54.64% <ø> (-0.05%) ⬇️
instrumentations-bucket-9 56.10% <ø> (-0.04%) ⬇️
instrumentations-instrumentation-couchbase 48.18% <ø> (-0.05%) ⬇️
instrumentations-integration-esbuild 33.98% <ø> (ø)
llmobs-ai_anthropic_bedrock 57.73% <ø> (-0.04%) ⬇️
llmobs-bucket-1 56.99% <ø> (-0.04%) ⬇️
llmobs-openai 57.56% <ø> (-0.04%) ⬇️
llmobs-sdk 59.95% <ø> (-0.05%) ⬇️
llmobs-vertex-ai 54.21% <ø> (-0.05%) ⬇️
master-coverage 96.60% <ø> (?)
openfeature 54.62% <ø> (ø)
openfeature-unit 49.83% <ø> (-0.05%) ⬇️
platform-core_esbuild_instrumentations-misc 38.47% <ø> (-0.03%) ⬇️
platform-integration 62.23% <ø> (ø)
platform-shimmer_unit-guardrails_webpack 37.29% <ø> (-0.03%) ⬇️
plugins-bucket-0 53.18% <ø> (-0.05%) ⬇️
plugins-bucket-1 55.08% <ø> (ø)
plugins-bucket-11 55.60% <ø> (-0.05%) ⬇️
plugins-bucket-18 57.08% <ø> (-0.04%) ⬇️
plugins-bucket-19 55.38% <ø> (-0.05%) ⬇️
plugins-bucket-20 57.44% <ø> (-0.05%) ⬇️
plugins-bucket-4 53.85% <ø> (-0.05%) ⬇️
plugins-bullmq_cassandra_cookie 57.36% <ø> (-0.05%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 52.32% <ø> (-0.05%) ⬇️
plugins-fetch_fs_generic-pool 54.46% <ø> (-0.05%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 59.86% <ø> (-0.05%) ⬇️
plugins-hapi_hono_ioredis 55.86% <ø> (-0.05%) ⬇️
plugins-jest_knex_langgraph 51.67% <ø> (-0.05%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 53.44% <ø> (-0.03%) ⬇️
plugins-lodash_mariadb_memcached 54.21% <ø> (-0.05%) ⬇️
plugins-moleculer_mongodb_mongodb-core 57.28% <ø> (-0.05%) ⬇️
plugins-mongoose_multer_mysql 54.71% <ø> (-0.05%) ⬇️
plugins-mysql2_nats_node-serialize 56.21% <ø> (-0.05%) ⬇️
plugins-opensearch_passport-http_pino 55.05% <ø> (-0.05%) ⬇️
plugins-postgres_process_pug 54.29% <ø> (-0.05%) ⬇️
plugins-redis_router_sequelize 57.00% <ø> (-0.05%) ⬇️
plugins-test-and-upstream-rhea_undici_url 57.00% <ø> (-0.07%) ⬇️
plugins-valkey_vm_winston 53.93% <ø> (+0.03%) ⬆️
plugins-ws 54.80% <ø> (-0.05%) ⬇️
profiling 58.20% <ø> (-0.04%) ⬇️
serverless-aws-sdk-aws-sdk 50.67% <ø> (-0.04%) ⬇️
serverless-aws-sdk-bedrockruntime 50.69% <ø> (-0.05%) ⬇️
serverless-aws-sdk-client 51.97% <ø> (-0.05%) ⬇️
serverless-aws-sdk-dynamodb 51.75% <ø> (-0.07%) ⬇️
serverless-aws-sdk-eventbridge 46.26% <ø> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 54.71% <ø> (-0.05%) ⬇️
serverless-aws-sdk-lambda 52.79% <ø> (-0.05%) ⬇️
serverless-aws-sdk-s3 51.54% <ø> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 54.73% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sns 55.52% <ø> (-0.01%) ⬇️
serverless-aws-sdk-sqs 55.91% <ø> (-0.05%) ⬇️
serverless-aws-sdk-stepfunctions 51.25% <ø> (-0.05%) ⬇️
serverless-aws-sdk-util 48.48% <ø> (-0.05%) ⬇️
serverless-bucket-0 55.23% <ø> (-0.01%) ⬇️
serverless-bucket-1 56.01% <ø> (-0.05%) ⬇️
test-optimization-cucumber 72.94% <ø> (-0.01%) ⬇️
test-optimization-cypress 66.33% <ø> (+0.01%) ⬆️
test-optimization-jest 74.25% <ø> (-0.05%) ⬇️
test-optimization-mocha 74.70% <ø> (+0.04%) ⬆️
test-optimization-playwright-playwright-atr 61.57% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-efd 61.76% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-final-status 61.71% <ø> (+0.06%) ⬆️
test-optimization-playwright-playwright-impacted-tests 61.44% <ø> (+0.16%) ⬆️
test-optimization-playwright-playwright-reporting 61.34% <ø> (+0.06%) ⬆️
test-optimization-playwright-playwright-test-management 62.25% <ø> (-0.12%) ⬇️
test-optimization-playwright-playwright-test-span 61.48% <ø> (+0.01%) ⬆️
test-optimization-selenium 60.66% <ø> (-0.17%) ⬇️
test-optimization-testopt 59.15% <ø> (+0.08%) ⬆️
test-optimization-vitest 71.58% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter

pr-commenter Bot commented Jul 14, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-14 03:02:17

Comparing candidate commit 1350e45 in PR branch rochdev/ci-test-optimization-sts-continue-on-error with baseline commit eb8e5b6 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2313 metrics, 45 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-205815.077µs; +205387.444µs] or [-7.721%; +7.705%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-239.843ms; +229.465ms] or [-9.388%; +8.982%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-167.018ms; +162.032ms] or [-5.404%; +5.243%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-184.130ms; +178.295ms] or [-6.317%; +6.116%]

scenario:appsec-control-20

  • unstable execution_time [-132.787ms; +120.485ms] or [-8.074%; +7.326%]

scenario:appsec-control-24

  • unstable execution_time [-115.117ms; +111.331ms] or [-9.305%; +8.999%]

scenario:appsec-control-26

  • unstable execution_time [-125.778ms; +121.320ms] or [-10.129%; +9.770%]

scenario:appsec-iast-no-vulnerability-control-20

  • unstable execution_time [-14191.897µs; +14258.789µs] or [-5.502%; +5.528%]

scenario:appsec-iast-no-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-13.131ms; +15.472ms] or [-5.043%; +5.941%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-16.742ms; +11.013ms] or [-6.517%; +4.287%]

scenario:appsec-iast-with-vulnerability-control-20

  • unstable execution_time [-27614.051µs; +29172.784µs] or [-5.010%; +5.293%]

scenario:appsec-iast-with-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-32.983ms; +29.256ms] or [-5.904%; +5.236%]

scenario:child_process-file-args-24

  • unstable execution_time [-18.755ms; +35.080ms] or [-3.942%; +7.373%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-1980.611ms; +2972.090ms] or [-23.366%; +35.063%]
  • unstable execution_time [-1984.154ms; +3010.464ms] or [-21.595%; +32.765%]
  • unstable instructions [-16.8G instructions; +25.6G instructions] or [-24.215%; +36.902%]
  • unstable max_rss_usage [-7.942MB; +13.117MB] or [-5.062%; +8.360%]
  • unstable throughput [-791.603op/s; +539.371op/s] or [-22.131%; +15.079%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-4.592s; +0.020s] or [-41.385%; +0.181%]
  • unstable execution_time [-4.667s; +0.045s] or [-39.476%; +0.383%]
  • unstable instructions [-41.0G instructions; -0.0G instructions] or [-43.946%; -0.036%]
  • unstable throughput [-18.105op/s; +906.532op/s] or [-0.618%; +30.955%]

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable cpu_user_time [-2050.421ms; +3310.245ms] or [-21.839%; +35.257%]
  • unstable execution_time [-2032.347ms; +3342.437ms] or [-20.096%; +33.051%]
  • unstable instructions [-18.1G instructions; +29.5G instructions] or [-23.202%; +37.878%]
  • unstable max_rss_usage [-6.743MB; +10.748MB] or [-4.239%; +6.757%]
  • unstable throughput [-732.150op/s; +435.096op/s] or [-22.549%; +13.400%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-2.509s; +0.315s] or [-28.073%; +3.520%]
  • unstable execution_time [-2.550s; +0.329s] or [-26.423%; +3.405%]
  • unstable instructions [-21.4G instructions; +2.8G instructions] or [-29.212%; +3.875%]
  • unstable throughput [-100.918op/s; +727.024op/s] or [-2.924%; +21.065%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-3674.500ms; +2415.648ms] or [-34.794%; +22.874%]
  • unstable execution_time [-3659.390ms; +2464.376ms] or [-32.412%; +21.827%]
  • unstable instructions [-32.8G instructions; +21.3G instructions] or [-36.956%; +24.032%]
  • unstable max_rss_usage [-11.268MB; +7.517MB] or [-6.927%; +4.621%]
  • unstable throughput [-547.727op/s; +799.189op/s] or [-18.253%; +26.633%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-312.948ms; +325.576ms] or [-6.651%; +6.920%]
  • unstable execution_time [-315.602ms; +329.338ms] or [-6.602%; +6.889%]
  • unstable throughput [-114396.629op/s; +108426.155op/s] or [-6.521%; +6.180%]

scenario:fs-subscribed-24

  • unstable execution_time [-17.239ms; +33.947ms] or [-4.234%; +8.337%]

scenario:plugin-graphql-long-with-depth-off-20

  • unstable max_rss_usage [-7.769MB; +5.025MB] or [-6.091%; +3.939%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable cpu_user_time [-738.179ms; +731.142ms] or [-5.728%; +5.673%]
  • unstable execution_time [-735229.412µs; +735848.712µs] or [-5.583%; +5.587%]
  • unstable throughput [-3.348op/s; +3.341op/s] or [-5.477%; +5.466%]

scenario:tracing-channel-command-24

  • unstable execution_time [-19.453ms; +27.338ms] or [-4.781%; +6.719%]

@juan-fernandez juan-fernandez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm OK with the change as long as we're aware that this makes test optimization unusable

@BridgeAR
BridgeAR merged commit 7f6c836 into master Jul 14, 2026
658 checks passed
@BridgeAR
BridgeAR deleted the rochdev/ci-test-optimization-sts-continue-on-error branch July 14, 2026 14:24
This was referenced Jul 15, 2026
juan-fernandez pushed a commit that referenced this pull request Jul 16, 2026
If the OIDC token exchange fails due to a transient infrastructure
issue, jobs were failing before tests even ran. With continue-on-error,
ci/init.js gracefully skips reporting when DD_API_KEY is absent and the
tests still execute normally.

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
juan-fernandez pushed a commit that referenced this pull request Jul 16, 2026
If the OIDC token exchange fails due to a transient infrastructure
issue, jobs were failing before tests even ran. With continue-on-error,
ci/init.js gracefully skips reporting when DD_API_KEY is absent and the
tests still execute normally.

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants