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

JB gateway plugin #7362

Merged
merged 6 commits into from
Jan 27, 2022
Merged

JB gateway plugin #7362

merged 6 commits into from
Jan 27, 2022

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Dec 25, 2021

Description

This PR refactors JB integration to leverage SSH Gateway and enable client-to-server flow from JB Gateway, particularly:

  • fixing JB backend plugin
    • remove dependencies, since JB backend already has Kotlin dependencies, and adding other version leads to runtime incompatibilities
    • fix memory leak of grpc message channels
    • use Kotlin koroutines instead of dedicated thread for heartbeating
    • implement web socket reconnection handling for Gitpod server connection
    • pin java target to v.11 in all projects
  • initial Gitpod plugin for JB Gateway that provides:
    • connection over SSH gateway for jetbrains-gateway://connect?gitpodHost=<gitpodHost>&workspaceId=<workspaceId> links
    • initial implementation of Gitpod UI in JB Gateway, i.e. welcome screen and recent projects view
  • switch JB images to use JB Gateway with Gitpod plugin in order to establish connection over SSH gateway not CWM links
  • add JB Plugins as client types for server tracing
  • resume hearbeating if window unload was cancelled in supervisor frontend on redirection to JB Gateway

Related Issue(s)

Fixes #5644, #7524

How to test

From Gitpod:

From Gateway:

  • If you did above and everything was clear by now you should have JB Gateway installed.
  • Preferences... -> Tools -> Gitpod and point Gitpod Host to ak-jb-gateway-plugin.staging.gitpod-dev.com
  • Try to use Gateway to start workspaces from there using Gitpod UI.

Release Notes

- Refactor JB integration to connect over SSH instead of CWM links.
- Provide Gitpod integration in JB Gateway.

Documentation

@akosyakov
Copy link
Member Author

akosyakov commented Dec 28, 2021

/werft run

👍 started the job as gitpod-build-ak-jb-gateway-plugin.5

@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch 3 times, most recently from 266a382 to 61560f4 Compare December 29, 2021 10:26
@roboquat roboquat added the team: workspace Issue belongs to the Workspace team label Dec 29, 2021
@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch 2 times, most recently from 266a382 to 1e83ff3 Compare December 29, 2021 10:31
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch from 1e83ff3 to e21109e Compare December 29, 2021 10:31
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch from e21109e to 8b6b98f Compare December 29, 2021 10:33
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch from 8b6b98f to 220bba4 Compare December 29, 2021 10:56
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch from 220bba4 to 91df848 Compare December 29, 2021 11:04
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

3 similar comments
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@codecov
Copy link

codecov bot commented Dec 29, 2021

Codecov Report

Merging #7362 (a6764c4) into main (499ac3a) will decrease coverage by 1.26%.
The diff coverage is n/a.

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

@@            Coverage Diff             @@
##             main    #7362      +/-   ##
==========================================
- Coverage   11.46%   10.20%   -1.27%     
==========================================
  Files          20       18       -2     
  Lines        1177     1009     -168     
==========================================
- Hits          135      103      -32     
+ Misses       1039      905     -134     
+ Partials        3        1       -2     
Flag Coverage Δ
components-gitpod-cli-app 10.20% <ø> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?

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
components/local-app/pkg/auth/pkce.go

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 499ac3a...3953a45. Read the comment docs.

@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@roboquat roboquat added the lgtm label Jan 27, 2022
@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6568acefb0ea896c8298dd934c22e349a00b735b

@iQQBot
Copy link
Contributor

iQQBot commented Jan 27, 2022

I have tested this several times, including

  1. repeatedly opening/closing
  2. installing plug-ins that require a restart (Gateway will disconnect after 10 seconds of restart and then will not try to reconnect, but will need to open the connection page again or open again from the most recent connection, but this should not affect the process)
    Looks good

@akosyakov
Copy link
Member Author

akosyakov commented Jan 27, 2022

@iQQBot @mustard-mh thank you, i asked to approve the current version of the plugin then

installing plug-ins that require a restart (Gateway will disconnect after 10 seconds of restart and then will not try to reconnect, but will need to open the connection page again or open again from the most recent connection, but this should not affect the process)

🙏 I will check it, something what I overlooked.

@akosyakov
Copy link
Member Author

akosyakov commented Jan 27, 2022

Gateway will disconnect after 10 seconds of restart and then will not try to reconnect, but will need to open the connection page again or open again from the most recent connection, but this should not affect the process

I could not reproduce. Maybe I need to throttle my connection for that, i.e. it is not reproducible on stable connection with low latency. Let's wait for issues from users then.

@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch from 30254ab to a132d6b Compare January 27, 2022 07:57
@roboquat roboquat removed the lgtm label Jan 27, 2022
@roboquat
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yml was changed and it might be harmful.

- remove dependencies, since JB backend already has Kotling dependencies, and adding other version leads to runtime incompatibilities
- fix memory leak of grpc message channels
- use Kotlin koroutines instead of dedicated thread for heartbeating
- implement web socket reconnection handling for Gitpod server connection
- pin java target to v.11 in all projects
@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch from a132d6b to 903df7d Compare January 27, 2022 08:14
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yml was changed and it might be harmful.

@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch from 903df7d to dc65db3 Compare January 27, 2022 08:21
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yml was changed and it might be harmful.

It provides:
- connection over SSH gateway for jetbrains-gateway://connect?gitpodHost=<gitpodHost>&workspaceId=<workspaceId> links
- initial implementaiton of Gitpod UI in JB Gateway, i.e. welcome screen and recent projects view
in order to estable connection over SSH gateway not CWM links
@akosyakov akosyakov force-pushed the ak/jb_gateway_plugin branch from dc65db3 to 3953a45 Compare January 27, 2022 08:31
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yml was changed and it might be harmful.

@akosyakov
Copy link
Member Author

/unhold

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: iQQBot, jankeromnes

Associated issue: #5644

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 84a496d into main Jan 27, 2022
@roboquat roboquat deleted the ak/jb_gateway_plugin branch January 27, 2022 09:15
@roboquat roboquat added the deployed: workspace Workspace team change is running in production label Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: workspace Workspace team change is running in production release-note size/XXL team: delivery Issue belongs to the self-hosted team team: IDE team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Jetbrains' remote development server-to-client flow (remove code with me relay)
6 participants