Add baseline:detect job for microbenchmarks (dd-octo-sts auth)#5539
Closed
Add baseline:detect job for microbenchmarks (dd-octo-sts auth)#5539
Conversation
Detect the PR's target branch via dd-octo-sts + gh CLI instead of relying on benchmarking-platform's github-find-merge-into-branch, which fails when the GitHub App is suspended (incident-51987). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 6f80321 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a
microbenchmarks-baseline-detectjob that detects the PR's target branch usingdd-octo-sts+ghCLI, then passes it to the microbenchmarks job asMANUAL_BASELINE_BRANCHvia a dotenv artifact. This bypassesgithub-find-merge-into-branchinside bp-runner, which crashes because its GitHub App installation is suspended (incident-51987).This is the more robust alternative to #5538 (which uses a simpler one-line fallback to the default branch). This PR gets the actual PR target branch from GitHub, so it's correct even for PRs targeting non-default branches.
dd-octo-ststrust policygitlab.github-access.readto be provisioned forDataDog/dd-trace-rb. This policy exists for dd-trace-py but not for dd-trace-rb. See failing job log:Prerequisites before this can merge:
dd-octo-ststrust policygitlab.github-access.readfor scopeDataDog/dd-trace-rb(admin action)Motivation:
All dd-trace-rb PRs that touch code paths are currently failing microbenchmarks because the benchmarking platform's GitHub App is suspended. See #5538 for the full root cause analysis.
This PR models the approach dd-trace-py has used since March 2025: a separate baseline detection job that authenticates via
dd-octo-sts(independent of the benchmarking platform's GitHub App) and writes the result to a dotenv artifact consumed by the benchmark jobs.How it works:
New
microbenchmarks-baseline-detectjob runs in thepackagestage (beforemicrobenchmarks):dd-octo-ststo get a GitHub token scoped toDataDog/dd-trace-rbgh pr view --json baseRefNameto find the PR's target branchmasterif the lookup failsMANUAL_BASELINE_BRANCH=<branch>to a dotenv artifactThe
microbenchmarksjob now hasneeds: [{job: microbenchmarks-baseline-detect, optional: true, artifacts: true}]instead ofneeds: []:MANUAL_BASELINE_BRANCHis set from the dotenv artifactrun-microbenchmarks__setup.shtemplate checks for this variable and skipsgithub-find-merge-into-branchentirelyoptional: trueensures microbenchmarks still runs — it falls through to the shared template's default behaviorThe detect job has the same
rules:as themicrobenchmarksjob (minus the master rule, since on master we always compare against master anyway), so it only runs when microbenchmarks would run.Comparison with #5538:
dd-octo-sts(not yet provisioned)Recommend merging #5538 first to unblock CI immediately, then this PR once
dd-octo-stsis provisioned.Change log entry
None.
Additional Notes:
Cross-tracer analysis of how every tracer handles baseline detection:
baseline:detectjob withdd-octo-sts+gh pr view ... || echo "main"(this PR's model)run-benchmarks.shwithgithub-find-merge-into-branch || :origin/masterset -equirk with variable assignments — runs without baseline comparison)How to test the change?
Once
dd-octo-stspolicy is provisioned:lib/orext/and verify:microbenchmarks-baseline-detectjob runs and outputsMANUAL_BASELINE_BRANCH=master(or the actual target branch)microbenchmarksjobs pick up the variable and skipgithub-find-merge-into-branch