Skip to content

Record the build version and commit in the jar manifests - #945

Open
rkennke wants to merge 3 commits into
mainfrom
rkennke/jar-manifest-commit
Open

rkennke wants to merge 3 commits into
mainfrom
rkennke/jar-manifest-commit

Conversation

@rkennke

@rkennke rkennke commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?:

Every library jar (assemble<Config>Jar: the published release jar and the debug classifier) now carries these manifest attributes:

Attribute Value
Implementation-Title ddprof
Implementation-Version the build version (componentVersion)
Implementation-Vendor Datadog
Git-Commit CI_COMMIT_SHA in GitLab, otherwise git rev-parse HEAD, or unknown if git fails (logged as a warning)

Motivation:

The published jars have a bare manifest; 1.52.1 contains only Manifest-Version: 1.0. A snapshot version such as 1.54.0-SNAPSHOT does not identify the source it was built from. Consumers such as speedlab's profiler_version build input (DataDog/speedlab#88) therefore cannot trace a jar back to a commit.

Additional Notes:

  • GitLab's commit is preferred over GITHUB_SHA. On pull_request runs, GITHUB_SHA is GitHub's synthetic merge commit. GitHub Actions jars are not published, so they fall back to git.
  • No dirty marker. A local build from uncommitted changes records HEAD. Published jars always come from a clean GitLab checkout.
  • Accepted cost — please acknowledge: Git-Commit is an input of the jar tasks. Locally, a new commit with no source change (an amend or a rebase) re-assembles the jars and re-runs the tests that consume them.
  • git rev-parse runs at configuration time, like compute-version.sh in the root build.
  • Agentic review (/code-review): 9 findings, none Critical or High.
    • Fixed: the merge-commit SHA, blank CI_COMMIT_SHA, the doc wording, silent git failures, the test accepting unknown in GitLab, and the missing javadoc.
    • Not changed, for the reasons above: the dirty marker, configuration-time git, and jar re-assembly per commit.

How to test the change?:

JarManifestTest reads the manifest of the jar the tests run against. It checks the title, vendor and version, that the version matches the jar's file name, and that Git-Commit is a 40-hex SHA. When CI_COMMIT_SHA is set, it checks that the jar recorded exactly that SHA.

The test passes with and without CI_COMMIT_SHA=1111… set. Before this change it fails, because the manifest has no Implementation-Title.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: PROF-16488

🤖 Generated with Claude Code

The published ddprof jars had a bare manifest, and a snapshot version such
as 1.54.0-SNAPSHOT does not identify the source it was built from. Every
assembled library jar now records Implementation-Title,
Implementation-Version, Implementation-Vendor and Git-Commit. The commit is
CI_COMMIT_SHA in GitLab, which publishes, and git rev-parse HEAD elsewhere,
or "unknown" when git fails. JarManifestTest reads the manifest of the jar
the tests run against.

PROF-16488

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rkennke
rkennke requested a review from a team as a code owner November 5, 2026 15:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T15:17:07.234596Z 4110806 PR opened
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4110806b34

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ddprof-lib/build.gradle.kts Resolved

@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.

Bits Code Review: PASS

More details

The manifest metadata reaches the published and debug jars through their existing assembly tasks, with the debug Premain-Class preserved. Changing the recorded commit intentionally rebuilds jars and reruns consuming tests, as acknowledged in the PR.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 4110806

@dd-octo-sts

dd-octo-sts Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Scan-Build Report

User:runner@runnervm7aw5e
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 all
Clang Version:Ubuntu clang version 18.1.3 (1ubuntu1)
Date:Thu Nov 5 15:24:19 2026

Bug Summary

Bug TypeQuantityDisplay?
All Bugs2
Logic error
Dereference of null pointer1
Unused code
Dead initialization1

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Unused codeDead initializationreferenceChains.cppapplyOomRamp4971
Logic errorDereference of null pointerperfEvents_linux.cppunregisterThread72026

rkennke and others added 2 commits November 5, 2026 15:18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dd-octo-sts

dd-octo-sts Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #42054216673 | Commit: eb361d0 | Duration: 19m 49s (longest job)

✅ All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - ✅ - -
8-ibm - ✅ - -
8-j9 ✅ ✅ - -
8-librca - - ✅ ✅
8-orcl - ✅ - -
11 - ✅ - -
11-j9 ✅ ✅ - -
11-librca - - ✅ ✅
17 ✅ ✅ - -
17-graal ✅ ✅ - -
17-j9 ✅ ✅ - -
17-librca - - ✅ ✅
21 ✅ ✅ - -
21-graal ✅ ✅ - -
21-librca - - ✅ ✅
25 ✅ ✅ - -
25-graal ✅ ✅ - -
25-librca - - ✅ ✅

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-11-05 15:45:01 UTC

@dd-octo-sts

dd-octo-sts Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

✅ All 40 integration tests passed

📊 Dashboard · 👷 Pipeline · 📦 04b9c6f3

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants