-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: send projectId and branchId to Segment #309
Conversation
@PlayLikeNeverB4 this PR also seems to include some commits that are not part of this change |
That's probably my fault, I had to fix main with force-push :3 |
fbc8893
to
ca48d1d
Compare
Fixed it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid that this approach is too unintuitive and new additions may fail to follow it. What about adding this logic to the helper method branchIdFromProps
?
@duskpoet I implemented your suggestion. Also noticed that I needed to treat |
Relates to neondatabase/cloud#20941 Because the `cli_started` event is sent at the beginning we can't know the resource ids. So I added a `cli_command_success` event after the command runs when we have the final context. These will not be sent on error because I couldn't find a way to get the context on error. ### **Examples** `neon branches list` will send `projectId` `neon branches get someid` will send `projectId` and `branchId` `neon branches get main` will send `projectId` and correct `branchId` `branches restore A B` will send `projectId` and `branchId=A` `neon me` will send both as `undefined`
Relates to https://github.com/neondatabase/cloud/issues/20941
Because the
cli_started
event is sent at the beginning we can't know the resource ids.So I added a
cli_command_success
event after the command runs when we have the final context.These will not be sent on error because I couldn't find a way to get the context on error.
Examples
neon branches list
will sendprojectId
neon branches get someid
will sendprojectId
andbranchId
neon branches get main
will sendprojectId
and correctbranchId
branches restore A B
will sendprojectId
andbranchId=A
neon me
will send both asundefined