Poll for Connect My Computer node in the Discover flow#34401
Poll for Connect My Computer node in the Discover flow#34401
Conversation
dc11589 to
0ec9a23
Compare
gzdunek
left a comment
There was a problem hiding this comment.
Instead, we just poll for nodes labeled with teleport.dev/connect-my-computer/owner: . The first response fills out a set with node IDs. Subsequent requests compare the received nodes against this set and return the first node not found in the set.
👍 👍
| <Text> | ||
| The computer you are trying to add has already joined the | ||
| Teleport cluster before you entered this page. | ||
| </Text> |
There was a problem hiding this comment.
if this is the case, can the user just exit this page? like setup is complete? (i'm asking because this text feels incomplete, like "tell me what to do")
coming in blind, i got confused what setting up teleport connect had to do with pinging. i'm sorry, i should've questioned it from your first PR.
The first step says:
Teleport Connect is a native desktop application for browsing and accessing your resources.
It can also connect your computer as an SSH resource and scope access to a unique role so it is not automatically shared with all users in the cluster.
I think the flow is doing this right? -> It can also connect your computer as an SSH resource (which was confusing because it sounded like an optional thing we can do)
I think we should clarify the title of this flow to be something like Connect your computer as an SSH resource using Teleport Connect
I know these weren't your wordings (and also not a blocker), but just some feedback as someone coming in kinda blind (first impression with little connect experience).
There was a problem hiding this comment.
if this is the case, can the user just exit this page? like setup is
complete? (i'm asking because this text feels incomplete, like "tell me what to do")
Good point. Yeah, they can exit the page. I suppose I could ask something like "If that's the case, go back to the resources to connect to it." and maybe even link to the resources page. I don't know how we usually refer to the resources page in the UI hence just "the resources" in my proposed message.
coming in blind, i got confused what
setting up teleport connecthad to do withpinging. i'm sorry, i should've questioned it from your first PR.
Does that mean there are things I should further clarify? 😶🌫️ Or did I not explain the purpose behind the flow clearly enough but after reading the code you get how pinging is related to this step? Or is the feedback completely from the perspective of a user?
I think the flow is doing this right? ->
It can also connect your computer as an SSH resource(which was confusing because it sounded like an optional thing we can do)
Yes, the flow is for connecting your computer to the cluster as an SSH resource by using Teleport Connect to do this. I see how it can sound like something optional. I guess what we tried to capture here is a general description of what Connect is for and that it's not only for adding your computer to the cluster, or perhaps that it's not the main feature of the app, but we're going to use it to connect the computer to the cluster. I can talk with Kenny about this.
I think we should clarify the title of this flow to be something like
Connect your computer as an SSH resource using Teleport Connect
By the title of this flow you mean the current <Header>Set Up Teleport Connect</Header> or the title of this step in the flow?
There was a problem hiding this comment.
Or is the feedback completely from the perspective of a user?
This.
By the title of this flow you mean the current
Set Up Teleport Connect or the title of this step in the flow?
The header. B/c it's so much bigger it grabs my attention and i may or may not have read the other smaller texts lol, so it just sounded like download connect and run it but we are doing more than that.
idk maybe it's just me and how weirdly i interpret things 🤷♀️
|
@ravicious See the table below for backport results.
|
Part of #32192.
Figma
This PR implements the happy path for polling for a node during the Connect My Computer flow in Discover. It does not implement the second step, it also doesn't handle an edge case where for certain role setups the user needs to refresh the role list to be able to even see the node. Those cases will be addressed by another PR.
The video looping video shown in the Figma designs is yet to be recorded. I'm going to reorganize the setup of Connect My Computer in Connect soon so I want to avoid having to record the video twice.
The original idea for polling
Originally the idea was to make it so that Connect configures the agent with a hidden label that contains the timestamp at which the agent was configured. Then when the guided flow gets opened, the Web UI would capture a timestamp and poll for nodes created only after the flow was started.
However, there are two problems with that:
What actually got implemented
Instead, we just poll for nodes labeled with
teleport.dev/connect-my-computer/owner: <current-username>. The first response fills out a set with node IDs. Subsequent requests compare the received nodes against this set and return the first node not found in the set.The end result for the most part is the same: the guided flow will detect a Connect My Computer node that has joined the cluster after the flow has started.
The comment for
usePollForConnectMyComputerNodeexplains why we cannot do the polling the same way as when adding a regular SSH node through discover.