Skip to content

Skip LLVM coverage tests-only PRs - #111808

Merged
alexbakharew merged 6 commits into
masterfrom
abakharew/disable-llvm-for-test-only-prs
Jul 27, 2026
Merged

alexbakharew merged 6 commits into
masterfrom
abakharew/disable-llvm-for-test-only-prs

Conversation

@alexbakharew

@alexbakharew alexbakharew commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Version info

  • Merged into: 26.8.1.218 (included in 26.8 and later)

…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.
@clickhouse-gh

clickhouse-gh Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [cbbae68]

Summary: ✅


AI Review

Summary

This 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 LLVM Coverage digest. The remaining problem is that the phase-1 should_skip_job logic and Praktika's phase-2 changed-files filter are still not aligned, so some coverage-pipeline-only PRs still never exercise the coverage jobs they change. Status: ⚠️ Request changes

Findings

⚠️ Majors

  • [ci/jobs/scripts/workflow_hooks/filter_job.py:117] filter_job.py is now listed as a coverage-pipeline input, but no coverage job digest matches it. With changed_files = ['ci/jobs/scripts/workflow_hooks/filter_job.py'], should_skip_job('Build (llvm_coverage_build)') and should_skip_job('LLVM Coverage') both return (False, ''), and then _filter_unaffected_jobs still filters all 25 coverage-family jobs. The hook still cannot validate its own coverage scheduling changes.

  • [ci/jobs/scripts/workflow_hooks/filter_job.py:104] [dismissed by author -- https://github.com/Skip LLVM coverage tests-only PRs #111808#discussion_r3652188208] _COVERAGE_PIPELINE_PATHS still omits ci/workflows/pull_request.py and ci/jobs/scripts/workflow_hooks/store_data.py. With either file as the only change, both _has_build_digest_changes and _has_coverage_pipeline_changes stay False, so should_skip_job still auto-skips Build (llvm_coverage_build) and LLVM Coverage before the modified coverage DAG / metadata source can run.

  • [ci/jobs/scripts/workflow_hooks/filter_job.py:323] [dismissed by author -- https://github.com/Skip LLVM coverage tests-only PRs #111808#discussion_r3652864452] The phase-2 changed-files filter is still misaligned for ci/defs/job_configs.py and ci/defs/defs.py. The new phase-1 check treats them as coverage-pipeline changes, but no coverage digest matches either file, so _filter_unaffected_jobs still filters all 25 coverage-family jobs for those PRs.

Final Verdict
  • Status: ⚠️ Request changes

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 24, 2026
_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.
Comment thread ci/jobs/functional_tests.py Resolved
…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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alexbakharew
alexbakharew added this pull request to the merge queue Jul 27, 2026
Merged via the queue into master with commit d32c913 Jul 27, 2026
351 of 353 checks passed
@alexbakharew
alexbakharew deleted the abakharew/disable-llvm-for-test-only-prs branch July 27, 2026 16:48
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants