Repository navigation
Fix bugfix validation failing due to git ownership check in Docker - #97014
Conversation
The `find_master_builds` function runs `git log origin/master` inside Docker containers that run as root, but the repository is owned by the `ubuntu` user. Git's ownership check blocks the command, returning empty output, so no master commits are found and the job fails with "Could not find master builds in S3". Add `git config --global --add safe.directory` before the git command, following the existing pattern in `build_clickhouse.py` and `build_toolchain.py`. #96351 Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Workflow [PR], commit [75f7059] Summary: ✅ AI ReviewSummaryThis PR reworks bugfix-validation CI so functional and integration jobs discover a recent master commit with complete AMD sanitizer/debug artifacts, run the changed tests across those master binaries, preserve infrastructure Missing context / blind spots
Tests
Final VerdictStatus: Minimum required action: wait for the current bugfix-validation functional and integration jobs to finish successfully, and provide evidence that the bugfix-labelled inversion path is exercised or tested. |
…on-git-ownership # Conflicts: # ci/jobs/functional_tests.py # ci/jobs/integration_test_job.py
Co-Authored-By: Claude Opus 4.6 <[email protected]>
In CI, the checkout is a shallow clone of the branch head, so `git log origin/master` does not work reliably. Instead, fetch recent master commits via the GitHub API in the Config Workflow job (which already uses `gh`) and pass them through `Info` KV data. This eliminates the need for `git config --global --add safe.directory` workarounds and makes bugfix validation independent of git clone depth. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Two issues with bugfix validation: 1. Crashes (e.g. sanitizer errors) produce `ERROR` status, but the result inversion only handled `FAIL`↔`OK`. A crash that reproduces the bug was not recognized as successful validation. 2. In functional tests, server logs from all 5 build types were mixed together in the same directory, making it impossible to diagnose which build type caused a crash. Fix: treat `ERROR` the same as `FAIL` in result inversion (both count as bug reproduction), and save server logs to per-build-type directories between iterations. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Rewrite bugfix validation loops in both functional and integration tests to exit early on the first build type that reproduces the bug. This: - Avoids duplicate test names (known CI limitation) - Preserves server logs for the failed build type so CHECK_ERRORS can analyze them - Reduces false negatives from workspace pollution between runs Also re-enable the CHECK_ERRORS stage for bugfix validation: it detects crashes (sanitizer errors, FATAL messages) which are valid bug reproductions. Combined with the previous commit that treats ERROR status as successful reproduction, crashes are now properly validated. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…gfix-validation-git-ownership
…kHouse/ClickHouse into fix-bugfix-validation-git-ownership
…on-git-ownership # Conflicts: # ci/jobs/functional_tests.py
Co-Authored-By: Claude Opus 4.6 <[email protected]>
…dling - functional_tests.py: Run `CHECK_ERRORS` (fatal message checking) for each build type inside the bugfix validation loop, rather than once at the end. This ensures crashes detected in any build type's logs are caught even when logs are cleaned between builds. The outer `CHECK_ERRORS` stage is skipped for bugfix validation since it is handled per-build. - integration_test_job.py: Mirror the primary run's infrastructure-error handling in the bugfix validation loop: call `_mark_infrastructure_errors` for each `bt_result_parallel`/`bt_result_sequential`, propagate `has_error` and `error_info`, and skip sequential tests on error. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Previously `find_master_builds` only probed the first build type (`build_amd_asan`) and assumed the same SHA had all other required build types. This could pick a master commit with a partial build set (e.g. one sanitizer build failed or wasn't uploaded), causing later `wget` calls to fail. Now all entries in `BUGFIX_BUILD_TYPES` are checked with `curl -sfI` before the SHA is accepted. If any artifact is missing, the function continues to the next master commit. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Master added the `Fast test (arm_darwin)` job and the PR's `job_configs.py` moves bugfix validation to `pr-amd-medium`; regenerate `master.yml` and `pull_request.yml` to match `ci/*.py`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…digest correct in bugfix validation Three correctness fixes for the multi-build-type bugfix validation flow, addressing review feedback: - `run_tests` now derives `--memory-limit` from the build type under test (`build_type`) rather than the job name. For bugfix validation the job name is `Bugfix validation (functional tests)`, so the `amd_asan_ubsan` run previously got the 5 GiB default instead of 10 GiB, and a master-side memory-limit failure would have been inverted as a reproduced bug. - The per-build restart in the bugfix loop now uses a new server-only `ClickHouseProc.stop_server` instead of `terminate`. `terminate` tears down Redpanda/Kafka and resets the MinIO webhooks, which the loop did not restore, so a changed Kafka/MinIO test could pass under the first build type and spuriously "reproduce" a bug under later ones. `stop_server` stops only the server processes and leaves the auxiliary services up; `terminate` now delegates to it. - The shared helper `ci/jobs/scripts/bugfix_validation.py` is added to the digest inputs of both bugfix validation jobs, so a later change to it invalidates the Praktika cache instead of leaving the jobs cached with stale behavior. It is added to the integration job's own digest (not the common integration config) to avoid affecting unrelated integration jobs. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…on-git-ownership # Conflicts: # ci/jobs/functional_tests.py
|
Merged The only conflict was in All other files ( |
…lidation In the per-build-type loop of bugfix validation, `CH.start` and `CH.wait_ready` return `False` on failure but their return values were ignored, so `clickhouse-test` ran even when the swapped-in binary (e.g. `amd_tsan`/`amd_msan`) never became ready. The resulting `Server died` `FAIL` rows would then be flipped by `invert_bugfix_validation_status` into a successful reproduction, even though the binary never started. Check the restart result and, on failure, append an `ERROR` row and stop before running tests for that build type. `ERROR` rows are preserved (not inverted) by `invert_bugfix_validation_status`, so the job correctly reports the run as inconclusive instead of a spurious "bug reproduced". Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ion build type
The downloaded master binaries are self-extracting: the real ELF is
decompressed in place on first invocation. The per-build-type loop swapped
the binary and immediately called `start`, which only waits 15s for the
pid file. A sanitizer binary takes longer than that to self-extract, so the
swap to `amd_tsan` timed out ("Server failed to start after switching to
the amd_tsan binary"), and a later `clickhouse local` racing the half-written
binary failed with `open: Is a directory`. Decompress synchronously right
after the swap - exactly as the install stage does via
`clickhouse-server --version` - so `start` runs an already-extracted binary.
`start` also wipes the server data directory (`run_path0`), so the MinIO log
tables, stateful data, and `system.zookeeper` config built once in the START
stage are gone after the restart. Re-create them per build type (the
auxiliary Kafka/MinIO services keep running across `stop_server`, so only
server-side state needs rebuilding). Otherwise a stateful changed test fails
only because `test.hits`/`datasets`/the auxiliary ZooKeeper row disappeared,
and the bugfix inverter reports that false failure as a successful bug
reproduction.
CI report: #97014
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Pushed Root cause of the red bugfix-validation job (CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97014&sha=ec6e9f63011fb74db4bcab86208fdf820ff0b6b4&name_0=PR&name_1=Bugfix%20validation%20%28functional%20tests%29): the downloaded master binaries are self-extracting. The per-build-type loop swapped the binary and immediately called The remaining failure |
…alidation `extend_sub_results` recomputes the aggregate status from child rows only, so a runner-level `ERROR` set by `FTResultsProcessor` (e.g. `not s.success_finish`) with parsed `OK`/`FAIL` rows was erased by the fatal-log row extension before `invert_bugfix_validation_status` could check it, allowing a harness-level termination to be inverted to green. Capture `is_error` before extending and restore the status afterwards, for both the first build type and the per-build-type loop. Co-Authored-By: Claude Fable 5 <[email protected]>
…validation digest `bugfix_validation_ft_pr_job` is not derived from `common_ft_job_config` and did not include `ci/jobs/scripts/clickhouse_proc.py` in its cache digest, even though the bugfix-validation loop now depends on `ClickHouseProc.stop_server` and `ClickHouseProc.clean_logs`. A later fix in `ClickHouseProc` (or in `FTResultsProcessor`) could leave the job cached with stale behavior. Add both support files to the digest. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Status update:
|
Bugfix validation calls `find_master_builds` in every non-local run, but the `store_data` hook populated `master_commits` only when `info.repo_name == "ClickHouse/ClickHouse"`, so the synced private PR workflow would reach those jobs without the key and fail with `AssertionError: Could not find master builds in S3`. Both the commits query and the S3 artifact namespace are hardcoded to the public upstream repo, so storing the data unconditionally works from any repo. Co-Authored-By: Claude Fable 5 <[email protected]>
The synthetic `OOM in dmesg` result is a harness/resource failure, but the bugfix-validation inversion treated every `FAIL` leaf as a reproduced bug, so a host OOM after otherwise passing tests would flip to `OK` and hide an infrastructure failure as successful reproduction. For bugfix validation, report it as `ERROR` and set `has_error`, the same way the synthetic `Timeout` result is handled. Co-Authored-By: Claude Fable 5 <[email protected]>
|
|
||
| bugfix_validation_functional_tests: | ||
| runs-on: [self-hosted, pr-arm-medium] | ||
| runs-on: [self-hosted, pr-amd-medium] |
There was a problem hiding this comment.
Generated from ci/defs/job_configs.py: bugfix_validation_ft_pr_job switched its runs_on from FUNC_TESTER_ARM to FUNC_TESTER_AMD. The job downloads master server binaries from S3 (BUGFIX_BUILD_TYPES = ["amd_asan_ubsan", "amd_tsan", "amd_msan", "amd_debug"]) and runs them, and those x86-64 binaries cannot execute on an ARM runner — hence amd-medium.
| bugfix_validation_ft_pr_job = Job.Config( | ||
| name=JobNames.BUGFIX_VALIDATE_FT, | ||
| runs_on=RunnerLabels.FUNC_TESTER_ARM, | ||
| runs_on=RunnerLabels.FUNC_TESTER_AMD, |
There was a problem hiding this comment.
This job downloads and runs master server binaries from S3 to validate the fix against them. As of this PR those are AMD builds — BUGFIX_BUILD_TYPES = ["amd_asan_ubsan", "amd_tsan", "amd_msan", "amd_debug"] in ci/jobs/scripts/bugfix_validation.py. An x86-64 clickhouse binary cannot execute on an ARM runner, so the job has to run on FUNC_TESTER_AMD instead of FUNC_TESTER_ARM.
Summary
find_master_buildsfunction (introduced in Test bugfix validation against multiple build types #96868) runsgit log origin/masterinside Docker containers that run as root, but the repository is owned by theubuntuuserassert build_urls, "Could not find master builds in S3"git config --global --add safe.directorybefore the git command, following the existing pattern inbuild_clickhouse.pyandbuild_toolchain.pyVisible in #96351 CI failures:
AssertionError: Could not find master builds in S3AssertionError: Could not find master builds in S3Both caused by:
fatal: detected dubious ownership in repository at '/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse'Supersedes the revert in #97011.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix bugfix validation CI jobs failing due to git ownership check in Docker containers.
🤖 Generated with Claude Code
Note
Medium Risk
Changes CI bugfix validation execution flow (binary selection, repeated runs across build types, and result/status inversion), which could affect pass/fail behavior and runtime of critical validation jobs.
Overview
Bugfix validation CI is updated to download and test against multiple recent master binaries (
amd_asan_ubsan,amd_tsan,amd_msan,amd_debug) by discovering a master commit with a complete artifact set in S3 and iterating runs per build type.Functional and integration bugfix validation now labels results per build type, performs fatal-log checks per iteration, cleans logs between iterations (new
ClickHouseProc.clean_logs), and exits early on the first failing build type to preserve diagnostics.Result handling is hardened so bugfix validation does not invert statuses when
ERROR/infrastructure conditions are present (including filtering syntheticTimeoutresults), and workflow hook data collection now storesmaster_commitsfor the upstream repo to support the S3 lookup.Reviewed by Cursor Bugbot for commit 66b69f5. Bugbot is set up for automated code reviews on this repo. Configure here.
Version info
26.6.1.765