Skip to content

CI: fix the LLVM coverage baseline lookup and report links after the S3 prefix change - #117718

Merged
Algunenano merged 3 commits into
ClickHouse:masterfrom
Algunenano:llvm-coverage-workflow-prefix
Sep 3, 2026
Merged

Algunenano merged 3 commits into
ClickHouse:masterfrom
Algunenano:llvm-coverage-workflow-prefix

Conversation

@Algunenano

@Algunenano Algunenano commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

LLVM Coverage errors on every pull request: Generate LLVM Coverage Diff Report ends with ERROR: Could not find baseline coverage file after checking 100 commits, and Print Uncovered Code then fails because the diff never ran.

generate_diff_coverage_report.sh hand-spells the baseline key as REFs/master/<sha>/llvm_coverage/llvm_coverage.info, and llvm_coverage_job.py hand-spells the links to its own uploads as PRs/<pr>/<sha>/... / REFs/<branch>/<sha>/.... Praktika builds both with _Environment.get_s3_prefix_static, which now appends the normalized workflow name unconditionally after _should_include_workflow_name_in_s3_prefix was deleted in #110081 (merged 2026-08-31). The baseline lives under masterci/, the job's own artifacts under pr/.

So the report links are dead too, silently: on https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116552&sha=d5fa6652f262ce060c04c2206ec141660a43d597&name_0=PR&name_1=LLVM%20Coverage the published .../PRs/116552/<sha>/llvm_coverage/generate_llvm_coverage_report/index.html is a 403 while the same path with the pr/ segment is a 200. Those links go into the coverage comment and the CI DB row.

The job now asks praktika for both prefixes. It also builds one baseline URL per candidate commit and hands the list to the script alongside the commits, so the script spells no S3 key of its own and follows a later layout change for free; it walks the two arrays by index and refuses to start if their lengths disagree.

Validation, calling the real function against the live 100-commit window: the baseline resolves for 0 commits under the old key and for 45 under the new one, first at depth 10. Driving the rewritten bash loop over the same window with the real wget --spider finds it at that depth.

The second commit takes the remaining hand-spelled sites in the same family. ci/docker/binary-builder/Dockerfile and update_toolchain_dockerfile.py address the PGO+BOLT toolchain as REFs/master/<sha>/build_toolchain_pgo_bolt_*, which an OptimizeToolchain run now publishes under optimizetoolchain/. Nothing is broken today only because the pinned TOOLCHAIN_COMMIT predates the cutover and still resolves under the bare key, so rewriting the path in place would break every binary build; the location is pinned as a whole in a new TOOLCHAIN_S3_DIR next to the commit, today's value unchanged, and the update job rewrites both lines from the prefix praktika reports. It now refuses to write a Dockerfile carrying no TOOLCHAIN_S3_DIR rather than bumping the commit alone. CLICKHOUSE_PROFILES_COMMIT defaults to none and nothing in the tree pins a value, so that URL takes the OptimizeClickHouse segment directly.

Checked and deliberately left alone: job_hooks/promql_compliance_s3.py writes its baseline with the same hand-spelled key it reads, owning both sides, so the cutover does not affect it. The performance comparison has the same bug and is fixed separately in #117715.

Caused by: #110081
Related: #117715
Related: #117701
Related: #117580

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):

Fix LLVM Coverage failing to find its master baseline, and its dead report links, after the CI S3 prefix change.


Workflow [PR]
Sync PR [sync-upstream/pr/117718]

Version info

  • Merged into: 26.9.1.584 (included in 26.9 and later)

…orkflow prefix

generate_diff_coverage_report.sh looked for the master baseline at
REFs/master/<sha>/llvm_coverage/llvm_coverage.info, and
llvm_coverage_job.py built links to its own artifacts as
PRs/<pr>/<sha>/... . Praktika now appends the normalized workflow name to
every static S3 prefix, so both keys are wrong: the baseline lives under
masterci/ and the job's own artifacts under pr/.

The diff report therefore fails with "Could not find baseline coverage
file after checking 100 commits", and the coverage report links it does
publish are dead.

The job asks praktika for both prefixes and hands the script a
ready-made URL per candidate commit, so the script spells no S3 key of
its own.

Verified against the live window: the baseline resolves for none of the
last 100 master commits under the old key and for 45 under the new one,
first at depth 10.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ce75b7e]


AI Review

Summary

This PR correctly switches the LLVM coverage baseline lookup and published report links over to Praktika's workflow-aware S3 prefixes. The remaining risk is on the Dockerfile side: the new pinning keeps today's baked-in toolchain path working, but it still leaves the manual toolchain/profile override surfaces inconsistent across the 2026-08-31 prefix cutover.

Findings

⚠️ Majors

  • [ci/docker/binary-builder/Dockerfile:52] TOOLCHAIN_COMMIT no longer works as a standalone override for post-cutover toolchain artifacts. Docker re-evaluates ARG TOOLCHAIN_S3_DIR=REFs/master/${TOOLCHAIN_COMMIT} from the caller-provided TOOLCHAIN_COMMIT, so overriding only the commit still generates the old bare REFs/master/<sha> path and the curl at line 59 fails for every OptimizeToolchain artifact published after 2026-08-31. Suggested fix: pin the current legacy directory literally in TOOLCHAIN_S3_DIR and either document that callers must override both args or preserve a one-arg override path for newer toolchains.
  • [ci/docker/binary-builder/Dockerfile:76] [dismissed by author -- https://github.com/CI: fix the LLVM coverage baseline lookup and report links after the S3 prefix change #117718#discussion_r3916190306] CLICKHOUSE_PROFILES_COMMIT is still exposed as "set this to a master commit SHA", but the hard-coded optimizeclickhouse/ segment only resolves profile collections published after 2026-08-31. Older profile commits now silently fall back to Profile ... not available, so a caller asking for a specific historical profile set gets an unoptimized binary instead of the requested inputs. Suggested fix: carry the full profile S3 directory separately, as with TOOLCHAIN_S3_DIR, or narrow the documented contract to post-cutover SHAs only.
Final Verdict

Changes requested.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 2, 2026
The binary-builder Dockerfile and update_toolchain_dockerfile.py spell
the toolchain artifacts as REFs/master/<sha>/build_toolchain_pgo_bolt_*.
Praktika now appends the normalized workflow name, so an OptimizeToolchain
run publishes under REFs/master/<sha>/optimizetoolchain/ and the next
toolchain bump would point every binary build at a 404.

The currently pinned commit predates the change and still resolves under
the bare key, so the location cannot simply be rewritten. Pin it as a
whole in TOOLCHAIN_S3_DIR next to TOOLCHAIN_COMMIT: today's value keeps
addressing today's artifacts, and the update job rewrites both lines from
the prefix praktika reports for the publishing workflow. The job refuses
to write a Dockerfile that carries no TOOLCHAIN_S3_DIR rather than
updating the commit alone.

CLICKHOUSE_PROFILES_COMMIT defaults to "none" and nothing in the tree
pins a value, so its URL takes the OptimizeClickHouse segment directly.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
mkdir -p /opt/clickhouse-profiles && \
for profile in clickhouse-pgo.profdata.zst clickhouse-bolt.fdata.zst; do \
url="https://clickhouse-builds.s3.amazonaws.com/REFs/master/${CLICKHOUSE_PROFILES_COMMIT}/collect_clickhouse_profiles_pgo_bolt_${tarch}/${profile}" && \
url="https://clickhouse-builds.s3.amazonaws.com/REFs/master/${CLICKHOUSE_PROFILES_COMMIT}/optimizeclickhouse/collect_clickhouse_profiles_pgo_bolt_${tarch}/${profile}" && \

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.

CLICKHOUSE_PROFILES_COMMIT is still exposed as "set this to a master commit SHA", but this hard-coded optimizeclickhouse/ segment only resolves profile collections published after the 2026-08-31 prefix cutover. Older collected profiles now 404 and the build quietly falls back to Profile ... not available, so a caller asking for a specific historical profile set gets an unoptimized binary instead of the requested inputs. Could we carry the full S3 directory as a separate ARG here, like TOOLCHAIN_S3_DIR, so both vintages remain addressable?

Keep the caller-provided baseline coverage URLs; master hardcoded the same
MasterCI prefix inline.
# S3 directory of that commit's artifacts. Praktika owns the prefix layout and
# has changed it, so the location is pinned next to the commit instead of being
# spelled from it; update_toolchain_dockerfile.py rewrites both lines together.
ARG TOOLCHAIN_S3_DIR=REFs/master/${TOOLCHAIN_COMMIT}

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.

TOOLCHAIN_COMMIT no longer works as a standalone override after this change. Docker re-evaluates later ARG defaults from caller-supplied earlier args, so docker build --build-arg TOOLCHAIN_COMMIT=<post-cutover-sha> also rewrites TOOLCHAIN_S3_DIR to REFs/master/<sha> and drops the required optimizetoolchain/ segment. The curl below then 404s for every newer toolchain artifact even though the Dockerfile still exposes TOOLCHAIN_COMMIT as the override surface.

Could we either pin the current legacy directory literally here and document that callers must override both args, or otherwise preserve the one-arg TOOLCHAIN_COMMIT contract for post-cutover toolchains?

@Algunenano
Algunenano added this pull request to the merge queue Sep 3, 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.

3 participants