Skip to content

Conversation

@jnasbyupgrade
Copy link
Contributor

@jnasbyupgrade jnasbyupgrade commented Jan 15, 2026

This PR adds support for pg_tle (Trusted Language Extensions for PostgreSQL) and modernizes the test infrastructure.

Key Changes

pg_tle Support:

Test Infrastructure:

  • Remove pgxntool-test-template dependency
  • Convert to simpler two-repo pattern (pgxntool + pgxntool-test)
  • Template files now in pgxntool-test/template/

Distribution Improvements:

  • Exclude .claude/ from distributions
  • Add .gitattributes validation
  • Improve make results handling of .source files

Documentation:

  • Add testing guidelines and critical warnings
  • Document META.json generation
  • Add shared commit.md workflow

Claude Code Support:

  • Add .claude/ support files
  • Exclude *.md files from git archive
  • Add Claude local settings to _.gitignore

Related pgxntool-test PR: Postgres-Extensions/pgxntool-test#2

jnasbyupgrade and others added 11 commits October 7, 2025 15:27
- Add .claude/settings.json with references to test repos
- Add CLAUDE.md documenting the meta-framework architecture
- Include git commit guidelines

Co-Authored-By: Claude <[email protected]>
This ensures all projects using pgxntool will ignore Claude Code local
configuration files

Co-Authored-By: Claude <[email protected]>
Add *.md to export-ignore to prevent markdown files (including CLAUDE.md)
from being included in extension distributions

Co-Authored-By: Claude <[email protected]>
Add `.claude/commands/commit.md` with comprehensive commit workflow that will be
shared with pgxntool-test via symlink. This ensures consistent commit standards
across both repos.

Document META.json generation process in `build_meta.sh` to explain why we
generate from template (PGXN.org doesn't like empty optional fields) and
future possibilities (could generate control files from template).

Co-Authored-By: Claude <[email protected]>
Add testing section to `CLAUDE.md` with critical rules: never use
`make installcheck` directly, never run `make results` without
verification, database connection requirements.

Enhance `README.asc` to recommend `make test`, document `make
results` verification workflow, and emphasize pgTap benefits.

Co-Authored-By: Claude <[email protected]>
… validation

- Add `make_results.sh` script to handle copying results while respecting
  `output/*.source` files as source of truth
- Update `base.mk` to properly handle ephemeral files from `.source` files:
  - Track `TEST_OUT_SOURCE_FILES` and `TEST_EXPECTED_FROM_SOURCE`
  - Add ephemeral files to `EXTRA_CLEAN` so `make clean` removes them
  - Create `test/results/` directory automatically
  - Remove rule that created `test/output/` directory (it's an optional input)
- Add validation in `dist-only` target to ensure `.gitattributes` is committed
  before creating distribution (git archive only respects export-ignore for
  committed files)
- Update `README.asc` and `CLAUDE.md` to document that development should be
  done from pgxntool-test repository

Co-Authored-By: Claude <[email protected]>
- Add `pgtle` make target to generate pg_tle registration SQL for extensions
- Support pg_tle version ranges (1.0.0-1.5.0 and 1.5.0+) with appropriate API usage
- Add `pgtle.sh` script to generate pg_tle SQL from extension control files and versioned SQL
- Update `base.mk` to include pg_tle generation with proper dependencies on SQL files
- Add pg_tle/ directory to EXTRA_CLEAN for `make clean`

- Enhance `.claude/commands/commit.md` to require checking all 3 repos before committing
- Add explicit guidance to commit all repos with changes together (no empty commits)
- Document multi-repo commit workflow in steps

- Update `CLAUDE.md` with pg_tle development context and documentation
- Update `README.asc` and `README.html` with pg_tle usage documentation

Co-Authored-By: Claude <[email protected]>
Add new pg_tle version range to handle API changes in 1.4.0:
- Split 1.0.0-1.5.0 range into 1.0.0-1.4.0 and 1.4.0-1.5.0
- Version 1.4.0 added uninstall function (backward-incompatible)
- Version 1.5.0 added schema parameter (another boundary)
- Update `base.mk` pattern rules for three version ranges
- Update `pgtle.sh` documentation and logic for new range

Extract shared utility functions into `lib.sh`:
- Move `error()`, `die()`, and `debug()` functions from `pgtle.sh`
- Update `pgtle.sh` and `setup.sh` to source `lib.sh`
- Reduces code duplication and improves maintainability

Refine `.gitattributes` export rules:
- Add specific excludes: `CLAUDE.md`, `PLAN-*.md`, `.DS_Store`
- Remove blanket `*.md` exclude (too broad)
- Allows README.md and other docs to be included in distributions

Add documentation about directory purity in `CLAUDE.md`:
- Emphasize that pgxntool directory contains ONLY embedded files
- Warn against adding temporary files or planning documents
- Clarify that such files belong in pgxntool-test instead

Co-Authored-By: Claude <[email protected]>
Remove references to pgxntool-test-template (now consolidated):
- Template files moved to pgxntool-test/template/
- Remove template directory from `.claude/settings.json`
- Update `CLAUDE.md` for two-repository pattern

Convert `.claude/commands/commit.md` to symlink:
- Development happens in pgxntool-test, avoid duplication
- Symlink: `commit.md -> ../../../pgxntool-test/.claude/commands/commit.md`

Related changes in pgxntool-test:
- Consolidate template files into pgxntool-test/template/
- Simplify commit workflow to two-phase (remove amend step)

Co-Authored-By: Claude <[email protected]>
jnasbyupgrade and others added 3 commits January 15, 2026 17:36
Dramatically simplify pg_tle Makefile target by removing version-specific
generation support (which is retained in pgtle.sh script where it belongs),
reducing code from ~85 lines to ~10 lines.

Add comprehensive pg_tle version boundary documentation in pgtle_versions.md,
documenting three version ranges (1.0.0-1.4.0, 1.4.0-1.5.0, 1.5.0+) with their
API differences and PostgreSQL support.

Rename SOURCE-related variables in base.mk to TEST__SOURCE__* pattern for
better clarity and namespace separation.

Improve CLAUDE.md with clearer guidance about test/expected/ files, correct
description of pg_regress vs make test, and redirect development workflow
details to pgxntool-test repository.

Update README.asc to reference pgtle_versions.md for version details and
use make run-pgtle for installation instructions.

Simplify .gitattributes to exclude all .md files rather than specific patterns.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
The `tag` and `rmtag` targets now create/delete git tags instead of branches.
Tags are pushed to origin for distribution archives. If a tag already exists
at HEAD, it's skipped; if it points to a different commit, an error is raised.

Related changes in pgxntool-test:
- Updated tests to clean up tags instead of branches

Co-Authored-By: Claude <[email protected]>
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