Skip to content

Resolve the master clickhouse-examples binary under its workflow prefix - #117701

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/parser-memory-check-master-prefix
Sep 2, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/parser-memory-check-master-prefix

Conversation

@groeneai

@groeneai groeneai commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

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 Parser memory check erroring on every pull request because it looked for the master clickhouse-examples build artifact under its pre-cutover S3 key.

Description

Parser memory check errors in its Resolve master binary step before running anything, with No master `clickhouse-examples` artifact was found. The first error started 2026-09-02 10:14:18Z; 58 runs across 57 pull requests had errored by 13:41:07Z. The job sets no allow_failure, so it blocks Mergeable Check.

get_merge_base_profiler_url hand-spelled the artifact key as REFs/master/<sha>/build_arm_release/clickhouse-examples. Praktika builds that key 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). That helper suppressed the segment for exactly the pr/main/master flows, which is why the hand-spelled key used to be correct. The artifact now lives at REFs/master/<sha>/masterci/build_arm_release/clickhouse-examples, matching the link Build (arm_release) records in its own MasterCI report.

The loop returns the first sha in master_track_commits_sha that resolves, and that window is 100 first-parent master commits, currently 1.99 days, its oldest already newer than the cutover. That is why the break arrived two days after that merge, why a run configured earlier can still be green, and why a legacy fallback would rescue nothing.

So I ask praktika for the prefix instead of restating it; a later prefix change then follows automatically. Merged sibling #117580 spells the segment by hand in bugfix_validation; say the word and I will match it in one line.

Validation, calling the real function against the live window: 0 of 100 shas resolve before the change, 54 after, first at depth 7. A master sha with no published build resolves on neither path. The job runs from this pull request's own tree, so it is its own end-to-end test.

Not fixed here: the same layout in performance_tests.py, llvm_coverage_job.py, update_toolchain_dockerfile.py, generate_diff_coverage_report.sh, binary-builder/Dockerfile, retry_infra_failures.yml, and ci/CLAUDE.md. Each reads a different workflow, so each needs its own segment.

No related open issue found.

Reported by @ bacek at #116552 (comment)
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116552&sha=d5fa6652f262ce060c04c2206ec141660a43d597&name_0=PR&name_1=Parser%20memory%20check

Related: #116552


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

…efix

`Parser memory check` errored in its `Resolve master binary` step on every pull
request from 2026-09-02 10:14:18Z with `No master binary found in 100 tracked
commits`. `main` returns early there, so the check produced no signal at all, and
because the job sets no `allow_failure` the error counted toward `Mergeable Check`.
The last green run started 10:30:22Z; 49 erroring runs across 48 distinct pull
requests followed by 13:03:42Z.

`get_merge_base_profiler_url` hand-spelled the artifact key as
`REFs/master/<sha>/build_arm_release/clickhouse-examples`. Praktika uploads job
artifacts to `<env.get_s3_prefix()>/<normalized job name>`, and
`_Environment.get_s3_prefix_static` now appends the normalized workflow name
unconditionally after `_should_include_workflow_name_in_s3_prefix` was deleted in
ClickHouse#110081 (merged 2026-08-31T08:54:37Z). That helper returned
`not workflow_name.startswith(("pr", "main", "master"))`, so it suppressed the
segment for exactly the flows this job reads, which is why the hand-spelled key was
correct before and is a permanent miss now. The artifact lives at
`REFs/master/<sha>/masterci/build_arm_release/clickhouse-examples`, which is also
the link `Build (arm_release)` records for itself in that workflow's own
`result_masterci.json` report.

The break arrived about two days after that merge because the loop returns the first
sha in `master_track_commits_sha` that resolves, and `store_data.py` fills that key
with 100 first-parent commits of the master parent of the merge commit praktika
builds. That window currently spans 1.99 days, so it had to slide entirely past the
cutover before the loop could exhaust. It is also why every open pull request broke
at one instant rather than one at a time, and why a legacy fallback would rescue
nothing.

Asking praktika for the prefix removes the duplicated layout knowledge that caused
this, so a later move follows automatically and a signature change fails loudly
instead of returning 403 for 100 shas.

Validated by calling the real function against the live 100-sha window with
`master_track_commits_sha` stubbed: before the change it printed the reported message
and returned an empty string, with the old key resolving for 0 of 100 shas; after it
resolves at depth 7, with the new key resolving for 54 of 100. A master sha whose
build has not published yet resolves on neither key, so the probe still
discriminates.

Reported by @ bacek at
ClickHouse#116552 (comment)
Failing job: https://github.com/ClickHouse/ClickHouse/actions/runs/33612463648/job/100219799384
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116552&sha=d5fa6652f262ce060c04c2206ec141660a43d597&name_0=PR&name_1=Parser%20memory%20check
Pull request: ClickHouse#116552

Related: ClickHouse#110081

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Sep 2, 2026
@groeneai

groeneai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings), plus my own cold
review of the resulting code, which found nothing in the diff and four things in the text I was
about to publish. The diff below is unchanged by review: +5/-1 in one file.

# Sev Finding Verdict Evidence / action
1 ⚠️ The description claimed the last green run started 10:30:22Z and that every pull request errored from 10:14:18Z AGREE, rewritten before publication Refuted by CI DB: a green run started 13:18:26Z on a tree committed 2026-09-01T18:06:51Z, whose tracked window was configured before the cutover. The description now gives the first error time, an as-of-bounded count, and the reason an earlier-configured run can still pass
2 ⚠️ The description named the reporter but did not link the requesting comment AGREE, added Provenance is now the exact comment link
3 💡 The quoted log line dropped the backticks the real message carries AGREE, fixed parser_memory_check.py:1171
4 💡 "a later move then follows automatically" overstated the change AGREE, narrowed to the prefix Only the prefix is derived; the job segment and file name are still spelled out
5 💡 The commit message carries the same imprecise wording as finding 1 AGREE, left as is Its counts are as-of bounded and were accurate when measured, and its mechanism is correct. AGENTS.md forbids amend and rebase on a branch, and a later commit cannot rewrite an earlier message, so the corrected wording lives in the description
6 💡 ci/CLAUDE.md says never to build an artifact URL by hand, and this still builds one DISAGREE That rule's stated reason is the extra row-name prefix on sub-result files; clickhouse-examples is a job-level artifact uploaded at <prefix>/<normalized job name> (runner.py:925), so the hazard does not apply. Following links would mean parsing a 1 MB report per sha for up to 100 shas instead of one HEAD, and merged sibling #117580 spells the same key by hand. The prefix, the half that broke, is now derived

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding.

Session id: cron:clickhouse-review-slot-8:20260902-133600

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Sep 2, 2026
@clickhouse-gh clickhouse-gh Bot closed this Sep 2, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 2, 2026
@groeneai

groeneai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Calling get_merge_base_profiler_url from the pre-change source with master_track_commits_sha stubbed to the live 100-sha window prints No master binary found in 100 tracked commits and returns an empty string, every run. Independently, the job's own oracle curl -sfI '<pre-change url>' exits non-zero for all 100 tracked shas.
b Root cause explained? Yes. #110081 (merged 2026-08-31) deleted _should_include_workflow_name_in_s3_prefix, which had suppressed the workflow segment for the pr/main/master flows, so praktika now writes artifacts one segment deeper. The hand-spelled key at ci/jobs/parser_memory_check.py:73 became a permanent miss. It surfaced two days later because the tracked window is 100 first-parent master commits, currently 1.99 days, and it had to slide entirely past the cutover before the loop could exhaust.
c Fix matches root cause? Yes. The defect is duplicated layout knowledge, so the fix deletes the duplicate by asking _Environment.get_s3_prefix_static for the prefix, which is the helper the writer path itself uses. No widened bound, no fallback, no retry, no suppressed error.
d Test intent preserved / new tests added? Preserved: the loop still walks the window, the error path is untouched, and a master sha with no published build still resolves on neither layout. No in-tree test added, deliberately: the only pytest file under ci/ is wired into no praktika job or style check, and the repository guidance says a throwaway CI-script test does not need to be committed. This pull request is its own end-to-end test, because Parser memory check runs from its own tree.
e Both directions demonstrated? Yes. Same process, same stubbed window: pre-change returns an empty string with 0 of 100 shas resolving; post-change returns the artifact URL, resolving at depth 7 with 54 of 100 shas resolvable.
f Fix is general across code paths? Yes within scope. Fixed inside the function every consumer goes through, not at a call site, and no hand-spelled S3 path remains in the file. The same layout is hand-spelled in performance_tests.py, llvm_coverage_job.py, update_toolchain_dockerfile.py, generate_diff_coverage_report.sh, binary-builder/Dockerfile and retry_infra_failures.yml; each reads a different workflow, so each needs its own segment and is disclosed in the description rather than guessed at here.
g Fix generalizes across inputs? Yes. The only input is a 40-hex sha, already validated by re.fullmatch upstream. Covered by measurement: a sha with a build (resolves), a sha without one (fails on both layouts), 46 of 100 unbuilt shas skipped, an absent master_track_commits_sha (empty list, same error path as before), and a non-hex entry (skipped, unchanged). No type wrappers apply: the helper takes plain integers and strings.
h Backward compatible? Yes, and nearly vacuously so. No user-visible behaviour, no setting, no default, no serialization format and no change under src/, so no SettingsChangesHistory.cpp entry applies. The job exists only in the pull-request workflow, so no release branch is affected.
i Invariants and contracts preserved? Yes. get_merge_base_profiler_url keeps its contract of returning a resolvable URL or an empty string; the caller's early-return path is untouched; download_master_binary still receives exactly the URL the probe accepted. get_s3_prefix_static is a pure classmethod whose only preconditions are a positive pull-request number or a branch, and a sha or latest, both satisfied here, and I pass keyword arguments so a positional reorder cannot pass silently. No locks, no shared state, nothing left behind on the error path.

Session id: cron:clickhouse-impl-slot-4:20260902-130001

@clickhouse-gh

clickhouse-gh Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [46ecfcc]

Summary: ✅


AI Review

Summary

This PR fixes Parser memory check's lookup of the master clickhouse-examples artifact by deriving the S3 prefix from _Environment.get_s3_prefix_static instead of hardcoding the pre-cutover REFs/master/<sha>/... layout. I did not find a remaining contract violation in the changed code: the new path matches Praktika's current artifact upload layout, the ARM job/build pairing is still consistent, and there are no prior review threads that need follow-up.

Final Verdict
  • Status: ✅ Approve

@groeneai

groeneai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

cc @qoega, could you review this? Parser memory check has been erroring in its Resolve master binary step on every open pull request since 2026-09-02 10:14:18Z, because it probes the pre-cutover artifact key. It now derives the master prefix from _Environment.get_s3_prefix_static instead of hand-spelling REFs/master/<sha>/build_arm_release/..., so it reads the masterci segment praktika started appending in #110081.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai manual approve Manual approve required to run CI 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.

5 participants