-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds --cli-path and changes behavior to remove connection name and path terminal interactivity #92
Conversation
Since source name is just to identify the source but doesn't have any meaningful impact, we can potentially generate a random name (maybe "adjective noun random_number")? Sharing this message I sent in the other PR, curious to hear if you agree with this thought process here. |
Yeah, could do. @mkherlakian - WDYT?
It's a good question: would the user expect a side effect to take place by passing a flag? IMO it's reasonable. |
@leggetter Many thanks for documenting this, very helpful!
Yes, or something along hte lines of
I don't think that we need to explicitly disallow the switching of the path, i.e. no need for a separate flag IMO
I'm trying to map out scenarios for this one - Is there a potential.case where we'd end up creating 2 cli destinations (ie 2 connections) on separate runs without the user specifying a connection explicitly, which would lead to the above becoming a friction point? and then do That would update the path of the existing connection, or would it create a new one? Last but not least, the user auth problem is somtehing we'll need to solve, meaning if we also can't do something like --api-key ... and have it work without hte CI step, it still feels janky. |
@mkherlakian from the table that @leggetter described, it seems your workflow would result in 2 separate connections / destinations.
Are you referring to this issue #89? Can you take a look? I think this is an issue with the API or with the design and not a CLI bug. |
No, not according to the second row, I just reread, think that answers the question but I'll wait for @leggetter's confirmation
I'll answer on that issue. |
Ok, I'll look into this.
It is possible to create two connections to the CLI with other commands. I discovered this with the current CLI when creating the CLI/Docker quickstart example. And that's why the cURL command in that example passes a Connection name (note that with this CLI update the cURL command is no longer required in the Docker example). However, when the
The following works with the API key (as shown in the docker example): hookdeck ci --api-key $HOOKDECK_API_KEY
hookdeck listen $PORT $SOURCE_NAME $CONNECTION_NAME --cli-path /webhook That said, #89 does highlight unexpected behavior. |
Perfect, that's what we want
Yes, I'm answering on the issue itself - this works because ci creates a cli user. It's janky though because the user won't see the session in their dashboard - it'll fall back eventually because we look for connected sessions and assign one, nit it's not "clean" |
The interactive prompts for the connection label/name and the CLI path are confusing unless you already understand what the Hookdeck mental model of Source -> Connection -> Destination. Why force this mental model upon developers? Instead, use some sensible defaults and allow the connection name and CLI path to be optionally passed for use when developers need or want to understand the mental model.
New defaults
cli
(Note: The SDK doesn't allow->
in the name or I'd have used{source} -> {destination}
). We could instead use{source}-to-{destination}
/
, which also means that the default functionality matches that of ngrokThe quickstart command will now be the following and will require no interaction within the terminal:
We could have a default for the Source name. However, I don't know what this would be, and thinking about where the event is coming from is a reasonable step towards the Hookdeck mental model.
Behavior
For Old = New behavior, ✅ indicates the behavior has not changed.⚠️ indicates a change in behavior.
hookdeck listen {port}
hookdeck listen {port} {source}
hookdeck listen {port} {source}
{source}
and all CLI Destinations.{source}
and all CLI Destinations.hookdeck listen {port} {source} --cli-path /webhooks
/webhooks
as path all other default details.hookdeck listen {port} {source} --cli-path /webhooks
{source}
and a CLI Destination. If existing Destination CLI path differs from/webhooks
it updates the Destination. If more than one matching connection is found, asks the user to specify a connection (see Note 1).hookdeck listen {port} {source} {connection}
/webhooks
as path and{connection}
as connection name.hookdeck listen {port} {source} {connection}
hookdeck listen {port} {source} {connection} --cli-path /webhooks
{connection}
with default Connection and Destination name but with/webhooks
as path.hookdeck listen {port} {source} {connection} --cli-path /webhooks
{connection}
between{source}
and a CLI Destination. If existing Destination CLI path differs from/webhooks
it updates the Destination CLI path. If more than one matching connection is found, asks the user to specify a connection (see Note 1).Note 1
DEBUG output only present due to `--log-level debug' flag.