Repository navigation
Fix tracer version on release branches built from a detached HEAD - #13031
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
Conversation
9fbaaf8 to
f3051d1
Compare
|
It would be nice to have this for next release due next week, otherwise I can cherry pick this into either the existing 67.x release branch or the upcoming 68.x after its release to verify what gets uploaded to S3 from the build job. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
dougqh
left a comment
There was a problem hiding this comment.
Approving. It's a small, correct fix for a real bug, and the S3 table plus the unzip -p … dd-java-agent.version commands make it easy to verify.
What I checked:
- The fallback only applies when
git rev-parse --abbrev-ref HEADreturnsHEADandCI_COMMIT_BRANCHis non-blank. The same branch value drives both--first-parentand the patch-vs-minor choice, and named-branch builds are unchanged. - Each pipeline type still behaves: tag pipelines are exact (HEAD is on the tag), MR pipelines fall back to the next minor as before, and GitHub merge-queue pipelines are skipped in
.gitlab-ci.yml. providerFactory.environmentVariableis a tracked configuration-cache input.- No existing test detaches HEAD, so CI's real
CI_COMMIT_BRANCHcan't flip any of them on arelease/v*pipeline. - Scope: released artifacts come from tag pipelines and were already correct. The affected builds are release-branch snapshots, which support hands to customers to verify fixes and which reported a future version to telemetry.
tag: no release notesfits.
Two non-blocking suggestions inline.
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
More details
The GitLab branch fallback supplies the release branch to both first-parent tag lookup and patch-version selection, correcting detached-checkout snapshot versions while preserving named-branch and exact-tag behavior.
🤖 Bits Code Review · Commit f3051d1
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
GitLab checks out the pipeline commit as a detached HEAD, so `git rev-parse --abbrev-ref HEAD` returns "HEAD" and release branch builds were versioned with a minor bump instead of a patch bump. Fall back to CI_COMMIT_BRANCH when git reports a detached HEAD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ersionPlugin.kt Co-authored-by: Douglas Q Hawkins <douglas.hawkins@datadoghq.com>
Co-authored-by: Douglas Q Hawkins <douglas.hawkins@datadoghq.com>
20fda34 to
60ab6cd
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
df2ab9b
into
master
What Does This Do
Makes
TracerVersionPlugindetect release branches when the repository is checked out as a detachedHEAD, as GitLab does for every pipeline.git rev-parse --abbrev-ref HEADreturnsHEADon a detached checkout. When that happens, the plugin now uses GitLab'sCI_COMMIT_BRANCHas the branch name. Local builds on a named branch are unchanged.Two integration tests are added:
should increment patch on release branch checked out as detached HEAD in GitLab: detached onrelease/v1.52.xpastv1.52.1withCI_COMMIT_BRANCHset, expects1.52.2-SNAPSHOT. Without the fix it gets1.53.0-SNAPSHOT.should use exact version on tag checked out as detached HEAD in GitLab: tag pipelines are detached and only setCI_COMMIT_TAG, expects the exact tag version1.52.1.Motivation
Release branch pipelines produce artifacts with the next minor version instead of the next patch. With a detached
HEAD, therelease/vcheck fails, so the plugin runsgit describewithout--first-parentand callsnextMinorVersion().The existing release branch tests use
git switch -c release/v1.52.xand never detach, so they don't cover the CI case.Reproducing with recent S3 uploads
publish-artifacts-to-s3uploads each pipeline's jar to the publicdd-trace-java-buildsbucket. The embedded version shows the bug without running the jar:curl -sSfO https://s3.us-east-1.amazonaws.com/dd-trace-java-builds/145172115/dd-java-agent.jar unzip -p dd-java-agent.jar dd-java-agent.version unzip -p dd-java-agent.jar META-INF/MANIFEST.MF | grep Implementation-Versiongit describe --first-parent145172115/(release/v1.67.x, Oct 16 2026)v1.67.1-3-g6c1e5f90891.68.0-SNAPSHOT~6c1e5f90891.67.2-SNAPSHOTrelease/v1.67.x/(latest for branch)v1.67.1-3-g6c1e5f90891.68.0-SNAPSHOT~6c1e5f90891.67.2-SNAPSHOTrelease/v1.66.x/(Sep 8 2026)v1.66.0-1-g9751b1d4471.67.0-SNAPSHOT~9751b1d4471.66.1-SNAPSHOTOther ways to reproduce
buildjob of a release branch pipeline (e.g. 145172115), the Gradle output showsTracer build version: 1.68.0-SNAPSHOT. TheIncrementing minor/Incrementing patch…lines arelogger.infoand only print with--info.HEADtest. It fails withexpected: "1.52.2-SNAPSHOT" but was: "1.53.0-SNAPSHOT".Additional Notes
buildSrctests are disabled unless-PrunBuildSrcTestsis set (or run from IntelliJ). Without it,:testisSKIPPEDand the build still reports success. To run:unsetEnvbecausebuildSrctests also run in GitLab, where the realCI_COMMIT_BRANCHwould otherwise leak into them.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: APMLP-2109
🤖 Generated with Claude Code