Distinguish disabled tools from missing tools in errors#247
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Improves dock tool resolution so users get a specific “tool is disabled for this project” error when a tool exists but is disabled, instead of the generic “Project has no X”, across both CLI and TUI resolution paths.
Changes:
- CLI:
getDockToolIDnow filters to enabled dock tools and surfaces a disabled-specific not-found hint. - TUI:
fetchDockToolsreturns both enabled matches and the full dock list soDockToolcan differentiate disabled vs absent without an extra API call. - Tests: adds new unit coverage for disabled-only vs absent-tool branches and updates some mocked dock JSON to include
enabled: true.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/commands/helpers.go | Filters dock tool matches by Enabled and emits a disabled-specific hint when applicable. |
| internal/tui/resolve/dock.go | Returns both enabled matches + full dock list; improves disabled vs missing error reporting in the resolver. |
| internal/commands/helpers_test.go | Adds CLI-path tests for disabled-only and absent-tool error branches. |
| internal/tui/resolve/dock_test.go | Adds TUI-path test ensuring disabled-only projects produce the disabled-specific hint. |
| internal/commands/messages_test.go | Updates mocked dock tool JSON to include enabled: true. |
| internal/commands/campfire_test.go | Updates mocked dock tool JSON to include enabled: true. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When a dock tool (campfire, message board, etc.) exists but is disabled for the project, show "X is disabled for this project" instead of the generic "Project has no X". Applies to both the CLI helpers.go path and the TUI resolve/dock.go path. Also filters on Enabled in getDockToolID (CLI path), which previously returned disabled tools that would fail opaquely downstream. Adds test coverage for both disabled-only and absent-tool branches, and fixes mock dock data in existing tests to include enabled: true.
Ensures all test dock data matches the real API response shape, which always includes the enabled field.
c17f48d to
97ffc19
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
getDockToolIDin helpers.go) and the TUI path (fetchDockTools/DockToolin resolve/dock.go)Enabledfilter togetDockToolID(previously returned disabled tools that would fail opaquely downstream)fetchDockToolsnow returns(enabled, allDock, error)so the caller can distinguish disabled from absent without a second API callenabled: trueContext
DHH feedback card 9661172355 — unhelpful error messages when running commands against projects with disabled tools.
Test plan
bin/cipassesTestGetDockToolID_DisabledToolShowsDisabledError— CLI pathTestGetDockToolID_AbsentToolShowsNotFoundError— CLI pathTestDockToolDisabledOnlyShowsDisabledError— TUI pathSummary by cubic
Show clear errors when a dock tool exists but is disabled, instead of saying the project has none. Applies to both CLI and TUI, and avoids opaque failures by filtering out disabled tools.
getDockToolIDnow filters for enabled tools and returns “X is disabled for this project” when applicable.DockTooldistinguishes disabled vs. missing tools;fetchDockToolsreturns(enabledMatches, allDock, error)to support this.enabled: trueto match the API.Written for commit 97ffc19. Summary will update on new commits.