Revert "Migrate to shared claude-code-review.yml reusable workflow" - #51
Conversation
This reverts commit 6b2257e.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @jnasbyupgrade's task in 4m 44s —— View job Code review — PR #51 (revert of shared
|
| json=$(gh api "repos/$REPO/commits/$SHA/check-runs" --paginate \ | ||
| --jq '[.check_runs[] | select(.name != "claude-review")]' 2>/dev/null) || json='' | ||
| [ -z "$json" ] && { sleep 20; continue; } | ||
| total=$(jq 'length' <<<"$json") | ||
| if [ "$total" -eq 0 ]; then | ||
| [ "$i" -ge 9 ] && { decision=run; break; } # ~3 min grace: nothing to gate on | ||
| sleep 20; continue | ||
| fi | ||
| pending=$(jq '[.[]|select(.status!="completed")]|length' <<<"$json") |
There was a problem hiding this comment.
gh api --paginate --jq concatenates per-page output instead of merging arrays, breaking the numeric checks once sibling check-runs span more than one page.
gh api --paginate --jq '[...]' applies the --jq filter to each page separately and prints the results one after another — it does not merge them into a single JSON array first. GitHub's check-runs endpoint defaults to 30 items per page.
This repo's ci.yml alone already produces on the order of ~19-20 sibling check-runs (lint, release-safety, changes, the 6-leg test matrix, the 3-leg pg-upgrade-test matrix, the 6-leg pg-tle-test matrix, all-checks-passed), plus whatever claude.yml contributes. That's under 30 today, but it's a boundary the script never guards: the very next PG-version addition to both the test and pg-tle-test matrices (both comments in ci.yml note PG 18 support is anticipated) pushes the sibling-check count past 30.
Once that happens, $json becomes two concatenated JSON array literals (e.g. [...][...]), and jq 'length' <<<"$json" emits multiple newline-separated numbers instead of one. total=$(...) then holds a multi-line string, so [ "$total" -eq 0 ] fails with "integer expression expected", silently takes the false branch, and the same problem recurs for pending/bad — corrupting the gate decision (e.g. permanently deciding skip, disabling the paid review with no visible error) instead of counting all pages.
Fix: slurp all pages into one array, e.g. gh api ... --paginate --slurp --jq '[.[].check_runs[]|select(...)] ' (or post-process with jq -s 'add'), so pagination doesn't change the shape of $json.
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| claude-review: |
There was a problem hiding this comment.
Reverting to this hand-maintained copy reintroduces the exact maintenance-drift risk the migration it undoes was meant to eliminate.
The commit this PR reverts (Migrate to shared claude-code-review.yml reusable workflow) explicitly called out the cost of the per-repo copy this restores: "a future fix lands here without a manual copy" (i.e., without the migration, any subsequent fix to Postgres-Extensions/ai's shared workflow — bug fixes, the labeled/claude-debug on-demand trigger, security hardening — has to be re-applied by hand to every consuming repo, including this one, or it silently drifts out of sync). If this revert is meant to be permanent rather than a temporary rollback while investigating a regression in the shared workflow, it's worth tracking that the fix should eventually be pushed back to ai/ and this repo re-migrated, rather than leaving the fork in place indefinitely.
Reverts #50