[NO-TICKET] Add PATCHSTACK_SOFT_FAIL so connector errors never break builds#34
Open
ejntaylor wants to merge 1 commit into
Open
[NO-TICKET] Add PATCHSTACK_SOFT_FAIL so connector errors never break builds#34ejntaylor wants to merge 1 commit into
ejntaylor wants to merge 1 commit into
Conversation
A Lovable publish failed because the project's postbuild script invoked the CLI with an unrecognized subcommand: the CLI printed usage to stderr and exited 1, which failed the entire deploy even though the app build itself succeeded. AI coding tools wire the connector into build scripts, and they sometimes get the invocation wrong — a security monitor should degrade gracefully there, not take the site down with it. PATCHSTACK_SOFT_FAIL (any value except 0/false/no/off) makes the CLI print the error as before but exit 0, covering both bad usage and runtime failures (network, config). Manual runs are unaffected unless the variable is set. The README install prompt now recommends it for build wiring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Adds soft-fail flag so connector errors never break builds. 🎯 Quality: 100% Elite · 📦 Size: Small 📈 This month: Your 218th PR — above team average · Averaging Excellent |
Contributor
Author
|
/review |
devlob
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A Lovable publish (project
e5840a4d-…) failed withscript "postbuild" exited with code 1even though the app build succeeded. The postbuild script invokedpatchstack-connectwith a subcommand the CLI doesn't recognize, so the CLI printed its usage to stderr and exited 1 — and the platform failed the whole deploy.AI coding tools (Lovable, Bolt, Cursor, …) are the ones wiring this connector into build scripts, and they sometimes get the invocation wrong. A security monitor should degrade gracefully in that position: report the problem, never take the customer's deploy down with it.
What
PATCHSTACK_SOFT_FAILenvironment variable: when set (any value except0/false/no/off), the CLI prints the error exactly as before, then exits 0. Covers both the unknown-command path and runtime failures (PatchstackError, unexpected errors).PATCHSTACK_SOFT_FAIL=1 patchstack-connect scan, plus a note explaining the trade-off; env var documented in Configuration. The install prompt also now tells the AI tool not to invent subcommands.softFailEnabled()lives insrc/config.tswith unit tests.Verification
npx vitest run— 116 tests pass;tsc --noEmitclean.node dist/cli.js bogus→ exit 1 (unchanged)PATCHSTACK_SOFT_FAIL=1 node dist/cli.js bogus→ prints usage + notice, exit 0PATCHSTACK_SOFT_FAIL=false … bogus→ exit 1 (opt-out honored)PATCHSTACK_SOFT_FAIL=1 … status --site-uuid not-a-uuid→ printsError (CONFIG_INVALID): …, exit 0🤖 Generated with Claude Code