Skip to content
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

Enable VS Code Desktop for stable VS Code Web #5599

Merged
merged 3 commits into from
Sep 10, 2021
Merged

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Sep 8, 2021

  • /werft with-clean-slate-deployment

Description

How to test

Release Notes

VS Code Desktop support

@akosyakov akosyakov force-pushed the ak/stable_code_desktop branch 2 times, most recently from 2f069ca to 1ffefe5 Compare September 8, 2021 11:37
Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Hey @akosyakov!

🅰️ On the first run, the auth page for the local control client popped up. Clicked CANCEL on purpose and show some lopping logs retrying to connect. See screenshot below.

Auth page Output logs
Screenshot 2021-09-08 at 3 00 41 PM (2) Screenshot 2021-09-08 at 3 01 52 PM

🅱️ Tried reinstalling the Gitpod extensions and closing remote connections before trying again. VS Code (Stable) worked. VS Code (Insiders) still tries to connect to Gitpod workspace. 💿

@aledbf
Copy link
Member

aledbf commented Sep 8, 2021

It works. My only comment is that the window Authorize Gitpod local control client remains open after the authorization.

@akosyakov
Copy link
Member Author

akosyakov commented Sep 9, 2021

My only comment is that the window Authorize Gitpod local control client remains open after the authorization.

I think it is a minor and can be addressed later. But please file an issue. 🙏

@akosyakov
Copy link
Member Author

akosyakov commented Sep 9, 2021

@rl-gitpod When a user clicks Cancel on the authorization screen, there is never redirect to the local app endpoint becuase of this code:

if (!rt || !rt.startsWith("http://localhost:")) {
log.error(`/oauth/authorize: invalid returnTo URL: "${rt}"`)
res.sendStatus(400);
return false;
}
Do you know why we need this check?

URL is like that: https://ak-stable-code-desktop.staging.gitpod-dev.com/api/oauth/authorize?client_id=gplctl-1.0&code_challenge=0osuufJUNGmklz-Bk8bBjL-qhu2kb2L8ewPxTt-bvxo&code_challenge_method=S256&redirect_uri=http%3A%2F%2F127.0.0.1%3A63119&response_type=code&scope=function%3AgetGitpodTokenScopes+function%3AgetWorkspace+function%3AgetWorkspaces+function%3AlistenForWorkspaceInstanceUpdates+resource%3Adefault&state=state&approved=no

Updated: we switched to 127.0.0.1 instead of localhost for security reasons in #4267, but did not updated the server code. ✅

@roboquat roboquat added size/S and removed size/XS labels Sep 9, 2021
@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #5599 (9c4bd51) into main (f4e8f03) will decrease coverage by 0.34%.
The diff coverage is 0.00%.

❗ Current head 9c4bd51 differs from pull request most recent head f9ad70c. Consider uploading reports for the commit f9ad70c to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5599      +/-   ##
==========================================
- Coverage   19.39%   19.04%   -0.35%     
==========================================
  Files           2        2              
  Lines         165      168       +3     
==========================================
  Hits           32       32              
- Misses        131      134       +3     
  Partials        2        2              
Flag Coverage Δ
components-local-app-app-linux 19.04% <0.00%> (-0.35%) ⬇️
components-local-app-app-windows ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/local-app/pkg/auth/auth.go 16.17% <0.00%> (-0.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4e8f03...f9ad70c. Read the comment docs.

@akosyakov
Copy link
Member Author

Now it tries to auth again and again if a user cancelled, we need a way to communicate it to the extension that it stops.

@roboquat roboquat added size/M and removed size/S labels Sep 9, 2021
@roboquat roboquat added size/S and removed size/M labels Sep 9, 2021
@akosyakov akosyakov marked this pull request as ready for review September 9, 2021 09:53
@akosyakov
Copy link
Member Author

@gtsiolis Could you update Gitpod extension in your local VS Code and try again both scenarios?

@gtsiolis
Copy link
Contributor

gtsiolis commented Sep 9, 2021

Looking at this now! 👀

@gtsiolis
Copy link
Contributor

gtsiolis commented Sep 9, 2021

/werft run

👍 started the job as gitpod-build-ak-stable-code-desktop.13

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

@akosyakov Flawless! 🔮

🅰️ Clicking CANCEL on the auth page also stopped the local companion app and I was able to retry and successfully authorize. ✔️
🅱️ I was also able to succesfully load workspaces in both local VS Code and VS Code Insiders. 🌟

Three (3) minor observations:

  1. On the first run when the local companion app starts up it takes 15-20 seconds to create the new remote connection. Next workspaces connect instantly. Expected?
  2. The local companion app process remains up and running even if you stop the workspace, close the remote connection, or terminate VS Code. Expected?
  3. I get two distinct local companion app processes for VS Code and VS Code Insiders but that's probably expected, right?

Screenshot 2021-09-09 at 5 27 52 PM

@akosyakov
Copy link
Member Author

On the first run when the local companion app starts up it takes 15-20 seconds to create the new remote connection. Next workspaces connect instantly. Expected?

Unfortunately, yes. Since VS Code Remote Development has to provision VS Code Server into a Gitpod workspace. Depending on your internet connection it can take a while. Alternatively we could reuse already running by us server, but that is not really aligned with existing users expectations and quite a different approach, see https://gitpod.slack.com/archives/C01KGM9DVRC/p1631077187068000 (internal link)

The local companion app process remains up and running even if you stop the workspace, close the remote connection, or terminate VS Code. Expected?

It is expected, since it is a daemon which is reused across all VS Code sessions and Gitpod workspaces.

I get two distinct local companion app processes for VS Code and VS Code Insiders but that's probably expected, right?

In future we maybe be able to do something about it, like discover running daemons via the special file, like suggested here for instance: #5602

@akosyakov
Copy link
Member Author

/approve no-issue

@akosyakov
Copy link
Member Author

/assign @csweichel @JanKoehnlein Could you approve please to merge it?

@JanKoehnlein
Copy link
Contributor

/approve no-issue
/lgtm

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: ac0a77f821aac4b516e021338de7df44b6b02a61

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akosyakov, JanKoehnlein

Associated issue requirement bypassed by: akosyakov, JanKoehnlein

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit 8bfcfcb into main Sep 10, 2021
@roboquat roboquat deleted the ak/stable_code_desktop branch September 10, 2021 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants