Repository navigation
Praktika: take the changed files of a push from every commit it added, not only from its head - #128453
Conversation
The merge queue fast-forwards master over up to 5 merges in one push and
MasterCI runs once, for the push head. For a push, praktika read the changed
files of the head commit only (`gh api commits/{sha}`), so a job affected
only by an earlier commit of the same push was filtered as "Not affected by
the changed files and not required", and functional/integration shards
skipped themselves as "Only test files changed". At master c189bd9 (ClickHouse#128277
in `src/` + ClickHouse#128142 tests only) this skipped 95 jobs, including both
`Build (*_release_performance_reference)`, so PR performance runs based on it
fell back to the official build (`long_primary_key` +16% on amd, ClickHouse#127846).
At f760cbb all 32 builds were skipped.
Now a push event records its `before` (`_Environment.PUSH_BEFORE_SHA`), and
`GH.get_changed_file_statuses` walks first parents from the head down to it,
reading all pages of each commit's file list (`gh api --paginate`), and
unions them (the newest commit's status wins). If the files cannot all be
known - an all-zero or malformed `before` (created branch), a failed or
malformed read, a commit at GitHub's 3000-file listing limit, a walk that
does not reach `before` within 50 commits - the result is `None` with a
warning, never a partial list, and it is not cached. `store_data.py` keeps
`None` for push events, so no job is filtered by it (`Job.is_affected_by`);
before, a failed read stored `[]`, which filtered every non-required job.
Without `before` (local runs, the native orchestrator) the head-only read
is unchanged; PR, merge queue, schedule and dispatch are unchanged.
Validated locally against the real GitHub API by replaying the 404 batched
master pushes of October: the result equals the union of every pushed
commit's files (re-parsed independently, commit lists from git) on 402, and
is unknown on the 2 that contain a 3000-file commit (ClickHouse#126194, and the docs
translation ClickHouse#124860); the job filter keeps 14,871 more job-runs on 131
pushes, plus 952 test shards that self-skipped now run in full, ~+7.8% of
October's 203,420 master job-runs, including both reference builds on 106
pushes. 100 single-commit pushes give identical statuses, with one request
for heads of up to 100 files.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings), plus a separate cold review (3 nits, none blocking).
Severity: ❌ blocker / Session id: cron:clickhouse-review-self-slot-58:20261101-054700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-self-slot-57:20261101-051100 |
|
cc @maxknv, could you review this and add the |
|
Workflow [PR], commit [9ad735a] Summary: ✅ AI ReviewSummaryThe PR fixes job selection for batched pushes by collecting changed files across the first-parent push range and preserving unknown results so affected jobs are not silently skipped. No actionable findings at Final VerdictStatus: ✅ Approve. |
def2fdf
Related: #127365
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Performance Comparison (amd_release, master_head, 5/6)on #127846 compared the PR build with the official build (long_primary_key+16%), because MasterCI skipped both performance reference builds at masterc189bd99fb:The merge queue fast-forwards master over up to 5 merges in one push, and MasterCI runs once, for the head. For a push, praktika took the changed files from the head commit only, so a job affected only by an earlier commit of the push was skipped as "Not affected by the changed files". The push
1ee49128..c189bd99is #128277 (src/Common/StringValueFilter.cpp) and #128142 (tests only): 95 jobs were skipped this way, including both reference builds. Atf760cbbb2d(#128371, an analyzer change, and #128365,.claude/only) all 32 builds were skipped.Now the changed files of a push are those of every commit from the head down to the event's
before, reading all pages of each commit's file list. If they cannot all be read (a created branch, a failed read, a commit at GitHub's 3000-file listing limit), they are unknown and no job is filtered. Before, a failed read gave an empty list, which skipped every job that is not required.Validation (local, real GitHub API), replaying the 404 batched master pushes of October: the files are the union of the pushed commits' files; 2 pushes containing a 3000-file commit (#126194 and the docs translation #124860) run everything. MasterCI would run about 15,800 more jobs, +7.8% of October's master job runs, including both reference builds on 106 pushes. 100 single-commit pushes give the same files, with one request for heads of up to 100 files.
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/128453]
Version info
26.11.1.1045-master(included in26.11and later)