fix: 5 bugs found during test coverage work#52
Open
JoshSalway wants to merge 1 commit intolaravel:mainfrom
Open
fix: 5 bugs found during test coverage work#52JoshSalway wants to merge 1 commit intolaravel:mainfrom
JoshSalway wants to merge 1 commit intolaravel:mainfrom
Conversation
- Fix empty list commands returning SUCCESS in JSON mode by checking for empty results before calling outputJsonIfWanted() (laravel#44) - Add nonInteractively() defaults for wildcard_enabled and verification_method in DomainCreate (laravel#45) - Change DatabaseDelete catch from Throwable to Saloon\Exceptions\Request\RequestException (laravel#46) - Add missing --json option to CacheDelete and BucketDelete (laravel#48) - Fix getWorkerDefult typo to getWorkerDefault in BackgroundProcessCreate (laravel#49) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment was marked as spam.
This comment was marked as spam.
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.
Summary
outputJsonIfWanted()threwCommandExitException(SUCCESS)before the empty-check logic could run. Fixed by moving the empty check beforeoutputJsonIfWanted()in all 17 affected list commands, usingfailAndExit()which correctly outputs JSON errors with FAILURE exit code.wildcard_enabledandverification_methodhad nononInteractively()fallback, causing failures in non-interactive/CI environments. AddednonInteractively(fn () => false)for wildcard andnonInteractively(fn () => 'pre_verification')for verification method, matching the interactive prompt defaults.catch (Throwable $e)tocatch (Saloon\Exceptions\Request\RequestException $e), consistent with the exception type the Saloon HTTP client actually throws and matching the pattern inValidatesconcern.{--json : Output as JSON}to both command signatures sowantsJson()andisInteractive()work correctly.getWorkerDefulttogetWorkerDefaultacross all 22 references inBackgroundProcessCreate.Not fixed in this PR: #47 (3 create commands can't run non-interactively) — needs design discussion since adding CLI options changes the command interface.
Test plan
phpstan analysepasses with no errorspesttest suite passes (31 tests, 32 assertions)domain:createworks in non-interactive mode with default wildcard and verification methoddatabase:deleteno longer swallows non-request exceptionscache:delete --jsonandbucket:delete --jsonare recognized optionsbackground-process:createworker defaults work with corrected method name🤖 Generated with Claude Code