Skip to content

changelog/check: stop flagging base-branch CHANGELOG.md edits as PR changes - #6451

Draft
p-datadog wants to merge 2 commits into
masterfrom
fix-changelog-check-base-tip-diff
Draft

p-datadog wants to merge 2 commits into
masterfrom
fix-changelog-check-base-tip-diff

Conversation

@p-datadog

@p-datadog p-datadog commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Fixes the changelog/check CI job. The check previously diffed the pull request event's recorded base SHA against the test-merge checkout, which attributes base-branch CHANGELOG.md edits to the pull request whenever the recorded base SHA lags the base tip or a release regenerated CHANGELOG.md on master. The script now receives the base ref and the pull request head SHA from the workflow and diffs origin/<base_ref>...<PR head SHA>, so only changes made by the pull request itself are counted.

Motivation:

The changelog/check job on PR #6118 failed with "This pull request modifies CHANGELOG.md directly" although that branch never touches CHANGELOG.md: github.event.pull_request.base.sha carried a 2026-10-02 base SHA while the run merged into the 2026-10-07 master tip, so the 2.44.0 release regenerating CHANGELOG.md on master was reported as a pull request change. Any pull request open across a release is falsely rejected, and the branch has no way to remedy it.

Change log entry

No. Internal CI fix.

Additional Notes:

How to test the change?

  • Existing CI

…hanges

The changelog/check job failed on PR #6118 with "This pull request
modifies CHANGELOG.md directly" although the branch never touches
CHANGELOG.md.

Root cause: on pull_request events actions/checkout checks out GitHub's
test-merge commit, whose tree carries the base branch's current
CHANGELOG.md, and github.event.pull_request.base.sha can lag the base
branch tip by days (observed: the event carried a 2026-10-02 base SHA
while the run merged into a 2026-10-07 master tip). The script diffed
from the recorded base SHA to the merge checkout, so the 2.44.0 release
regenerating CHANGELOG.md on master was reported as a PR change. Any PR
open across a release is falsely rejected, and the branch has no
remedy: nothing on the branch touches CHANGELOG.md.

Fix: pass the base ref and the PR head SHA from the workflow and diff
origin/<base_ref>...<PR head SHA>, which counts only the PR's own changes
(the merge base of base tip and PR head is the PR's fork point) and
stays correct when the branch merges master after a release, when the
base SHA is stale, and when CI checks out the PR head because the test
merge conflicts.

Task: extract the changelog fix from PR #6118 into its own draft pull
request, per user request, so the CI fix lands independently of the
coordinated-sampling feature. The fix itself was authored on PR #6118
to fix its failing changelog/check job. Passing the base ref and PR head
SHA from the workflow instead of relying on the test-merge commit's
parent order is my design decision. No changelog fragment: internal CI
tooling.

Verified when authored on PR #6118 by reproducing the CI state locally
(test merge of the PR head into the current master tip, with the run's
recorded base SHA and branch name): the old script exits 1 (reproduces
the failure), the fixed script exits 0. A simulated branch that
modifies CHANGELOG.md is still rejected; a bump_to_version_* branch is
rejected when it does not modify CHANGELOG.md and accepted when it
does; a changelog_fix_* branch is accepted; a branch that merged
post-release master is accepted; missing BASE_REF or PR_HEAD_SHA
errors.

Re-verified on the current master tip: the fix applies cleanly
(cherry-picked from PR #6118's casual-correlation branch), shellcheck
and yamllint clean. actionlint is not installed and is absent from the
Debian package lists, so it was not run.
@p-datadog p-datadog added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Oct 8, 2026
@dd-octo-sts dd-octo-sts Bot added the dev/github Github repository maintenance and automation label Oct 8, 2026
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 90.65% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4365104 | Docs | View more details | Give us feedback!

@p-datadog

Copy link
Copy Markdown
Member Author

@codex review

@p-datadog
p-datadog requested a balanced review from Copilot October 8, 2026 18:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 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-08T19:08:26.294063Z 9703e8e Manual request
🔒 Security Review ✅ Completed 2026-10-08T19:09:31.885281Z 9703e8e Manual request
ℹ️ 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.

Copilot AI 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.

🟢 Approval recommended

The ref selection and full-history checkout correctly support the intended three-dot diff.

0 open findings

What changed in this PR

Fixes false-positive changelog checks caused by stale pull-request base SHAs.

Changes:

  • Passes the base ref and actual PR head SHA into the check.
  • Diffs the PR head against the current base branch merge-base.
File Description
.github/​workflows/​check.yml Supplies accurate PR refs to the script.
.github/​scripts/​check_changelog_release_only.sh Restricts detection to PR-authored changes.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 9703e8efb7

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 9703e8efb7

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@p-datadog

Copy link
Copy Markdown
Member Author

@codex review

Copilot AI 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.

🟢 Approval recommended

The updated three-dot diff correctly isolates PR changes, with full history available from checkout.

0 open findings

🧠 Review effort: Balanced

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 9703e8efb7

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 9703e8efb7

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

User request in session: delete the comment block added by this branch in
.github/scripts/check_changelog_release_only.sh explaining why the
changed-files diff is computed against the current base tip instead of
the recorded base SHA. No functional change.

All changes in this commit are user requirements from session input.

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

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos dev/github Github repository maintenance and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants