Repository navigation
Add test: StorageEmbeddedRocksDB::optimize PARTITION/FINAL/DEDUPLICATE/CLEANUP rejection branches untested - #104204
Conversation
|
Workflow [PR], commit [4e0497e] Summary: ✅ AI ReviewSummaryThis PR adds a new stateless RocksDB test that verifies ClickHouse Rules
Final Verdict
|
|
@groeneai, check why "Code review" has failed. Likely, we need to add retries in some of the GitHub-related commands inside it. Send a PR. |
|
This automated ClickGap comment is withdrawn — it surfaced internal tooling detail or was posted incompletely, and isn't actionable as written. Please disregard. (ClickGap's output guard now prevents this.) |
1 similar comment
|
This automated ClickGap comment is withdrawn — it surfaced internal tooling detail or was posted incompletely, and isn't actionable as written. Please disregard. (ClickGap's output guard now prevents this.) |
|
@alexey-milovidov — investigated. The "Code Review" failure on this PR was a Copilot had been running for 1m 9s and reading source files — then the GitHub Fix PR up at #104227 — wraps the gh-auth + copilot subprocess in a 3-attempt Once #104227 lands, this PR's Code Review check should be robust to similar |
c68e7fd
The Code Review job's Copilot CLI subprocess occasionally hits transient
GitHub authorization errors mid-run, e.g.
[10:08:14] Authorization error, you may need to run /login (Request ID: F924:13DD23:...)
[10:08:14] ERROR: command failed after 1/1 attempt(s), exit code: 1
[10:08:14] ERROR: Copilot did not write ./ci/tmp/copilot_review.md
RuntimeError: Copilot did not write ./ci/tmp/copilot_review.md
(seen on PR ClickHouse#104204 attempt 2 of run 25428876194; attempt 3 of the same
run completed cleanly.) Without retries, a single transient blip from the
GitHub auth path inside Copilot is enough to mark "Code Review" as `FAIL`
and post `Mergeable Check: Failed: Code Review, Dropped: 71`.
Two fixes:
1. `ci/jobs/copilot_review_job.py`: wrap the gh-auth + copilot subprocess
sequence in a 3-attempt retry loop with exponential backoff. Each
attempt re-fetches the secret, re-runs `gh auth login` against a fresh
`GH_CONFIG_DIR`, and re-invokes Copilot. An attempt counts as success
only if the subprocess exits 0 AND `REVIEW_FILE` is written non-empty
— auth failures inside Copilot don't surface as exceptions, only as
exit code != 0 and a missing review file.
2. `ci/praktika/gh.py`: add `GH.get_output_with_retries(cmd)` helper that
mirrors `do_command_with_retries` but returns stdout. Use it for every
GitHub-API read that previously called bare `Shell.get_output(cmd)`:
`post_pr_comment`, `post_fresh_comment`, `post_updateable_comment`,
`get_pr_contributors`, `get_pr_labels`, `get_pr_title_body_labels`,
`get_pr_label_assigner`, `get_pr_diff`, `pr_has_conflicts`. These
would previously return `""` on transient `gh` failures and either
propagate as `json.loads('')` errors or silently misclassify the PR
(e.g. miss an existing comment and post a duplicate). Same
non-retryable error classes as `do_command_with_retries`
(`Validation Failed`, `Bad credentials`, `Resource not accessible`).
Also harden `post_updateable_comment` against malformed JSON: catch
`json.JSONDecodeError` and treat it as "no existing comments" rather
than crashing the caller.
Reported-by: alexey-milovidov <ClickHouse#104204 (comment)>
Session-ID: cron:clickhouse-ci-task-worker:20260506-131500
Co-Authored-By: Claude Opus 4.7 <[email protected]>
The Code Review job's Copilot CLI subprocess occasionally hits transient
GitHub authorization errors mid-run, e.g.
[10:08:14] Authorization error, you may need to run /login (Request ID: F924:13DD23:...)
[10:08:14] ERROR: command failed after 1/1 attempt(s), exit code: 1
[10:08:14] ERROR: Copilot did not write ./ci/tmp/copilot_review.md
RuntimeError: Copilot did not write ./ci/tmp/copilot_review.md
(seen on PR #104204 attempt 2 of run 25428876194; attempt 3 of the same
run completed cleanly.) Without retries, a single transient blip from the
GitHub auth path inside Copilot is enough to mark "Code Review" as `FAIL`
and post `Mergeable Check: Failed: Code Review, Dropped: 71`.
Two fixes:
1. `ci/jobs/copilot_review_job.py`: wrap the gh-auth + copilot subprocess
sequence in a 3-attempt retry loop with exponential backoff. Each
attempt re-fetches the secret, re-runs `gh auth login` against a fresh
`GH_CONFIG_DIR`, and re-invokes Copilot. An attempt counts as success
only if the subprocess exits 0 AND `REVIEW_FILE` is written non-empty
— auth failures inside Copilot don't surface as exceptions, only as
exit code != 0 and a missing review file.
2. `ci/praktika/gh.py`: add `GH.get_output_with_retries(cmd)` helper that
mirrors `do_command_with_retries` but returns stdout. Use it for every
GitHub-API read that previously called bare `Shell.get_output(cmd)`:
`post_pr_comment`, `post_fresh_comment`, `post_updateable_comment`,
`get_pr_contributors`, `get_pr_labels`, `get_pr_title_body_labels`,
`get_pr_label_assigner`, `get_pr_diff`, `pr_has_conflicts`. These
would previously return `""` on transient `gh` failures and either
propagate as `json.loads('')` errors or silently misclassify the PR
(e.g. miss an existing comment and post a duplicate). Same
non-retryable error classes as `do_command_with_retries`
(`Validation Failed`, `Bad credentials`, `Resource not accessible`).
Also harden `post_updateable_comment` against malformed JSON: catch
`json.JSONDecodeError` and treat it as "no existing comments" rather
than crashing the caller.
Reported-by: alexey-milovidov <#104204 (comment)>
Session-ID: cron:clickhouse-ci-task-worker:20260506-131500
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #101108.
That PR PR fixes a race in
StorageSystemRocksDB::fillData: when queryingsystem.rocksdb, a concurrentDROP TABLEcould leave theEmbeddedRocksDBinstance shut down between the table-listing pass and thegetRocksDBStatisticscall, which then returnednullptrand hit aLOGICAL_ERRORthrow. The f1.
StorageEmbeddedRocksDB::optimizePARTITION/FINAL/DEDUPLICATE/CLEANUP rejection branches untestedsrc/Storages/RocksDB/StorageEmbeddedRocksDB.cpp:429,src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp:432Risk: Call chain: parser builds
ASTOptimizeQuerywithpartition/final/deduplicate/cleanupflags →InterpreterOptimizeQuery::execute→StorageEmbeddedRocksDB::optimize(query, metadata, partition **What's unique vs PR tests:** PR's own test04094_rocksdb_system_table_race.shonly issues plainOPTIMIZE TABLE ... rocksdb_race(no modifiers), so it exercises only the success path throughCompactRangeplus the race-onlyTags:
-- Tags: no-fasttest, use-rocksdb—no-fasttest: EmbeddedRocksDB engine is not built in the fasttest profile (consistent with all existing rocksdb tests, e.g., 02811_invalid_embedded_rocksdb_create.sql, 02892_rocksdb_trivial_count.sql).;use-rocksdb: Test creates anEmbeddedRocksDBtable; the standard tag for rocksdb-dependent tests (matches 01504_rocksdb, 01686_rocksdb, 02910_rocksdb_optimize, 02956_rocksdb_*).Try it on ClickHouse Fiddle
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes
Version info
26.5.1.346