Add CI workflows, /ci skill, and test fixes#22
Open
jnasbyupgrade wants to merge 12 commits into
Open
Conversation
Explains the cross-repo PR workflow, branch naming convention, how the pgxntool CI wait logic works, the no-test-pr label and its write-protection, and what branch protection enforces. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- .github/workflows/ci.yml: test against matching pgxntool branch (falls back to master if no matching branch exists) - CLAUDE.md: warn before touching existing PRs not opened in this session Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
git subtree add refuses to work with shallow clones; fails with "shallow roots are not allowed to be updated" which looks like a remote/ref problem rather than a depth issue. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- gem install asciidoctor instead of apt ruby-asciidoctor: the apt package binary is not on PATH in pgxn-tools containers (diagnosed from base.mk: "Could not find asciidoc or asciidoctor") - Print '=== BRANCHES: ===' line in resolve step so CI logs clearly show which pgxntool branch was selected for the run Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Shell-script-driven skill that monitors GitHub Actions runs across both repos after a push. Key features: - Uses --commit SHA when available to avoid branch-race-condition - Fast log API path for BRANCHES line extraction (~1s vs 3-10s zip) - Parallel monitoring of both repos by default - Per-job pass/fail summary + failure log tail - 10-min timeout for pgxntool (accounts for 5-min test-PR wait) - Prefixes all output with [repo] for readability when interleaved Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The concurrent-make-test.bats test runs two `make test` processes simultaneously to verify database-name isolation. Both processes check $(datadir)/extension/pgtap.control and, finding it absent, both invoke `pgxn install pgtap --sudo` concurrently. Their simultaneous `gmake install` calls race to write files into the shared /usr/share/postgresql/<pg>/extension/ directory, producing: install: cannot create regular file '.../pgtap--X.Y.Z.sql': File exists install: cannot change permissions of '...': No such file or directory The race is most pronounced on older PostgreSQL versions (e.g. PG13) where pgtap's build applies more compat patches, widening the window during which both installs run in parallel. Fix: add a Pre-install pgtap step before `make test`. With pgtap.control already present, both concurrent make processes find the Make target's prerequisite satisfied and skip the install entirely — no race occurs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Script now prints OVERALL: ALL_PASS/FAIL/TIMEOUT as the last line - Exit codes: 0=pass, 1=fail, 2=timeout (distinguishable from failure) - SKILL.md documents the contract with a table so Claude knows exactly what to check without parsing the full output Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- monitor-ci.sh: fix sed delimiter collision when $label contains '/' (sed "s/^/$label /" broke because $label = "[repo/name]"; use '|' delimiter) - monitor-ci.sh: initialize pid_test/pid_pgxn before case statement to prevent "unbound variable" error with set -u when repos=both - SKILL.md: add race condition warning box; clarify BRANCHES line verification as primary safeguard against --branch picking wrong run - CLAUDE.md: replace vague CI monitoring rule with specific SHA + BRANCHES line guidance Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`fail` is not a BATS built-in and is not defined anywhere in the test
helpers. When a test assertion fails and `fail "message"` is called,
bash reports "fail: command not found" (exit 127), which masks the real
failure message entirely.
The correct replacement is `error`, which is defined in test/lib/helpers.bash:
error() { out "ERROR: $*"; return 1; }
8 sites fixed across two files:
- test/standard/concurrent-make-test.bats (7 uses)
- test/standard/make-test.bats (1 use)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README: rewrite CI and Contributing section to reflect new fast check-test-pr behavior, 'commit-with-no-tests' label, clear instructions for "no paired test PR" failures - Remove references to 5-minute wait and old 'no-test-pr' label name Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/ci.yml) — matrix of PG 12–17, resolves paired pgxntool branch by name, pre-installs pgtap to prevent concurrent install race condition/ciskill for monitoring CI runs after every push (shell-driven, BRANCHES line verification, race condition documentation)fail: command not foundin BATS tests — replace undefinedfail()witherror()(8 sites inconcurrent-make-test.batsandmake-test.bats)CLAUDE.mdwith CI monitoring rules and multi-session PR guardNotes
This PR pairs with pgxntool PR #33 (
add-cibranch). The CI in this repo resolves the pgxntool branch by matching the PR branch name — since both are now namedadd-ci, the full cross-repo workflow is exercised.🤖 Generated with Claude Code