Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

impl: support uri handling#35

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fioan89 merged 17 commits intomainfromimpl-support-for-uri
Mar 21, 2025
Merged

impl: support uri handling#35

fioan89 merged 17 commits intomainfromimpl-support-for-uri
Mar 21, 2025

Conversation

fioan89
Copy link
Collaborator

@fioan89fioan89 commentedMar 13, 2025
edited
Loading

  • reacts to URIs in the form of :jetbrains://gateway/com.coder.toolbox?url=https%3A%2F%2Fdev.coder.com&token=....&workspace=bobiverse-bill
  • query parameters likeurl,token andworkspace are mandatory. A fallback implementation is now provided where we ask for these parameters in case they were missing
  • support for handling workspace from a Coder deployment that is not yet configured in the Toolbox.
  • resolvesAdd support for URI handling #37

- reacts to uris like: jetbrains://gateway/com.coder.toolbox?url=https%3A%2F%2Fdev.coder.com&token=....&workspace=bobiverse-bill- the handling still does not work correctly when Toolbox is already running.
@fioan89fioan89 changed the titleimpl: support uri handling (1)impl: support uri handlingMar 14, 2025
- reworked the main env provider to be able to close all existing resources and re-initialize with a different deployment- the re-initialization is needed in order to navigate to an env page with the targeted workspace. If the workspace is not from the current deployment there will be no env page to navigate to.
- a pop-up dialog is displayed asking for the deployment URL- an error dialog is displayed if the URL is still not provided by the user
- the existing code was trying indefinitely to ask for token until the user gets it right.  This is not a bad idea, however Toolbox has a couple of limitations that make the existing  approach almost unusable:  - the input dialog doesn't allow custom actions through which we can spawn a browser at login page.  The code always opened the login page when the token was wrong which ended up hammering the browser  with too many tabs.  - the token UI page can't be reused to request the login page (this one has a "Get token" action button)  because once the user clicks on the Get token to open the webpage, Toolbox closes the window and forgets  the last UI page that was visible. - instead with this patch we ask the token from the user only once. If something goes wrong (mostly during login)   we show an error dialog and stop the flow.
- the error is also displayed when the workspace with the name does not exist
- starts and waits for the workspace to be running before showing the env page- improved error handling
- a service which orchestrates the IDE install, opening projects and so on
- when opening a URI, multiple polling jobs could be triggered on different  Coder deployments if Toolbox starts from scratch. This happens because Toolbox  takes longer to complete its initial plugin initialization, while the URI  handling logic runs faster and doesn't wait properly for the plugin to be ready,  leading to an early polling job. Meanwhile, once Toolbox finishes its initialization,  it also triggers another polling job.- this patch properly waits for the plugin initialization and properly cancel the initial  polling job, which is then replaced by the URI handling polling job.
@fioan89fioan89 marked this pull request as ready for reviewMarch 20, 2025 09:59
- it's optional- `project_path` is the query param
- currently the uri handling waits for the plugin to fully initialize i.e. to sign in to the coder deployment  and have the list of workspaces retrieved.- this is done in order to avoid scenarios were uri handling moves faster than autologin and polling and potentially  ending up with more than one polling job- however if there is a manual login flow (for example if the user logs from the coder deployment we no   longer autologin at the next startup) we don't have to wait for the initial polling job to be initialized.
// If downloads are enabled download the new version.
if (settings.enableDownloads) {
indicator?.invoke("Downloading Coder CLI...")
context.logger.info("Downloading Coder CLI...")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

should we also log what version of CLI is being downloaded and the source URL?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is usinghttps://dev.coder.com/bin/ to download the binary, and it doesn't contain the version. I think the version can be resolved only after running the cli, which means much later than this log.

@matifalimatifali requested review fromf0ssel and removed request forbcpeinhardtMarch 21, 2025 11:36
@fioan89fioan89 merged commitc56250a intomainMar 21, 2025
3 checks passed
@fioan89fioan89 deleted the impl-support-for-uri branchMarch 21, 2025 22:43
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@matifalimatifalimatifali approved these changes

@f0sself0sselAwaiting requested review from f0ssel

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add support for URI handling
2 participants
@fioan89@matifali

[8]ページ先頭

©2009-2025 Movatter.jp