Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Auto-forward all workspace open ports when using Latest JetBrains IDEs #11081
Changes from all commits
0dfbc7d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
How could this happen😂
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.
note: ipv6
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.
see https://pl.kotl.in/ERWpCkfaW this case.
"http://[::1]:8080"
is not covered? addr should be::1
and port8080
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.
Nice catch!
I've added a unit test for it!
They can be run with
./gradlew test
(when insideide/jetbrains/backend-plugin
folder) or via IDE UI:ℹ️ This function is a translation of this JavaScript function.
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.
@akosyakov, that's a good question from @mustard-mh: why is it removing the last 2 characters instead of removing just the last one (
]
) here?And wouldn't it be better to return the full hostname, like URL returns?
Currently the code is returning
{address: "::", port: 8080}
forhttp://[::1]:8080/
.Should we change it (in Kotlin code from this PR) to return "[::1]"?
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.
I don't remember no, but looking at your client it does not seem to be matter. You don't use address anyway.
What you should understand here though, that the same port can be served on ip4 and ip6 at the same time as far as I remember then on client machine depending on the host there should be different ports too. I think it is worth to create a follow-up issue to consider it, and discuss with JB how to handle such cases. But it should NOT block this PR.
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.
We don't need
while
andsleep
here since use observe from grpc below(.setObserve(true)
). Just observe one time, and it'll keep response data.See also the implement
gitpod/components/supervisor/pkg/supervisor/services.go
Line 205 in 151ed2c
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.
Hmm, that
while
has a different function. It's there to cover the case where the user loses connection temporarily. So while the IDE is opened, it should keep trying to reconnect to Supervisor.Do you think we can conver this case using only PortStatus?
But even so, we'd need to keep a cooldown before trying to connect again, so I think 1sec interval is ok.
We've been using this logic in all other classes (from JetBrains plugin) that requires waiting for reconnection.