feat: accept connection name or ID in pause/unpause commands#277
Merged
feat: accept connection name or ID in pause/unpause commands#277
Conversation
Collaborator
Author
|
We need some acceptance tests and potentially some unit tests for this. |
Completes the pause/unpause name-or-ID work from the parent commit and
aligns MCP, tests, and user-facing copy.
CLI
- Document pause/unpause with examples (ID and name) in command Long text.
- Add httptest coverage for resolveConnectionID: direct web_* ID, lookup
by name via ListConnections, and web_* GET 404 falling back to name.
Gateway MCP (hookdeck_connections)
- Resolve connection ID or name for get, pause, and unpause using the same
rules as the CLI (prefix probe, then list-by-name).
- Surface API errors during resolution through TranslateAPIError so
responses match other tools (e.g. authentication failures).
- Validation errors: id or name is required for get/pause/unpause.
- Refresh tool description, static help, and JSON schema text for get by
name.
Tests
- MCP server tests: stub GET /connections/{id} before pause/unpause;
include pagination limit in list mocks so name resolution succeeds;
add get/pause/unpause-by-name cases; update missing-parameter assertions.
- Acceptance: TestConnectionPauseUnpauseByName exercises pause/unpause by
name against the real API and checks paused_at via connection get.
Refs: #276
Made-with: Cursor
Made-with: Cursor # Conflicts: # pkg/gateway/mcp/tools.go
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
Implements issue #276:
hookdeck connection pause/unpause(andhookdeck gateway connection pause/unpause) accept a connection name or ID, using the same resolution asconnection get(resolveConnectionID).The gateway MCP tool
hookdeck_connectionsis aligned:get,pause, andunpauseaccept the connection ID or name viaresolveMCPConnectionID(same rules as the CLI).Behavior
conn_*,web_*):GetConnectionfirst; on 404, fall through to list by name (so a name that looks like an ID still works).ListConnectionswithname=; 0 results → not found; >1 → ambiguous name error (use ID).CLI
connection pause/connection unpause:Use, annotations, and Long text updated; examples for ID and name.resolveConnectionIDbeforePauseConnection/UnpauseConnection.MCP (
hookdeck_connections)get: resolves ID or name, then fetches the connection.pause/unpause: resolve then call API.TranslateAPIError(e.g. 401 matches other tools).id or name is requiredfor get/pause/unpause.tool_help/ JSON schema copy updated for get-by-name; merged with main wording on project scoping (hookdeck_projects).Tests
pkg/cmd):connection_get_resolve_test.go— httptest coverage forresolveConnectionID.pkg/gateway/mcp): mocksGET /connections/{id}before pause/unpause; list mocks include paginationlimitso name resolution is not treated as empty; get/pause/unpause by name; missing-id assertions.//go:build connection):TestConnectionPauseUnpauseByName— create connection, pause/unpause by name, assertpaused_atvia get.Merge
mainmerged into this branch; conflict inpkg/gateway/mcp/tools.goresolved by keeping ID or name in the connections tool description and project scoping text from main.Verification
go test ./... -count=1Acceptance slice (requires API key):
go test -tags=connection ./test/acceptance/...(seetest/acceptance/README.md).Closes #276