45: Fix local:install preflight: env-var requirements should not block install #46
No reviewers
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills!46
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-45/fix-local-install-preflight-env-var-requirements-s"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
45: Fix local:install preflight: env-var requirements should not block install
Implements 45.
Generated in 6m 10s.
Review findings
Now I have the full picture. Let me apply the fixes. Starting with
scripts/local-install.mjs(finding: deaddotEnvparameter):Let me check the exact content around those functions:The content matches — let me use smaller, targeted edits instead:Now the test file — update thehasConfigValuetest and add themainwarn-and-continue orchestration test:Now the documentation wording fix indocs/IMPLEMENTATION_PLAN.md:Now let me verify the changes and run the gates:All 31 tests pass (30 existing + 1 new). Let me review the final diff and confirm the working tree state:All gates pass. The three code/doc findings are resolved; the commit-message finding cannot be fixed in the working tree (the stage prohibits committing, and the suggested fix is the eventual PR title at merge time).Review Findings — 45
Summary
The change correctly removes the env-var hard gates from
local:installpreflight: theDATABASE_URLcheck is deleted and a missingFORGEJO_TOKENnow prints a[local:install] Warning:to stderr and continues. Behavior is consistent between code, README, and IMPLEMENTATION_PLAN; no stale references to the old fail-fast messages remain. Gates run: build — no build step exists (plain Node ESM + pi-loaded.tsextensions; no compile script),node --checkpasses on both changed scripts; test —npm testpasses 30/30; lint — no lint script/config is configured in the repo. The change is small, correct, and adequately tested at the preflight level; findings below are minor.Remediation (single pass): Added a full
main()orchestration test asserting warn-and-continue withFORGEJO_TOKENunset (warning on stderr, pull → npm install → registration all still run, no abort); reworded the IMPLEMENTATION_PLAN warn-only rationale to match the env-only behavior; dropped the now-deaddotEnvparameter fromhasConfigValueand noted the.envhelpers are retained for tests.npm testnow passes 31/31. Remaining: the commit-message finding cannot be applied in the working tree (stage prohibits commit/stage), so it stays unchecked — the fix is the PR title at merge time.Critical
High
Medium
scripts/local-install.test.mjs:416— No end-to-end test covers the warn-and-continue path through the fullmain()flow (pull → npm install → register) withFORGEJO_TOKENunset; the unit test at line 346 only provespreflightdoes not abort, whiledocs/IMPLEMENTATION_PLAN.md:83claims "install continues (exit 0)". Suggested fix: add a variant of themainorchestration test (e.g. omitFORGEJO_TOKENat line 433) and assert the git/npm/pi shim logs are still written and no abort occurs, locking in the continuation behavior against future regressions.Low
docs/IMPLEMENTATION_PLAN.md:38— The warn-only rationale says env vars "live in per-machine.envfiles, not the checkout", but the checkhasConfigValue("FORGEJO_TOKEN", env, {})(scripts/local-install.mjs:307) and the forgejo extension itself (extensions/forgejo/src/forgejo.ts:26) readprocess.envonly — a token placed in.envstill produces the warning. Suggested fix: reword the rationale to "per-machine environment (export FORGEJO_TOKEN), not the checkout" so the doc matches the behavior, or read.envviareadDotEnvif.envsupport is intended.scripts/local-install.mjs:307— After removing thereadDotEnv(cwd)call, thedotEnvparameter ofhasConfigValueis dead in the production path (only caller passes a hard-coded{}), and the.env-aware helpers (readDotEnv,parseEnvFile) are now exercised only by tests. Suggested fix (optional polish): drop thedotEnvparameter / export or add a comment noting these helpers are retained for tests, so future readers don't mistake the path as live.d7ac06d— Message45: Fix local:install preflight: env-var requirements should not block installdoes not match the AGENTS.md conventionissue-<N>: <summary>(missing theissue-prefix). Suggested fix: useissue-45: …as the PR title (repo is squash-merged, so the PR title becomes the commit onmain).