fix(cli): correct ssh-commands timing values and clarify build-configs default vs override#14
Conversation
Two high-impact bugs surfaced from Mixpanel telemetry (30d window): - ssh-commands update: 100% of failures were API 422 "timing is not included in the list" (102/229 calls). The --timing flag advertised "before or after" but the API's valid values are "all", "first", and "after_first" (see Command::TIMING in the deployhq Rails model). Fix --timing help text on create and update, change create's default from "after" (invalid) to "all", validate client-side before the API call, and add omitempty to Command so partial updates don't send an empty string. - build-configs update: 100% of failures were API 404 record_not_found (165/165 calls). The update/delete endpoints scope lookups to non_default_environments, but the list endpoint returns the default config too — users naturally try to update what they see. Expand the Long description to explain the default/override distinction and surface (default)/(override) on every row of the list output so the constraint is visible before users try to update. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis pull request improves CLI command handling across two areas: it enhances the build configs list output to clearly indicate configuration type as default or override, and it adds server-side validation for SSH command timing values while updating the SDK request schema to allow optional command fields during creation. ChangesBuild Configs Display Enhancement
SSH Timing Validation and Request Schema
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Two high-failure-rate bugs surfaced from 30-day Mixpanel telemetry on
cli_commandevents:ssh-commands update— 100% of failures (102/229 calls) were API422 timing is not included in the list. The--timingflag advertised"before or after", but the API's actual valid values areall,first,after_first(perCommand::TIMINGin the deployhq Rails model). Fixed the help text on bothcreateandupdate, changedcreate's default from"after"(invalid) to"all", added client-side validation before the API call, and addedomitemptytoCommandin the request struct so partial updates don't send an empty string.build-configs update— 100% of failures (165/165 calls) were API404 record_not_found. Theupdate/deleteendpoints scope lookups tonon_default_environments, butlistreturns the default config too — users naturally try to update what they see. Expanded theLongdescription to explain the default vs override distinction and surfaced(default)/(override)on every row of the list output so the constraint is visible before users hit the wall.No SDK signature changes. No breaking changes to flag names.
Test plan
go build ./...go vet ./...go test ./internal/commands/... ./pkg/sdk/...golangci-lint run ./internal/commands/... ./pkg/sdk/...dhq ssh-commands update <id> --timing firstsucceeds;--timing afternow fails client-side with a helpful hint.dhq build-configs listshows(default)/(override)column;dhq build-configs --helpmentions the override workflow.🤖 Generated with Claude Code
Summary by CodeRabbit