Skip to content

Commit 3f798c5

Browse files
committed
Squashed 'pgxntool/' changes from bed3604..b67064b
b67064b Release 2.2.0 (#77) d949d6d Fix stale README/CLAUDE.md docs; rename internal-only test shim (#76) 6d7822c ci: grant actions:write so bun cache save succeeds (#75) 2738f59 README.asc: fix stale docs, document undocumented API surface (#74) d1d3bee Add make pgxntool-version to print the embedded pgxntool version (#73) 493a0f8 Fix parallel-build SQL corruption, remote hardcoding, and add safety checks (#61) 3b0e3de Fix make pgtle PGTLE_VERSION=X being silently ignored (#66) 21b35ef ci: skip paired-test-PR requirement for doc-only PRs (#71) 55efd03 Rename EXTENSION_VERSION_FILES to EXTENSION__CURRENT_VERSION__FILES (#69) 9d0a856 Fix pgtle.sh rejecting non-numeric version aliases like 'stable' (#57) (#63) 9c2f75f Docs: versioned SQL file tracking tradeoffs and update-testing pattern (#60) c38cf2a ci: never check out fork PR head in claude-code-review pull_request_target job (#70) aab8f2b pgtle_versions.md: fix wrong uninstall_extension() version claim (#59) e2c9174 README.asc: make tag creates a git tag, not a branch (#58) eb84bc6 Stamp 2.1.0 9fbe6f4 Fix results ordering, control file whitespace, ENABLE_* override, debug levels (Postgres-Extensions#31) 88bb4f2 Add Claude Code GitHub Actions workflows (Postgres-Extensions#41) af5bbbb ci: pass repo owners to run-tests.yml for fork-account matching (Postgres-Extensions#40) c7928af Fix repo-root guard to work inside a git worktree (Postgres-Extensions#39) b062fca ci: point reusable test workflow at @master b6cdbfd Add CI workflows and multi-session PR guard (Postgres-Extensions#33) 1ba0987 Stamp 2.0.3 1931cbe Fix pgxntool-sync remote and make it runnable without make (Postgres-Extensions#37) 8176304 Stamp 2.0.2 3e142ab Fix parse_control_file: remove comments before stripping quotes (Postgres-Extensions#27) cacc301 Stamp 2.0.1 bf1db6b Fix bash 3.2 / Linux compatibility issues (Postgres-Extensions#26) 62d0fcb Fix broken ifeq for --load-language=plpgsql on PG < 13 (Postgres-Extensions#24) 121f0b3 Stamp 2.0.0 ad3ca7e Remove .source support; add test/install, test/build, and verify-results (Postgres-Extensions#18) c010cf8 Fix bash 3.2 compatibility (Postgres-Extensions#23) abeb9d3 Remove .source file support from pg_regress integration (Postgres-Extensions#22) 08c1879 Stamp 1.1.2 6e0dad2 Fix double --dbname bug that defeated unique test database names 639756c Stamp 1.1.1 6ba3176 Fix pg_tle exception handler and empty upgrade files (Postgres-Extensions#15) 3b8cb2a Stamp 1.1.0 550a901 Remove commit.md (maintained in pgxntool-test) d73ca93 Add unique test database names to prevent conflicts (Postgres-Extensions#13) 9b344be Add update-setup-files.sh for 3-way merging after pgxntool-sync (Postgres-Extensions#12) ab7f6e2 Stamp 1.0.0 3a571ba Add pg_tle support and modernize test infrastructure (Postgres-Extensions#11) b96ea6d Add support for Claude code; build and doc improvements (Postgres-Extensions#9) e9c24de Fix pg_regress on versions > 12 (Postgres-Extensions#5) REVERT: bed3604 Fix pg_regress on versions > 12 (Postgres-Extensions#5) (Postgres-Extensions#6) git-subtree-dir: pgxntool git-subtree-split: b67064b16ca2eb30761c078511dc8c974938480f
1 parent b59de00 commit 3f798c5

29 files changed

Lines changed: 5455 additions & 449 deletions

.claude/CLAUDE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Claude Development Notes
2+
3+
This file contains guidance for Claude Code when working in this repository.
4+
It is excluded from distributions via `.gitattributes export-ignore`.
5+
6+
## CI Monitoring After Every Push
7+
8+
**REQUIRED**: After every `git push`, immediately start a background task to
9+
monitor the CI run for that push. If you pushed to both pgxntool and
10+
pgxntool-test, start a background task for each repo — do not monitor them
11+
sequentially.
12+
13+
Use `gh run watch` or poll with `gh run list` / `gh pr checks` in the
14+
background task. Report failures to the user as soon as they are detected;
15+
do not wait for all jobs to finish before reporting.
16+
17+
## Multiple Concurrent Sessions
18+
19+
It is common to have multiple Claude Code sessions open simultaneously across
20+
pgxntool and pgxntool-test. To avoid cross-session interference:
21+
22+
**If you are asked to do something on an existing PR that you did not open or
23+
are not already working on in this session, immediately ask for confirmation
24+
before proceeding.** For example: "I see PR #32 exists. Were you asking me to
25+
work on that, or did you mean to send this to a different session?"
26+
27+
This applies to: editing PR branches, pushing to them, closing/reopening them,
28+
adding commits, modifying PR descriptions, or any other PR-level action.

.claude/development.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# pgxntool Development Guidelines
2+
3+
**THIS FILE IS FOR PGXNTOOL DEVELOPERS ONLY.**
4+
5+
If you are an extension developer using pgxntool in your project, this file does not
6+
apply to you. See the top-level `CLAUDE.md` instead.
7+
8+
## Critical: Work from pgxntool-test, Not Here
9+
10+
**NEVER make changes to pgxntool directly from this repository.**
11+
12+
pgxntool development must be done from a checkout of **pgxntool-test**, which contains
13+
the full test infrastructure. Working here directly means you cannot run tests, and
14+
any changes you commit cannot be validated before merging.
15+
16+
**Correct workflow:**
17+
1. Clone or use an existing checkout of `pgxntool-test`
18+
2. Work in a worktree: both `pgxntool/` and `pgxntool-test/` will be siblings
19+
3. Make changes to `pgxntool/` from within that pgxntool-test context
20+
4. Run the test suite via `make test` in pgxntool-test before committing
21+
22+
**See:** https://github.com/Postgres-Extensions/pgxntool-test for the full development
23+
workflow.
24+
25+
---
26+
27+
## Makefile Variable Assignment Rules
28+
29+
**RULE: Do not use `:=` (simply expanded) unless you have a specific need for immediate evaluation.**
30+
31+
Use `=` (recursively expanded) for standard variable assignments. Reserve `:=` for cases where the right-hand side must be evaluated exactly once at assignment time — for example, when assigning the result of a `$(call ...)` function that references the variable being set (which would cause infinite recursion with `=`).
32+
33+
When a variable must also override command-line values, combine `override` with `:=` — but only where `override` is genuinely needed.
34+
35+
## Debug Level Rules (lib.sh `debug` function)
36+
37+
`debug LEVEL "msg"` prints when `DEBUG >= LEVEL`. LEVEL encodes how noisy/esoteric a message is — how far you'd crank `DEBUG` before you'd want to see it — **not** code nesting depth. A top-level line can warrant a high level if it's esoteric, and loop-body detail is usually high precisely because it's noisy. Judge by signal-to-noise.
38+
39+
The tiers are anchors, not strict multiples of 10 — any value in range is fine, leaving room to fine-tune between existing calls without renumbering:
40+
41+
- **10**: Critical errors, important warnings
42+
- **20**: Warnings, significant state changes
43+
- **30**: General debugging, function entry/exit, array operations
44+
- **40**: Verbose details, loop iterations
45+
- **50+**: Maximum verbosity (per-iteration innards)
46+
47+
Note: The BATS test helper `debug` function (in `tests/lib/helpers.bash` in pgxntool-test) uses a separate 1–5 scale controlled by `$TESTDEBUG`. The two systems are independent.

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.gitattributes export-ignore
2+
.claude/ export-ignore
3+
.github/ export-ignore
4+
*.md export-ignore
5+
.DS_Store export-ignore
26
*.asc export-ignore
37
*.adoc export-ignore
48
*.html export-ignore

.github/workflows/CLAUDE.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# .github/workflows — CI Architecture
2+
3+
## Workflow files
4+
5+
- **`ci.yml`** — main CI for pgxntool pull requests. Runs `check-test-pr` (verifies
6+
the paired pgxntool-test PR's CI passed), then optionally runs `test` (only for the
7+
commit-with-no-tests path — see below).
8+
- **`protect-label.yml`** — enforces that only maintainers with write access can apply
9+
or remove the `commit-with-no-tests` label.
10+
11+
## Normal CI flow (paired test PR exists)
12+
13+
When a pgxntool PR has a corresponding open PR in pgxntool-test with the same branch
14+
name, the `check-test-pr` job polls (up to 20 minutes) for that test PR's CI to
15+
complete and pass. If it passes, pgxntool CI passes — **no tests run here**. Tests run
16+
exactly once, in pgxntool-test's own CI.
17+
18+
## commit-with-no-tests path
19+
20+
When a maintainer applies the `commit-with-no-tests` label (and no paired test PR
21+
exists), the `test` job runs tests directly in pgxntool CI against pgxntool-test/master.
22+
This is the rare exception, not the norm.
23+
24+
## Doc-only bypass
25+
26+
`check-test-pr` checks this first, before the paired-test-PR lookup or the
27+
`commit-with-no-tests` label: if every changed file in the PR is pure
28+
documentation (`*.md`, `*.asc`, `*.adoc`, `*.asciidoc`, anywhere including
29+
under `.claude/`, but never under `.github/` — workflow definitions carry
30+
real behavioral weight regardless of extension), it skips both the paired
31+
branch requirement and the `test` job entirely. `claude-code-review.yml` is
32+
a separate workflow gated by its own `if:` and always still runs.
33+
34+
## Cross-repo reusable workflow — tradeoffs and constraints
35+
36+
The `test` job calls a reusable workflow from pgxntool-test:
37+
```yaml
38+
uses: Postgres-Extensions/pgxntool-test/.github/workflows/run-tests.yml@<ref>
39+
```
40+
41+
GitHub Actions requires the `uses:` ref to be a **static string** — expressions like
42+
`${{ }}` are not supported in the repo/path portion or the `@ref` suffix in practice.
43+
44+
### The @branch → @master ref
45+
46+
While developing on a feature branch where pgxntool-test also has changes, this ref
47+
is set to `@<branch>` so CI can find `run-tests.yml` before it lands on master.
48+
49+
**IMPORTANT**: This ref must be updated to `@master` before pgxntool merges. The
50+
correct merge order is: **pgxntool-test merges first**, then update this ref to
51+
`@master`, then pgxntool merges.
52+
53+
**For Claude**: Do NOT leave a `@<branch>` ref without explicit user approval. The
54+
user merges directly from the PR page — there are no manual steps between merges.
55+
See `.github/workflows/CLAUDE.md` in pgxntool-test for the full picture.
56+
57+
### Changes to run-tests.yml
58+
59+
`run-tests.yml` lives in pgxntool-test and is the single source of truth for all test
60+
steps. If it changes, pgxntool's CI uses `@master` — so it won't see the new version
61+
until pgxntool-test merges. This is acceptable because:
62+
- Changes to `run-tests.yml` require a paired test PR (not commit-with-no-tests)
63+
- When a paired test PR exists, pgxntool's `test` job is skipped anyway
64+
- The two scenarios are mutually exclusive in practice
65+
66+
## Label name
67+
68+
The label `commit-with-no-tests` is defined as a const (`NO_TEST_LABEL`) in `ci.yml`
69+
and as `LABEL` in `protect-label.yml`. The job-level `if:` condition in
70+
`protect-label.yml` must also use the literal string (YAML can't reference JS consts)
71+
— keep these in sync if the label name ever changes.

0 commit comments

Comments
 (0)