mirror of
https://github.com/hanzoai/datastore.git
synced 2026-10-30 14:48:37 +00:00
Addresses the AI Review findings on PR #108767 (https://github.com/ClickHouse/ClickHouse/pull/108767): 1. Classify checks by `gh pr checks`' own `bucket` field (`pass` / `fail` / `pending` / `skipping` / `cancel`) instead of a narrow raw-`state` allow-list. The old code only recognized `SUCCESS` / `FAILURE` / `PENDING` / `IN_PROGRESS` / `ABSENT` for the `CH Inc sync` check, so a sync in a state like `QUEUED`, `CANCELLED`, `TIMED_OUT`, `STARTUP_FAILURE`, or `SKIPPED` matched nothing and the PR was silently dropped from the report. `classify.sh` now emits a normalized `GREEN` / `FAILED` / `INPROG` / `NOSYNC` label and the downstream `awk`/`case` were updated to match. 2. Fail loudly on a real `gh` error instead of silently dropping the row. With `--json`, `gh pr checks` exits 0 and prints a JSON array whenever it could read the checks (even failing/pending ones), so a non-zero exit means either "no checks reported" (legitimate, kept as `NO_CHECKS` and excluded) or a genuine API / auth / rate-limit failure. The helpers now distinguish the two: on a genuine failure they print the original `gh` diagnostic and `exit 255`, which stops `xargs` and makes `set -e` abort the run. The `2>/dev/null` on the `xargs` lines was removed so the diagnostic is visible. `approval.sh` got the same treatment. 3. Pin `--repo ClickHouse/ClickHouse` on every PR-scoped `gh` call. The report already hardcodes `ClickHouse/ClickHouse` URLs, so the data source must match them; pinning makes the skill correct regardless of the directory it is run from. Adds `test.sh`, which runs `report.sh` against a stubbed `gh` (no network) and covers the `bucket`->label mapping (including `QUEUED`->`INPROG`, `CANCELLED`->`FAILED`, `SKIPPED`->`NOSYNC`), exclusion of PRs with a non-sync failing check, empty input, `--repo` pinning, the `no checks reported` case, and the fail-loud-on-real-error behaviour. This is developer tooling under `.claude/skills/` only; it changes no product code. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>