Repository navigation
Fix settings-history style check on PRs whose base moved - #113286
Algunenano wants to merge 3 commits into
Conversation
`store_data.py` resolved the namespace and version of each changed `SettingsChangesHistory.cpp` entry by looking up the line number from the GitHub patch in the file read from the working tree. The patch's new-file line numbers refer to the pull request head commit, but CI checks out `refs/pull/N/merge`, which is the head merged with the current base tip. Once the base advances with its own edits above the hunk, the two numberings differ and an entry resolves to the wrong `addSettingsChanges` block: in the observed failure two MergeTree settings landed in the session-settings map, so the check demanded them in a block they can never appear in. Read the file at the head commit so the patch and the file come from the same revision. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [b7716ac] Summary: ✅ AI ReviewSummaryThis PR aims to make the Findings
Final Verdict |
| # can never be in). Read the file at the head commit so both come from the same | ||
| # revision. | ||
| file_lines = Shell.get_output( | ||
| f"git show {info.sha}:{settings_history_file}", verbose=True |
There was a problem hiding this comment.
This still does not guarantee that patch and file_lines come from the same revision. Info.sha is only the PR head SHA for pull_request events; in merge-queue runs _Environment.from_env sets it to GITHUB_SHA, i.e. the merge-group commit, so git show {info.sha}:... reads the merged tree again and reintroduces the original line-number drift whenever the base has moved. On top of that, the default PR workflow still checks out refs/pull/N/merge with CHECKOUT_REF=; in this checkout the PR head object is not present locally (git cat-file -e d4f8546^{commit} fails here), so this path just returns an empty string and fails closed the first time SettingsChangesHistory.cpp changes. I think this needs to fetch the file body from GitHub at the PR head SHA (or another ref guaranteed to be the PR head) instead of relying on the local checkout.
|
#113227 is better |
The
settings_changes_historystyle check resolved the namespace and version of each changed entry insrc/Core/SettingsChangesHistory.cppby looking up the line number reported by the GitHub patch in the file read from the working tree. Those new-file line numbers refer to the pull request head commit, while CI checks outrefs/pull/N/merge, which is the head merged with the current tip of the base branch. As soon as the base advances with its own edits above the hunk, the two numberings drift apart and an entry resolves to the wrongaddSettingsChangesblock.In the observed failure two MergeTree settings (
packed_skip_index_max_bytes,compute_exact_num_defaults_for_sparse_columns) resolved into the session-settings map, so the check demanded them under the session26.8block, where they can never appear. That file is touched by nearly every settings pull request, so the base moves under the check constantly; sync pull requests in the private repository hit it on almost every run.The fix reads the file at the head commit, so the patch and the file come from the same revision.
Changelog category (leave one):