Repository navigation
Conversation
The unit-test bugfix validator builds a before-binary in a merge-base worktree and populated its submodules by hardlinking the primary (master) checkout. That is content-correct only when the merge-base pins the same commit master has checked out. When master bumps a submodule pin/URL after the PR merge-base, the before-worktree gets master content but uses the merge-base cmake wrappers, which reference the merge-base submodule file layout, so cmake configure fails with 'Cannot find source file' (e.g. the 2026-07-20 abseil-cpp fork->upstream switch dropped absl/*/internal/*.cc files the merge-base wrapper expects). Populate each submodule the merge-base needs by comparing the merge-base gitlink SHA to the primary checked-out SHA: hardlink when they match (fast, no network), otherwise fetch that submodule at its own merge-base pin (submodule sync+update, so the merge-base URL is used). Iterate the merge-base .gitmodules so submodules added/removed on master are handled. Strengthen the fail-close to name the unpopulated submodule. Security guards (path shape, realpath containment, shell-quoting) unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Address internal review: a failed `git submodule update` for a drifted submodule can leave the path holding only a `.git` gitlink (nonempty, but no sources), which the populated-check would have accepted. Return (ok, detail) and fail closed immediately on a failed update; require a non-`.git` entry in the final populated-check; and report the specific unpopulated submodule to the caller instead of the generic SUBMODULE_MARKER. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Address internal review (security): the drift path fetches submodules using the merge-base worktree's .gitmodules, but the shape guard in main() validated only the PR checkout's .gitmodules. An older merge-base can carry a non-GitHub URL or an unsafe path even when the PR's current file is clean, so a submodule sync + update driven by it could point the privileged runner at an arbitrary URL. Generalize gitmodules_shape_violation() to take a file path and validate the merge-base .gitmodules before any fetch; fail closed on a violation. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-0:20260722-214900 |
Internal second-model review — adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 3 findings across 1 full pass + 1 delta recheck; bounded: 1 full pass + 1 fix round + 1 delta recheck).
Severity: ❌ blocker / Session id: cron:clickhouse-author-slot-0:20260722-214900 |
|
cc @leshikus @maxknv — could you review this CI-harness fix? The unit-test bugfix validator populated the merge-base before-worktree's submodules by hardlinking the primary (master) checkout, which is content-incorrect when master bumps a submodule pin/URL after the PR merge-base (the 2026-07-20 abseil-cpp fork->upstream switch makes cmake configure fail: |
|
Workflow [PR], commit [2c127be] Summary: ✅ AI ReviewSummaryThis PR fixes the unit-test bugfix validator so the merge-base worktree no longer hardlinks drifted submodule contents from the primary checkout; it now repopulates only the mismatched submodules at the merge-base pin and fails closed with a specific infrastructure error when submodule metadata or population is unsafe or incomplete. I did not find a remaining correctness, safety, or contract issue in the current diff, and the added focused unit coverage matches the new failure modes in the helper. Final Verdict
|
CI finish ledger — 2c127beAll checks green on this head. No failing test rows in CIDB across all shards. The only non-test line is the private sync check.
Session id: cron:our-pr-ci-monitor:20260723-063000 |
|
cc @nickitat |
|
This PR now conflicts with master, and resolving the conflict would ship unreachable code, so I am asking for a disposition instead of force-rebasing it. #111530 (merged 2026-07-25) fixes the same cmake failure this PR targets, by the opposite strategy:
The two cannot coexist as written. On master, The target signature is also dormant: One residual point, for whoever owns this next. Master moved a gitlink or So: close this as superseded by #111530, or should I re-scope it to just the drift-inconclusive gap on top of the current guard? I have not pushed anything and the branch is untouched. |
|
Thanks, closing. |
|
Following up on my question above, because I now think the answer is "neither", and the reason is worth writing down rather than opening another PR. I looked at re-scoping this to just the drift-inconclusive gap on top of the merged guard, i.e. leaving the fail-close exactly as you built it and only changing the status it reports from Why The digest collision is exact, not theoretical. The job's digest hashes the checked-out tree plus submodule SHAs, and this workflow checks out the synthetic merge ref, so the tree it hashes after a rebase is the same tree it hashed before. Measured on the two hits I have:
Byte-identical, and every digest input path ( And no other status is available either. The two constraints are opposite over the whole status set: the cache gate is What is actually left, and why I am not picking one. Every remaining option is a tradeoff you already priced once:
Frequency, in case it changes the priority. Drift here is entirely base-branch motion. Merge-base to PR-head submodule drift is 0 paths on all 4 CIDB hits; what the guard sees (merge-base to merge ref) is 2, 4, 13 and 21 paths. Against master tip, drift by merge-base age is 0 paths at 1 day, 2 at 2 days, 6 at 4 days, 11 at 7 days, 23 at 14 days, 34 at 30 days, with 23 commits touching My own preference would be option 2, but it trades your cache for my report cleanliness on a job you own, so I would rather ask than push it. If you would like option 2 I will open it as a two line change (drop |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Fixes
Bugfix validation (unit tests)erroring with "the before-binary failed to CONFIGURE (cmake)" for bugfix PRs whose merge-base predates a submodule pin/URL change on master.Root cause:
prepare_before_worktreeinci/jobs/unit_tests_bugfix_validation_job.pybuilds the "before" binary in a merge-base worktree and populates its submodules by hardlinking (cp -al) the primary (master) checkout's submodule content. That is content-correct only when the merge-base pins the same commit the primary has checked out. When master bumps a submodule after the merge-base, the before-worktree gets master's content but uses the merge-base cmake wrappers, which reference the merge-base submodule's file layout. The 2026-07-20abseil-cppswitch from theClickHouse/abseil-cppfork (255c84dadd) to upstreamabseil/abseil-cpp(5650e9cf) is the trigger: the merge-base wrapper referencesabsl/base/internal/throw_delegate.ccandabsl/debugging/internal/borrowed_fixup_buffer.cc, which do not exist at those paths upstream, so configure fails with "Cannot find source file". The old fail-close check only looked for a single unrelated submodule marker (contrib/sysroot/README.md), so it did not catch this.Fix: populate each submodule the merge-base needs by comparing the merge-base gitlink SHA to the primary's checked-out SHA. When they match, hardlink as before (fast, no network). When they differ (drift), or the primary lacks the submodule, fetch that submodule at its own merge-base pin (
git -C before_src submodule sync/update, so the merge-base URL is used). The submodule list is taken from the merge-base's own.gitmodulesso submodules added or removed on master are handled correctly. The fail-close now reports the specific unpopulated submodule instead of a generic marker. All existing security guards (path shape validation, realpath containment, shell-quoting) are preserved.Verified locally by reproducing the exact CI cmake error against a pre-2026-07-20 merge-base (upstream abseil hardlinked -> configure fails) and confirming the fix repopulates the 6 drifted submodules for that merge-base and configure succeeds. Added unit tests covering the match/drift/primary-absent cases.
No related open issue found.