-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Auto-forward all workspace open ports when using Latest JetBrains IDEs #11081
Conversation
c15b665
to
1535f54
Compare
It is not enough to forward. We should make use of them, in UI elements like notifications. Could you review please the backend for such places and there we use port URL translate them to localhost host if available? |
Understood. In this case, we'll see some files being duplicated (between "stable" and "latest" folders/packages), as port forwarding only works on "latest". I'll leave this PR as a Draft while I update it. |
8d46cfa
to
54943c3
Compare
Updated! It's ready for review again! |
.../ide/jetbrains/backend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/GitpodCLIService.kt
Outdated
Show resolved
Hide resolved
...ckend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/GitpodClientProjectSessionTracker.kt
Outdated
Show resolved
Hide resolved
...ckend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/GitpodClientProjectSessionTracker.kt
Show resolved
Hide resolved
...nts/ide/jetbrains/backend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/GitpodManager.kt
Outdated
Show resolved
Hide resolved
1ca27f2
to
e88a000
Compare
e88a000
to
5994e31
Compare
/werft run with-clean-slate-deployment=true 👍 started the job as gitpod-build-felladrin-jb-auto-forward-all-ports-10783.36 |
I've tested a couple of times but I always get the workspace URL instead of localhost. Am I doing something wrong?
I have the latest JetBrains Gateway installed, with the latest gitpod plugin from the marketplace. Any idea, @felladrin? |
when I click on the “Open Browser” link inside the toast notification, it opens the dialog to confirm, where the URL is visible, and the URL is the full workspace, even after confirm, it opens the full URL (Not localhost), so I am still confused. |
True 🤔 Seems the auto-forwarding stopped working. Marking the PR as Draft while I fix it. For the record, here's the error log:
|
5994e31
to
3e940b8
Compare
3e940b8
to
0dfbc7d
Compare
Fixed by wrapping the handling of the status of the ports from GRPC in Lines 75 to 77 in 3e940b8
|
Setting it as Ready for Review again :) And just to rectify what I said before: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested and works as expected 🍪
Description
Auto-forward all workspace open ports when using Latest JetBrains IDEs.
Changes included:
GitpodPortsService
, which is used by both Stable and Latest versions of the Backend Plugin.GitpodPortForwardingService
, which affects only Latest (Unstable) Version of JetBrains IDEs, and controls the auto-forwarding of all ports.GitpodPortsServiceTest
with a function unit test. It can be tested via IDE UI or command line [1].GitpodTerminalService
, as we moved the implementation to forward all ports toGitpodPortForwardingService
.GitpodClientProjectSessionTracker
, which displays notifications about ports that have just been opened, to have the correct localhost URL if the port is being forwarded. (A few other small changes were made on that file, which were suggestions from IntelliJ to improve the code).GitpodCLIService
to rewrite URLs coming fromgp preview
, when the URL is pointing to localhost, for pointing to the correct forwarded port on the client.gp preview http://127.0.0.1:3000
, it should openhttp://127.0.0.1:3001
on the browser.Note: We confirmed with JetBrains that the host used for Forwarded Ports on the client is 127.0.0.1.
Related Issue(s)
Resolves #10783
How to test
sh <(curl lama.sh) -p 8080
)http://127.0.0.1:<forwarded_service_port>/
on your browser.Note:
Release Notes
Documentation
None.
Werft options: