Skip to content

Add branch-first release versioning logic - #13630

Draft
mhdatie wants to merge 2 commits into
masterfrom
mo.atie/release-branch-first-versioning
Draft

mhdatie wants to merge 2 commits into
masterfrom
mo.atie/release-branch-first-versioning

Conversation

@mhdatie

@mhdatie mhdatie commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Adds the version logic for a branch-first release process, where release/vX.Y.x is cut from master before vX.Y.0 is tagged. It is not wired into TracerVersionPlugin yet, so current builds are unchanged.

Build Version
release/v1.69.x at the cut 1.69.0-rc.0
release/v1.69.x after the system-tests pin 1.69.0-rc.1
v1.69.0 tag pipeline 1.69.0
release/v1.69.x after v1.69.0 1.69.1-rc.N (same as today)
master or feature branches once release/v1.69.x exists 1.70.0-SNAPSHOT

Motivation

Today vX.Y.0 is created on master before the release branch is cut. Creating the tag publishes the release, so publishing can't be deferred until after the branch is cut. It also means every release branch build is a candidate for the next patch, never for the release itself: today's first release/v1.69.x builds were 1.69.1-rc.0 and 1.69.1-rc.1.

With branch-first, the current logic breaks:

  • Before the tag, release branch builds come out as e.g. 1.68.1-rc.249.
  • Master keeps building 1.69.0-SNAPSHOT after the cut.

Follow-up to #13262.

Process flow

Current (tag first)

  1. Tag vX.Y.0 on master. This one push:
    • publishes the release from the GitLab tag pipeline (Maven Central, GitHub release assets);
    • creates release/vX.Y.x and opens the system-tests pin PR (create-release-branch.yaml);
    • drafts the release notes and closes the milestone.
  2. Publish the GitHub release, which runs the "released" workflows (issues, Cloud Foundry, download links).
  3. Patches: cherry-pick onto release/vX.Y.x, then tag vX.Y.Z on the branch.

New (branch first)

  1. Cut release/vX.Y.x from master. Open the system-tests pin PR and close the milestone. Master moves to X.(Y+1).0-SNAPSHOT.
  2. Validate X.Y.0-rc.N builds on the release branch, and cherry-pick fixes.
  3. Tag vX.Y.0 on the release branch head. The tag pipeline publishes.
  4. Publish the GitHub release, as today.
  5. Patches: unchanged.

What has to change to get there

Change Ticket
Version logic (this PR) APMLP-2339
Wire it into TracerVersionPlugin behind a switch, off by default, so the current logic stays available APMLP-2340
Create the release branch on demand, not on the tag push. Close the milestone at the cut. Update the release docs. APMLP-2341
Optional: only the release automation or the dd-trace-java-releasers team can create v* tags APMLP-2342
Optional: fail release-branch builds in CI when master is missing from the clone, instead of warning APMLP-2344
Limit the tag pipeline to a check that the tagged commit is on release/vX.Y.x with a green pipeline, then rebuilding at the release version, checking the jar contents, publishing, and SSI. The full suite already ran on the release branch. APMLP-2343
Final task: remove the switch and the tag-first version logic APMLP-2345

Additional Notes

  • N before the line tag is the number of commits added to the release branch since it was cut. The cut is the last commit shared with master (git merge-base), so later master commits are never counted.
  • Master's next minor is one above the higher of the last tag and the newest release/vX.Y.x branch, read with git ls-remote, falling back to local remote-tracking refs.
  • No new tags or refs. A marker tag at the cut was considered and dropped, because it would be a public tag that needs managing.
  • Warnings:
    • when master is missing from the clone (N then falls back to counting from the previous tag);
    • when master was merged into a release branch.
  • The code is self-contained in new files. Wiring it into TracerVersionPlugin will be a separate change.

Test plan

  • Unit tests (28) and integration tests on temporary git repos (21): cd buildSrc && ../gradlew :test -PrunBuildSrcTests --tests '*BranchFirst*'
  • Existing TracerVersionIntegrationTest unchanged and passing
  • Confirm release-branch CI clones contain origin/master. A feature-branch llm validation job suggests they do: git fetch origin master didn't create origin/master, and git merge-base HEAD origin/master succeeded. To confirm on a release branch, once wired, check the build job log of the next release/v* pipeline for the "Master is missing from the git clone" warning, or add git rev-parse --verify origin/master to a release-branch job.
  • Measure the cost of the git ls-remote call on master/feature builds in CI and locally, including offline

Risks

  • If release-branch clones lack master, N falls back to counting from the previous tag. The build logs a warning but doesn't fail, unless APMLP-2344 is done.
  • If the tag pipeline stops running the full suite, the pre-publish check becomes the only guarantee that the published commit was tested.
  • "Green" on the release branch has to mean green, not retried until green.
  • Tag-only code paths (CI_COMMIT_TAG logic, publishing configuration) would only be covered by the jar checks.

Jira ticket: APMLP-2339

🤖 Generated with Claude Code

Compute tracer versions for a release process where release/vX.Y.x is
cut from master before vX.Y.0 is tagged:

- release/vX.Y.x builds X.Y.0-rc.N before the line tag, with N the
  commits added to the branch since it was cut from master, then
  X.Y.(Z+1)-rc.N after vX.Y.Z as today.
- master and feature branches build the next minor after the newest
  release/vX.Y.x branch, so master moves on at the branch cut.

Warns when master is missing from the clone or was merged into a
release branch. Not wired into TracerVersionPlugin yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mhdatie mhdatie added type: feature Enhancements and improvements 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 Nov 22, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 60.30% (-0.67%)

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

@dd-octo-sts

dd-octo-sts Bot commented Nov 22, 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.80 s 14.74 s [-0.3%; +1.1%] (no difference)
startup:insecure-bank:tracing:Agent 13.58 s 13.66 s [-1.4%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.25 s 17.15 s [-0.2%; +1.4%] (no difference)
startup:petclinic:iast:Agent 17.13 s 17.09 s [-0.7%; +1.2%] (no difference)
startup:petclinic:profiling:Agent 16.66 s 16.96 s [-3.0%; -0.5%] (maybe better)
startup:petclinic:sca:Agent 17.25 s 16.99 s [+0.6%; +2.5%] (maybe worse)
startup:petclinic:tracing:Agent 16.15 s 16.26 s [-1.7%; +0.4%] (no difference)

Commit: 30e4c911 · 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.

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

This branch has not been deployed

No deployments
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: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant