Makefile: cat_tools install override (CAT_TOOLS_GIT_REF/CAT_TOOLS_SKIP_INSTALL), default unchanged - #10
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
A real release must never be cut while a dependency is temporarily pinned to a git source (like the cat_tools pin added in Postgres-Extensions#10): the resulting release's declared dependency floor wouldn't actually be resolvable via `pgxn install` for anyone downloading it from PGXN. Document this in RELEASE.md and add a small predicate script, bin/in_release, that reports whether we're at/cutting a release (HISTORY.asc's top heading is a real version) versus mid-development (heading is the `STABLE` placeholder) -- for now a manual check to run before releasing, not yet wired into CI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…redate this branch CI on this branch showed the switch to `make test && make verify-results` surfacing real pgTAP failures on PostgreSQL 9.3/9.6 (cat_tools/extension_drop never actually install there). Checked PR Postgres-Extensions#10's own baseline CI (Postgres-Extensions#10, run 30665031257): PG 9.3 and 9.6 already report "3 of 3 tests failed" in the raw job log there too, just silently reported as a passing check because pg-build-test's underlying `make test` hits pgxntool's `.IGNORE: installcheck` the same way. So this isn't a regression from this PR's own changes -- it's the exact masking problem RELEASE.md already documents, just now applying to a different, older part of the PG matrix than the PRs (#6/#7) it originally cites. Reverting the ci.yml step back to pg-build-test here keeps this PR scoped to test/install infrastructure; fixing cat_tools's install path on pre-PG10 belongs to whoever owns that dependency setup (PR Postgres-Extensions#10 or a follow-up), not this PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
actions/checkout v4.4.0 (backported to all major-version tags) added a new default-on refusal for checking out a fork PR's head under pull_request_target, since it can't see that this job is already gated to the trusted jnasbyupgrade fork only (see the if: condition and SECURITY comment above) and never builds or executes the fetched code. Root-caused via the actual failed run logs on PRs Postgres-Extensions#10/Postgres-Extensions#14/Postgres-Extensions#15, which all failed at this checkout step with: Refusing to check out fork pull request code from a 'pull_request_target' workflow. ... set 'allow-unsafe-pr-checkout: true' on the actions/checkout step. Without this, track_progress: true (added in the prior commit) never had a chance to matter -- the workflow was failing before the review step ever ran.
…redate this branch CI on this branch showed the switch to `make test && make verify-results` surfacing real pgTAP failures on PostgreSQL 9.3/9.6 (cat_tools/extension_drop never actually install there). Checked PR Postgres-Extensions#10's own baseline CI (Postgres-Extensions#10, run 30665031257): PG 9.3 and 9.6 already report "3 of 3 tests failed" in the raw job log there too, just silently reported as a passing check because pg-build-test's underlying `make test` hits pgxntool's `.IGNORE: installcheck` the same way. So this isn't a regression from this PR's own changes -- it's the exact masking problem RELEASE.md already documents, just now applying to a different, older part of the PG matrix than the PRs (#6/#7) it originally cites. Reverting the ci.yml step back to pg-build-test here keeps this PR scoped to test/install infrastructure; fixing cat_tools's install path on pre-PG10 belongs to whoever owns that dependency setup (PR Postgres-Extensions#10 or a follow-up), not this PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…redate this branch CI on this branch showed the switch to `make test && make verify-results` surfacing real pgTAP failures on PostgreSQL 9.3/9.6 (cat_tools/extension_drop never actually install there). Checked PR #10's own baseline CI (#10, run 30665031257): PG 9.3 and 9.6 already report "3 of 3 tests failed" in the raw job log there too, just silently reported as a passing check because pg-build-test's underlying `make test` hits pgxntool's `.IGNORE: installcheck` the same way. So this isn't a regression from this PR's own changes -- it's the exact masking problem RELEASE.md already documents, just now applying to a different, older part of the PG matrix than the PRs (#6/#7) it originally cites. Reverting the ci.yml step back to pg-build-test here keeps this PR scoped to test/install infrastructure; fixing cat_tools's install path on pre-PG10 belongs to whoever owns that dependency setup (PR #10 or a follow-up), not this PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
I'll analyze this and get back to you. |
#28) PR #15's `allow-unsafe-pr-checkout: true` fix silenced the checkout-refusal error but was solving the wrong problem, and traded it for a new one: after merging, review runs on #10 and #16 failed with a different error, `fatal: couldn't find remote ref pull/10/head`. Root cause: `anthropics/claude-code-action`'s own `docs/security.md` explicitly names our checkout step's pattern (checking out the PR's own untrusted ref, from the fork, into the workspace root) as the anti-pattern to avoid, and its "preferred" fix is a plain checkout of the base ref with no override. The action fetches and reads the PR's actual content itself -- confirmed by reading its source (`src/github/operations/branch.ts`): for a fork PR it runs `git fetch origin ... pull/<n>/head`, a ref GitHub maintains on the BASE repo for any PR (fork or not), so it never needs direct access to the fork's remote. Our step redirecting `origin` to the fork broke that internal fetch, since `refs/pull/<n>/head` doesn't exist there. Fix: remove the `repository:`/`ref:`/`allow-unsafe-pr-checkout` overrides entirely -- just `uses: actions/checkout@v7` with no inputs, checking out this repo's own base branch. Updated the surrounding comments (the top-of-file SECURITY note and the job's trust-check warning) to match -- they previously described the now-removed manual fork-checkout.
|
Claude finished @jnasbyupgrade's task in 2m 55s —— View job Claude finished reviewing PR #10
SummarySolid, well-documented fix. The root cause analysis (PGXN's Findings1. Missing
2.
3. No protection against upstream Because Nice-to-haves already handled well
Not addressed by this PR (correctly out of scope, per the PR description)
These are all called out explicitly in the PR body and tracked/flagged appropriately rather than silently ignored. |
Redesign of the original fix: that version unconditionally replaced the default pgxn install with a git-source build for every consumer of this Makefile, not just CI. Reverted to that concern: the default cat_tools recipe is exactly what it was before (plain `pgxn install 'cat_tools>=0.2.1' --sudo`), gated on the same prerequisite file it always was. Two new, empty-by-default variables give CI an explicit opt-in without touching that default: - CAT_TOOLS_GIT_REF: when set, installs cat_tools from that git ref instead of PGXN (for when PGXN's published listing lags what's actually needed -- CI sets this, nothing else does). - CAT_TOOLS_SKIP_INSTALL: when set, skips installing cat_tools at all (for pg_tle-mode CI, where cat_tools is already provided via pg_tle registration and a filesystem install as a side effect would defeat the point of the test). No META/version-floor changes here -- that's a separate concern, handled where it belongs (the version-pin PR).
26c9fe5 to
ef2e29d
Compare
The version decision this repo actually needs, separated from PR Postgres-Extensions#10's install-mechanism change. extension_drop.sql calls cat_tools.routine__parse_arg_types_text(), which only exists starting at cat_tools 0.3.0 -- PGXN's published listing is stuck at a stale 2017 0.2.1 lacking it. Bumping META's declared floor makes a plain `pgxn install extension_drop` fail cleanly at dependency-resolution time instead of installing successfully and breaking later at CREATE EXTENSION time. Sets CAT_TOOLS_GIT_REF=0.3.0 at ci.yml's workflow level (not per-job), so every job that builds the extension -- including ones in other stacked PRs that already read this value via `make print-CAT_TOOLS_GIT_REF` -- picks it up automatically. Updates RELEASE.md's release-blocking guardrail: the real signal is now whether ci.yml's CAT_TOOLS_GIT_REF is actually set to a non-empty value, not whether the Makefile merely declares the variable (it always does now, as a normally-empty opt-in override).
|
Claude finished @jnasbyupgrade's task in 3m 39s —— View job Claude finished reviewing PR #10
SummaryNote up front: the PR description/title above describe an earlier version of this PR (git-source build by default, The redesign is a real improvement over the previous approach: it makes the git-source build strictly opt-in via Findings1. The new opt-in vars aren't set anywhere, so this PR alone doesn't fix the underlying bug (should confirm)
If that wiring is intentionally deferred to a separate PR, worth saying so explicitly in the PR description so reviewers don't assume this one is a complete fix on its own. If it isn't planned elsewhere yet, 2. Git-source install path is missing
Nice-to-haves already handled well
Not addressed by this PR (pre-existing, out of scope)
|

Redesigned. The original version unconditionally replaced the Makefile's
default
cat_toolsinstall (plainpgxn install) with a git-source build,for every consumer of this repo -- not just CI. That's wrong: PGXN's stale
listing is CI's/testing's problem to work around, not something that should
change the default
make install/pgxn installbehavior everyone else gets.What this PR actually does now
Reverts the default
cat_toolsrecipe to exactly what it was(
pgxn install 'cat_tools>=0.2.1' --sudo), and adds two empty-by-defaultvariables as an explicit, opt-in override:
CAT_TOOLS_GIT_REF: when set, installs cat_tools from that git refinstead of PGXN.
CAT_TOOLS_SKIP_INSTALL: when set, skips installing cat_tools entirely(for pg_tle-mode testing, where cat_tools is already provided via pg_tle
registration and a filesystem install as a side effect would defeat the
point of the test).
Neither variable changes anything for a caller that doesn't set them --
make/make install/pgxn install extension_dropbehave identically tobefore this PR.
No version/META changes here. Bumping the declared
cat_toolsfloor andactually wiring CI to use
CAT_TOOLS_GIT_REFis a separate concern, handledin the version-pin PR (#25) stacked on this one -- keeping "add the override
mechanism" and "decide which version to use" as independent, separately
reviewable changes.
Verified locally (PG17)
pgxn install 'cat_tools>=0.2.1' --sudoruns,installs 0.2.1, exactly as before.
CAT_TOOLS_GIT_REF=0.3.0: clones and builds cat_tools at the0.3.0tag,installs correctly, cleans up its build dir afterward.
CAT_TOOLS_SKIP_INSTALL=yes: true no-op, confirmed nothing gets installed.make -n cat_toolsis genuinely dry (prints without executing)in all three cases -- an earlier draft of this recipe accidentally forced
real execution under
-nby referencing$(MAKE)(GNU Make always runsrecipes containing that literal text, even under
-n, so it can show whata sub-make would do) and separately had a
cd $(CAT_TOOLS_BUILD_DIR) &&that persisted across the whole joined shell recipe, breaking a later
-Creference to the same relative path. Fixed by using plain
make(not$(MAKE)) for the nested build andgit -C <dir>instead ofcd &&.