Skip to content

Build release versions only in GitLab tag pipelines - #13068

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
bbujon/ci-tracer-version-fix
Oct 27, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
bbujon/ci-tracer-version-fix

Conversation

@PerfectSlayer

@PerfectSlayer PerfectSlayer commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

What Does This Do

Makes TracerVersionPlugin build a release version only in the GitLab pipeline of that tag.

  • In GitLab (GITLAB_CI set), a build checked out on a tag vX.Y.Z keeps the version X.Y.Z only when CI_COMMIT_TAG is vX.Y.Z.
  • Any other GitLab pipeline on the tagged commit, such as master or a release/v* branch, builds the next snapshot version, as if there were later commits. For example, master builds X.(Y+1).0-SNAPSHOT and release/vX.Y.x builds X.Y.(Z+1)-SNAPSHOT.
  • Builds outside GitLab (local builds, GitHub Actions) are unchanged.

Motivation

The v1.68.0 release ended up with two Maven Central deployments. Both pipelines ran on the tagged commit 36cefc7:

  • Master pipeline 147390587: its build job ran before the tag was visible and built 1.68.0-SNAPSHOT. Its deploy_to_maven_central job started at 08:22 UTC, re-resolved the version through git describe, got the exact tag, and computed 1.68.0. publishToSonatype closeSonatypeStagingRepository then created deployment changing List<Span> for List<DDSpan> #1.
  • Tag pipeline 147390895 created deployment First PR - Implements the Opentracing API #2 at 08:42 UTC.

The version only depended on git describe, so any job checking out the tagged commit after the tag push built the release version, whatever pipeline it belonged to.

Additional Notes

  • Tests: assertTracerVersion now always removes GITLAB_CI and CI_COMMIT_TAG from the inherited environment, so the tests don't depend on the GitLab pipeline running them. There are new cases for a master pipeline, a release branch pipeline, and another tag's pipeline on a tagged commit. Run them with ./gradlew :buildSrc:test -PrunBuildSrcTests --tests 'datadog.gradle.plugin.version.*'.
  • When the version is forced to a snapshot on an exact tag, -SNAPSHOT is appended even with useSnapshot = false, so the option can't produce a release-looking version. Nothing sets that option today.

Contributor Checklist

Jira ticket: APMLP-1743

🤖 Generated with Claude Code

In GitLab, use the version of the tag the commit is checked out on only
when CI_COMMIT_TAG names that tag. Other pipelines on the tagged commit,
like the master one, build the next snapshot version instead.

A master pipeline that started after the v1.68.0 tag was pushed computed
1.68.0 in deploy_to_maven_central and created a second Maven Central
deployment.

APMLP-1743

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PerfectSlayer PerfectSlayer added this to the 1.69.0 milestone Oct 27, 2026
@PerfectSlayer PerfectSlayer added type: bug fix Bug fix tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM labels Oct 27, 2026
@PerfectSlayer
PerfectSlayer marked this pull request as ready for review October 27, 2026 07:04
@PerfectSlayer
PerfectSlayer requested a review from a team as a code owner October 27, 2026 07:04
@PerfectSlayer
PerfectSlayer requested review from bric3 and removed request for a team October 27, 2026 07:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T07:07:06.070025Z 4ac5148 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-27T07:08:09.198548Z 4ac5148 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The matching-tag check prevents GitLab branch pipelines on tagged commits from producing release versions while preserving behavior outside GitLab. The completed static review found no actionable regression, and no human PR discussion was present.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 4ac5148

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.45% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 70668c7 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.01 s 13.92 s [-0.0%; +1.4%] (no difference)
startup:insecure-bank:tracing:Agent 12.88 s 12.99 s [-1.5%; -0.2%] (maybe better)
startup:petclinic:appsec:Agent 17.03 s 16.99 s [-0.6%; +1.0%] (no difference)
startup:petclinic:iast:Agent 16.94 s 16.92 s [-0.7%; +0.9%] (no difference)
startup:petclinic:profiling:Agent 16.61 s 16.16 s [-1.5%; +7.1%] (no difference)
startup:petclinic:sca:Agent 17.04 s 17.06 s [-0.9%; +0.7%] (no difference)
startup:petclinic:tracing:Agent 16.16 s 16.16 s [-0.9%; +0.9%] (no difference)

Commit: 70668c79 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@bric3 bric3 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The intent and fix is sound, but I'd avoid the lambda indirections.

Address review: replace the lambda passed to toTracerVersion with an
isReleaseTag(tag) function and keep its original signature.

APMLP-1743

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PerfectSlayer

Copy link
Copy Markdown
Collaborator Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-27 13:47:46 UTC ℹ️ Start processing command /merge


2026-10-27 13:47:50 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-10-27 15:16:31 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 8167327 into master Oct 27, 2026
608 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the bbujon/ci-tracer-version-fix branch October 27, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants