fix: improve apps deploy error when APP_NAME is missing#5113
fix: improve apps deploy error when APP_NAME is missing#5113jamesbroadhead wants to merge 6 commits into
Conversation
Approval status: pending
|
The old error "accepts 1 arg(s), received 0" was unclear. The new message explains that APP_NAME is required, shows usage, mentions the databricks.yml alternative, and suggests an app name inferred from the current directory. Co-authored-by: Isaac Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>
Co-authored-by: Isaac Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>
Cover normal cases (app.yml, app.yaml, no config) and edge cases (deleted cwd) to verify graceful degradation. Co-authored-by: Isaac Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>
Co-authored-by: Isaac Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>
- Check os.WriteFile error return values - Use t.Chdir() instead of manual os.Chdir + cleanup - Remove unnecessary testChdir helper Co-authored-by: Isaac Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>
The shared zero-arg validator used by deploy/start/stop/delete printed a hardcoded "databricks apps deploy <hint>" suggestion and a generic "<command>" placeholder in the usage line, so users running `apps stop` without an APP_NAME were nudged toward `apps deploy` instead. - Thread the cobra command into missingAppNameError and render both the Usage line and the "Did you mean?" hint from cmd.CommandPath(). - Extend bundle_helpers_test.go with table-driven coverage that exercises deploy/start/stop/delete and asserts the hint matches the verb. - inferAppNameHint now requires app.yml/app.yaml to be a regular file, so a directory of that name no longer produces a bogus hint. - Regenerate the no-bundle-no-args acceptance fixture for the new message. Co-authored-by: Isaac
|
👋 @pietern @fjakobs — Claude here on James's behalf. Rebased onto current Ready for review whenever you've got a moment. (comment posted by Claude) |
c654348 to
6c3d347
Compare
Summary
accepts 1 arg(s), received 0error with a clear message explaining thatAPP_NAMEis requireddatabricks.ymlauto-detect alternative, and suggest an app name inferred from the current directory nameTest plan
go test ./cmd/apps/ -run TestMakeArgsOptionalpassesgo build ./cmd/apps/succeedsThis pull request was AI-assisted by Isaac.