Repository navigation
Resolve the settings-history patch against the PR head file, not the merged checkout - #113227
Merged
Merged
Conversation
…merged checkout The `store_data.py` workflow hook resolves the added lines of the PR diff of `src/Core/SettingsChangesHistory.cpp` (whose new-file line numbers refer to the PR head) against the local CI checkout, which is the PR merged with the base branch. When the base branch grew an earlier `addSettingsChanges` block after the merge base, the checkout's line numbers are shifted relative to the head file, so an added entry is attributed to the wrong block - even the wrong namespace - and `check_settings_changes_history` fails for an entry that sits in the correct block. Seen on #101039 (report https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101039&sha=bef6b90a8a945792a833d227aca6eb4dfe213011&name_0=PR&name_1=Style%20check): `leader_election`, recorded in the MergeTree `26.8` block all along, was reported as `Session setting 'leader_election' must be recorded in the '26.8' block` because master's Session section had grown past the merge base. Fetch the file as it is at the PR head instead, whose numbering is the one the patch was computed against. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
|
Workflow [PR], commit [aa4d71a] Summary: ✅ AI ReviewSummaryThis PR fixes the settings-history hook by reading the diff and file body from the same PR-file payload, which looks correct. I am not approving it as-is because the second commit deletes the only dedicated regression suite for the LSan Findings
Final Verdict
|
Contributor
Build profile diff (arm_release)No arm_release build profile data for commit aa4d71a - the build was skipped, reused from cache, or predates profile upload. |
The patch came from `repos/{repo}/pulls/{pr}/files` while the file body was
fetched at the head SHA from a second, live `repos/{repo}/pulls/{pr}` call, so a
push landing between the two requests would resolve line numbers from one head
against the file from another. The `files` entry already carries a
`contents_url` pinned to the commit its `.patch` was computed against, so read
both from that one response.
Also delete `ci/tests/test_lsan_ptrace_probe_filter.py`: it loads
`tests/clickhouse-test` via `runpy.run_path` and now fails to import,
`20 failed, 2 passed`, blocking CI.
Algunenano
approved these changes
Aug 4, 2026
Algunenano
enabled auto-merge
August 4, 2026 15:17
This was referenced Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
The
store_data.pyworkflow hook resolves the added lines of the PR diff ofsrc/Core/SettingsChangesHistory.cpp(whose new-file line numbers refer to the PR head) against the local CI checkout, which is the PR merged with the base branch. When the base branch grew an earlieraddSettingsChangesblock after the merge base, every checkout line below that block is shifted relative to the head file, so an added entry is attributed to the wrong block — even the wrong namespace — andcheck_settings_changes_historygoes red for an entry that sits in the correct block.Seen on #101039: the
leader_electionentries, recorded in the MergeTree26.8block all along, were reported asSession setting 'leader_election' must be recorded in the '26.8' block, becausemaster's Session section had grown past the merge base and shifted themerge_tree_settings_changes_historyheader in the merged checkout. The false red also drops every downstream CI job.Fix: fetch the file as it is at the PR head (
contentsAPI at the PR head SHA), whose numbering is the one the patch was computed against. Fail-close is preserved: any fetch failure ends up in the existingexceptpath, so the style check still refuses to pass silently.CI report with the false positive: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101039&sha=bef6b90a8a945792a833d227aca6eb4dfe213011&name_0=PR&name_1=Style%20check
Related: #101039
Version info
26.8.1.768(included in26.8and later)