coder / jetbrains-coder

A JetBrains Plugin for Coder Workspaces
MIT License
24 stars 11 forks source link

Improve Gateway link handling #292

Open code-asher opened 1 year ago

code-asher commented 1 year ago

An initial implementation was added which should work for the main case (a link from a running workspace on the dashboard) but it would be helpful to add a few more things to handle more cases. Also, this functionality should be applied to the recents menu as well, since we would benefit from things like starting workspaces automatically when coming from that menu.

MoeRT09 commented 12 months ago

Would it be possible to open a folder selector if the "folder" parameter is omitted? This would make it much easier to select a different folder then the home directory as the project root.

code-asher commented 12 months ago

Yup, I would like to add that as well.

matifali commented 11 months ago

@code-asher Why do we need an agent name? Can't we only pass agent_id?

code-asher commented 11 months ago

I have no idea, can coder ssh take agent IDs? I would imagine the names are more human-readable anyway. Or if we get an agent ID we can probably look it up in the plugin and translate to an agent name.

Is there a specific use case you trying to solve by passing Gateway an ID instead of a name? Does the template only give you access to the ID or something like that?

matifali commented 11 months ago

@code-asher See these here for example, We need both the agent_id and name to create the coder_app

https://github.com/coder/modules/blob/abb51a37e1564ea554144beb4fd9d5fb22f28085/jetbrains-gateway/main.tf#L126

I was hoping we could get the agent name from the agent ID somehow.

code-asher commented 11 months ago

Oh, I see. Yeah we can make it take either an ID or a name. I will add it to the list!

matifali commented 11 months ago

@code-asher @mafredri also mentioned here why we need both the id and name. Our current implementation of the jetbrains_gateway module also uses both the name and the id. I think we should remove the name.

code-asher commented 11 months ago

It should be easy enough, we already query all the agents so we can just get the name by ID from that API response.