Repository navigation
Prefer local Git metadata over CI provider values - #13279
juan-fernandez wants to merge 5 commits into
Conversation
CI Visibility Test Environment - sbt-scalatestJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
CI Visibility Test Environment - nebula-release-pluginJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
CI Visibility Test Environment - heliboardJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
This comment has been minimized.
This comment has been minimized.
CI Visibility Test Environment - pass4sJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
🟢 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. |
CI Visibility Test Environment - netflix-zuulJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
CI Visibility Test Environment - reactive-streams-jvmJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
|
/datadog autotest review |
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
CI Visibility Test Environment - sonar-kotlinJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d40da19a7e
ℹ️ 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".
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.
CI fallback can combine local repository and branch values with a CI-provided SHA. The new precedence also exposes commit-message truncation for messages containing a quote-comma-quote sequence.
🤖 Bits Code Review · Commit d40da19
CI Visibility Test Environment - jolokiaJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
CI Visibility Test Environment - okhttpJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
CI Visibility Test Environment - spring_bootJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
CI Visibility Test Environment - sonar-javaJob Status: 🟢 success
Baseline: median of Tests run to verify that CI Visibility behavior has not regressed in the current PR. |
|
/datadog autotest review |
|
@codex review |
🛡️ 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b55af59663
ℹ️ 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".
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".
There was a problem hiding this comment.
Detached checkouts with multiple tags can report the wrong release tag because Git returns only one preferred match. Option-like SHA overrides are also interpreted as Git flags instead of being rejected.
🤖 Bits Code Review · Commit b55af59
|
/datadog autotest review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! 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
Selected-revision history and packfile metadata stay aligned with the session SHA, including old selected commits and deferred unshallow recovery. Explicit Git overrides retain precedence over readable checkout metadata.
🤖 Bits Code Review · Commit ee3e64d
|
/datadog autotest review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. 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 completed static review supports consistent use of the selected session SHA across metadata selection, Git history discovery, and packfile uploads, including explicit overrides and older selected commits.
🤖 Bits Code Review · Commit 2b4e051
|
/datadog autotest review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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 revision selected for Git metadata is also used for upload history and packfile metadata, addressing the checkout-versus-CI SHA mismatch. Runtime behavior was not revalidated.
🤖 Bits Code Review · Commit f6b959a
There was a problem hiding this comment.
More details
Source review and Git fixture checks support consistent SHA selection across metadata and uploads, including explicit overrides and unreadable-checkout fallback. No actionable correctness regression was identified.
🤖 Bits Code Review · Commit f6b959a
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6b959ada3
ℹ️ 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".
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".
| if (latestCommits.isEmpty() && config.isCiVisibilityGitUnshallowDefer()) { | ||
| unshallowed = gitRepoUnshallow.unshallow(); | ||
| if (unshallowed) { | ||
| latestCommits = gitClient.getLatestCommits(selectedCommit); |
There was a problem hiding this comment.
Fetch the selected revision before giving up
When an explicit DD_GIT_COMMIT_SHA names a revision absent from a shallow clone—particularly an older commit outside latestCommitsSince or a commit on another branch—this retry still cannot recover it: GitRepoUnshallow.unshallow() fetches only HEAD/upstream, and ShellGitClient.unshallow() applies --shallow-since, so getLatestCommits(selectedCommit) remains empty and the upload is silently skipped. The new empty-history retry fixes the earlier control-flow failure, but the selected revision itself must be fetched before concluding that there is no data to upload.
Useful? React with 👍 / 👎.
| LinkedHashSet<String> outsideWindow = new LinkedHashSet<>(commitsToInclude); | ||
| for (String object : objects) { | ||
| outsideWindow.remove(object); | ||
| } |
There was a problem hiding this comment.
Do not re-add commits excluded by known descendants
When the backend knows a newer commit but not every ancestor returned in latestCommits, the first rev-list correctly excludes that commit's reachable history via ^commitToSkip. However, every included root omitted from that result is classified as outsideWindow and then re-added with --no-walk, even when it was omitted because it is reachable from the skipped descendant rather than because of the age/count window. This defeats commitsToSkip and can package up to the full history limit of commit and tree objects that the exclusion deliberately avoided; only roots actually outside the configured window should be added separately.
Useful? React with 👍 / 👎.
| String ciSha = ciInfo.getCommit().getSha(); | ||
| if (Strings.isNotBlank(ciSha) && !ciSha.equals(localInfo.getCommit().getSha())) { |
There was a problem hiding this comment.
Compare telemetry SHAs case-insensitively
When a CI provider supplies the same hexadecimal SHA as the local checkout but uses uppercase characters, this comparison records a commit discrepancy and causes GIT_COMMIT_SHA_MATCH to be reported as false. The normal integrity path below was changed to equalsIgnoreCase, so the selected metadata correctly treats these SHAs as identical while the newly added local-versus-CI telemetry reports the opposite; use the same case-insensitive comparison here.
Useful? React with 👍 / 👎.
What Does This Do
Use explicit
DD_GIT_*overrides, then metadata from the readable local Git checkout, then CI-provider Git metadata when the checkout cannot be read. Preserve CI job and pull-request relationship data, and keep test events, TIA requests, and packfile upload metadata on the selected session SHA.Motivation
GitHub Actions pull-request jobs can check out the PR head while
GITHUB_SHAstill identifies a synthetic merge commit. Using different revisions across events, TIA requests, and Git uploads breaks their correlation.Additional Notes
This intentionally changes default reported Git metadata when CI-provider values disagree with a readable checkout. Provider-only standard Git fields stay absent when unavailable locally. Explicit customer overrides retain priority.
Validation: Java 21 focused suites passed (18 tests across
GitInfoProviderTest,GitClientGitInfoBuilderTest,CIProviderGitInfoBuilderTest, andGitDataUploaderImplTest), and both changed modules passed Spotless formatting. Coverage includes missing local remote/branch/tag, CI fallback, explicit overrides, and upload SHA selection. Full tracer and real-backend/end-to-end suites have not been run.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: Not linked
Shared correctness fixture update: https://github.com/DataDog/test-environment/pull/612
test-environment-branch: juan-fernandez/git-metadata-precedence
Git tag enumeration now uses
--no-columnso configured column formatting cannot combine multiple tags into one invalid value. All three real-Git parser tests and Spotless pass, including tag enumeration with forced column output. The shared snapshot fixture update is linked in DataDog/test-environment#612.An explicit SHA selecting another revision clears inferred tags and commit details for the previous revision. Explicit DD metadata retains priority, and CI job and PR relationship fields remain intact.
15 GitInfoProvider tests and internal-api Spotless checks pass with JDK 21.