Repository navigation
Skip LLVM coverage tests-only PRs - #111808
Conversation
…merge job `should_skip_job` already skipped the `LLVM_COVERAGE` merge job when a PR had no build-digest-affecting changes, but the `amd_llvm_coverage` test-shard batches and the coverage build still ran - burning CI time producing profdata that the (already-skipped) merge job would never consume. #109668 made this worse by also skipping only some batches within those jobs based on a per-batch hash-bucket check, so a tests-only PR ended up with an inconsistent mix of some batches running and others skipped. Extend the existing `ci-no-coverage` label condition (which already skips the build, all `amd_llvm_coverage` shards, `excluded_from_llvm` jobs, and the merge job together) to also fire automatically whenever the PR has no build-digest changes. This makes the skip consistent (the whole family or none of it) and removes the now-dead single-test-type sub-job skip block and the standalone merge-job-only skip, both superseded by the broader check. Also drop the `is_llvm_coverage` batch-skip in `functional_tests.py` / `integration_test_job.py` back to excluded, since coverage jobs are now filtered out entirely at config time before any batch is scheduled - the in-job per-batch skip is unreachable for them and only added maintenance surface. PRs touching production code are unaffected: `_has_build_digest_changes` returns True for them, so the coverage family runs exactly as before - degradation check, LBC cross-validation, and master's own baseline publication are untouched.
|
Workflow [PR], commit [cbbae68] Summary: ✅ AI ReviewSummaryThis PR skips the LLVM coverage family for tests-only PRs, removes the now-dead newly-covered-code path, and tries to keep coverage-pipeline-only changes runnable by broadening the coverage-path allowlists and Findings
Final Verdict
|
_has_build_digest_changes only tracks whether the compiled binary can change, so a PR editing ci/jobs/llvm_coverage_job.py, this hook, ci/defs/job_configs.py, tests/clickhouse-test, tests/config/, or the coverage-relevant parts of functional_tests.py/integration_test_job.py still counted as "no build-affecting changes" and got the whole coverage family auto-skipped - so such a PR could never exercise the jobs it just modified. Add _has_coverage_pipeline_changes, checked alongside _has_build_digest_changes, to keep the coverage family running whenever a changed file could alter the pipeline's own behavior.
Now that the whole coverage family auto-skips for tests-only PRs
(filter_job.py's ci-no-coverage-style check), the merge job this feature
lived in never runs for the population it was built for - it's unreachable
by default. Fully remove it rather than leave dead code behind:
- Delete ci/jobs/scripts/print_newly_covered_code.py.
- llvm_coverage_job.py: drop the changed-path classification
(_changed_paths/_is_test_path/_is_non_binary_path/_tests_changed/
_binary_unchanged), the extra-master-baseline downloader
(_download_extra_baselines and its constants), the newly-covered analysis
block, and the stable-union override - all exclusively in service of this
feature. _has_coverage_data now just checks _diff_ran/LBC.
- llvm_coverage_hook.py: drop the newly_covered_* comment-body section (the
CIDB payload never carried these fields, so no schema change).
- generate_diff_coverage_report.sh: base_llvm_coverage_{2..6}.info were only
ever downloaded by the function just removed, so the slot-2..6 LBC
extraction loop was already a no-op before this change (confirmed: the
download call ran after this script, and only under _tests_changed/
_binary_unchanged, which is mutually exclusive with the C/C++-source-changed
condition the loop needs). Correct the comments accordingly and drop the
now-unread base_llvm_coverage.sha sidecar write. LBC itself (single-baseline)
is untouched.
- filter_job.py: drop the now-deleted script from _COVERAGE_PIPELINE_PATHS,
and add ci/jobs/scripts/integration_tests_configs.py (LLVM_COVERAGE_SKIP_PREFIXES
decides amd_llvm_coverage vs excluded_from_llvm suite membership there,
per integration_test_job.py:433-462) - a PR touching only that file was
still satisfying both digest checks and auto-skipping the family it needed
to validate.
Nothing has produced these ext keys since LBC was removed in 080b086 (2026-06-28) - print_res.ext.get(..., 0) always returned 0, so the "or _lbc_lines > 0 or _lbc_fns > 0" disjunct in _has_coverage_data never contributed anything. _has_coverage_data is now just _diff_ran.
doesn't drop it independently of filter_job.py filter_job.py's should_skip_job (via _has_coverage_pipeline_changes) is only "phase 1" - a separate, independent filter runs afterward: praktika's _filter_unaffected_jobs (ci/praktika/native_jobs.py) decides per-job whether a job is "affected" by the changed files using that job's own digest_config.include_paths (Job.is_affected_by), regardless of what should_skip_job returned. llvm_coverage_job's digest_config only listed llvm_coverage_job.py itself, so a PR touching merge_llvm_coverage.sh, generate_diff_coverage_report.sh, print_uncovered_code.py, dedup_lcov_instantiations.py, or job_hooks/llvm_coverage_hook.py - all scripts this job actually shells out to - passed should_skip_job (correctly, via the phase-1 fix) but still got filtered out by this second, independent mechanism. Verified with the real job graph: llvm_coverage_job.requires already lists every FT/IT/UT coverage-shard artifact plus the coverage build's artifacts, so marking it affected also rescues the build and all ~22 shard jobs via _filter_unaffected_jobs's dependency propagation - confirmed is_affected_by() now returns True for the previously-missed scripts and False for an unrelated file. excluded_from_llvm jobs are correctly unaffected by these scripts - they run on the plain binary and don't consume anything llvm_coverage_job produces or invokes. Known residual gap, not fixed here: a change to ci/defs/job_configs.py or ci/defs/defs.py that only edits this job's own definition (e.g. its requires/provides) isn't self-detected, since neither file is in this job's own digest. That's a systemic limitation shared by every job in this file, not something specific to coverage.
…ort-circuit too The is_llvm_coverage exclusion restored earlier only covers the amd_llvm_coverage job flavor. amd_binary_excluded_from_llvm is a separate, independently-set flag, so it still hit the "Only non-functional test files changed" early exit - a PR touching functional_tests.py itself (correctly kept schedulable by filter_job.py and the job's shared digest_config) got the stateless excluded_from_llvm job dispatched and then self-skipped before running anything. integration_test_job.py needs no equivalent change: its version of this short-circuit is additionally gated on total_batches > 1, and integration_test_excluded_from_llvm_job is unbatched, so it never enters that block in the first place.
| "ci/jobs/scripts/print_uncovered_code.py", | ||
| "ci/jobs/scripts/dedup_lcov_instantiations.py", | ||
| "ci/jobs/scripts/job_hooks/llvm_coverage_hook.py", | ||
| "ci/jobs/scripts/workflow_hooks/filter_job.py", |
There was a problem hiding this comment.
This list now treats filter_job.py itself as a coverage-pipeline input, but phase 2 never sees that file. On the current tree, changed_files = ['ci/jobs/scripts/workflow_hooks/filter_job.py'] makes should_skip_job('Build (llvm_coverage_build)') and should_skip_job('LLVM Coverage') both return (False, ''), yet _filter_unaffected_jobs still filters all 25 coverage-family jobs because no coverage job digest_config matches this path.
So the new contract is still false for the hook itself: a PR that changes the coverage filter logic still cannot run the coverage jobs it changed unless a coverage digest (or an explicit phase-2 bypass) also covers this file.
should_skip_jobalready skipped theLLVM_COVERAGEmerge job when a PR had no build-digest-affecting changes, but theamd_llvm_coveragetest-shard batches and the coverage build still ran - burning CI time producing profdata that the (already-skipped) merge job would never consume. #109668 made this worse by also skipping only some batches within those jobs based on a per-batch hash-bucket check, so a tests-only PR ended up with an inconsistent mix of some batches running and others skipped.Extend the existing
ci-no-coveragelabel condition (which already skips the build, allamd_llvm_coverageshards,excluded_from_llvmjobs, and the merge job together) to also fire automatically whenever the PR has no build-digest changes. This makes the skip consistent (the whole family or none of it) and removes the now-dead single-test-type sub-job skip block and the standalone merge-job-only skip, both superseded by the broader check.Also drop the
is_llvm_coveragebatch-skip infunctional_tests.py/integration_test_job.pyback to excluded, since coverage jobs are now filtered out entirely at config time before any batch is scheduled - the in-job per-batch skip is unreachable for them and only added maintenance surface.PRs touching production code are unaffected:
_has_build_digest_changesreturns True for them, so the coverage family runs exactly as before - degradation check, LBC cross-validation, and master's own baseline publication are untouched.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Version info
26.8.1.218(included in26.8and later)