Skip to content

Fix results ordering, control file whitespace, ENABLE_* override, debug levels#31

Open
jnasbyupgrade wants to merge 4 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-pr69-issues
Open

Fix results ordering, control file whitespace, ENABLE_* override, debug levels#31
jnasbyupgrade wants to merge 4 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-pr69-issues

Conversation

@jnasbyupgrade
Copy link
Copy Markdown
Contributor

@jnasbyupgrade jnasbyupgrade commented May 14, 2026

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

Summary

  • Fix results: prerequisite ordering: verify-results ran before make test, checking stale regression.diffs from a prior run; reordered to results: test verify-results
  • Fix parse_control_file trailing whitespace: ${value%% } only stripped one trailing space; now uses a regex to strip all trailing spaces and tabs (e.g. default_version = '1.0.0' # comment)
  • Add override to PGXNTOOL_ENABLE_TEST_BUILD/PGXNTOOL_ENABLE_TEST_INSTALL so command-line values are normalized by pgxntool_validate_yesno rather than silently ignored
  • Fix pgtle.sh debug levels: single-digit values (1–4) replaced with range-based values (30, 40, 50) per lib.sh convention
  • Update lib.sh debug comment to describe range-based scheme (1–9, 10–19, 20–29...) rather than vague "multiples"
  • Clarify CLAUDE.md audience: for extension developers using pgxntool, not contributors; redirect contributors to .claude/
  • Move developer guidelines (Makefile := rules, debug level rules) from CLAUDE.md into .claude/development.md, which also now prominently states that pgxntool changes must be made from a pgxntool-test checkout
  • Update HISTORY.asc with entries for the two user-visible fixes

…ug levels

- Fix `results:` ordering: `verify-results` ran before `make test`, so it
  checked stale `regression.diffs`; reordered to `results: test verify-results`
- Fix `parse_control_file` trailing whitespace: `${value%% }` only removed one
  space; now uses regex to strip all trailing spaces and tabs
- Add `override` to `PGXNTOOL_ENABLE_TEST_BUILD`/`PGXNTOOL_ENABLE_TEST_INSTALL`
  so command-line values are normalized by `pgxntool_validate_yesno` rather
  than silently ignored
- Fix `pgtle.sh` debug levels: single-digit values (1–4) replaced with
  standard multiples-of-10 (30, 40, 50) per documented convention
- Add Makefile variable assignment and debug level rules to `CLAUDE.md`

Related changes in pgxntool-test:
- New test in `04-pgtle.bats`: verify `pgtle.sh` handles multiple spaces and
  tab before trailing comment in control files
- Updated `make-results.bats`: new test verifying `verify-results` blocks
  `make results` after a failing test run
- Updated `test-verify-results.bats`: reflect that `make results` now runs
  `make test` first

Co-Authored-By: Claude <[email protected]>
jnasbyupgrade and others added 2 commits May 15, 2026 15:14
Update the `debug()` comment in `lib.sh` to document the intended
range-based scheme: 1-9 for high-level script context, 10-19 for
per-loop-iteration detail, 20-29 for nesting inside that — with room
within each decade to fine-tune without renumbering. The old comment
described "multiples of 10" which was inaccurate and misleading.

Related changes in pgxntool-test:
- `helpers.bash`: test `debug()` now uses `$TESTDEBUG` instead of `$DEBUG`
- `SKILL.md`: added advisory debug level distribution check to commit workflow

Co-Authored-By: Claude <[email protected]>
CLAUDE.md is for users of pgxntool. Developer-focused guidelines
(Makefile variable assignment rules, debug level scheme) belong in
.claude/ where they are visible to contributors but not surfaced to
extension developers reading the user docs.

Also updates the debug level rules to the range-based scheme documented
in lib.sh (1-9, 10-19, 20-29...) rather than the old multiples-of-10
description.

Co-Authored-By: Claude <[email protected]>
CLAUDE.md is loaded by anyone who has pgxntool embedded in their project.
.claude/ is only relevant to people making changes to pgxntool itself.

- CLAUDE.md: rewrite "Scope" section to make clear it is for extension
  developers consuming pgxntool, not for pgxntool contributors
- .claude/development.md: add prominent "developers only" header and a
  "Work from pgxntool-test, Not Here" section explaining why changes must
  be made from a pgxntool-test checkout (full test infrastructure lives there)
- Fix test helper path reference: tests/lib/helpers.bash in pgxntool-test

Co-Authored-By: Claude Sonnet 4.6 <[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