Skip to content

Revert "Migrate to shared claude-code-review.yml reusable workflow" - #51

Merged
jnasbyupgrade merged 1 commit into
masterfrom
revert-50-migrate-claude-review-shared-workflow
Sep 17, 2026
Merged

jnasbyupgrade merged 1 commit into
masterfrom
revert-50-migrate-claude-review-shared-workflow

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Reverts #50

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: aec540f0-3f87-4241-bfdf-747955eb0c8d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 4m 44s —— View job


Code review — PR #51 (revert of shared claude-code-review.yml workflow)

  • Gather context (PR diff, CLAUDE.md, related PR Migrate to shared claude-code-review.yml reusable workflow #50)
  • Determine request type: code review (/code-review:code-review ... --comment)
  • Review .github/workflows/claude-code-review.yml across correctness/simplification/efficiency/reuse angles
  • Post inline findings
  • Post summary

This PR is a mechanical, GitHub-generated revert of a single file, .github/workflows/claude-code-review.yml, undoing the migration to a shared reusable workflow (commit 6b2257e) and restoring the prior hand-maintained, per-repo copy. No SQL/extension code is touched, so this repo's schema-independence testing conventions (CLAUDE.md) don't apply.

I reviewed the restored ~170-line file (trigger/concurrency config, the author-gate if:, the CI-gate polling script, checkout step, and the claude-code-action invocation). Two findings survived verification and were posted as inline comments:

  1. .github/workflows/claude-code-review.yml:84-92gh api --paginate --jq '[...]' applies the jq filter per page rather than merging pages first. Once sibling check-runs exceed GitHub's 30-per-page default, $json becomes multiple concatenated JSON arrays, so jq 'length' emits multiple numbers into $total/pending/bad, breaking the -eq integer comparisons and corrupting the cost-gate decision. ci.yml currently produces ~19-20 sibling checks (under the boundary), but its comments anticipate adding a PG 18 leg to two 6-leg matrices, which would cross it.
  2. .github/workflows/claude-code-review.yml:27 (altitude) — the revert reintroduces the per-repo copy-paste maintenance burden that the original migration's commit message cited as the reason to centralize this workflow in Postgres-Extensions/ai; any future fix to the shared workflow now has to be manually re-applied here.

Both findings were confirmed and posted inline via mcp__github_inline_comment__create_inline_comment.

No code changes were made (review only, as requested).

@jnasbyupgrade
jnasbyupgrade merged commit 152d2e3 into master Sep 17, 2026
21 checks passed
Comment on lines +84 to +92
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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant