gitpod-io / gitpod

The developer platform for on-demand cloud development environments to create software faster and more securely.
https://www.gitpod.io
GNU Affero General Public License v3.0
12.99k stars 1.25k forks source link

[gp-cli] gp url should respect port forwarding #11849

Open felladrin opened 2 years ago

felladrin commented 2 years ago

While working on Auto-forward all workspace open ports when using JetBrains IDEs #11081, we noticed that the gp preview command is converting any Localhost URL to their respective Remote URL [1].

https://github.com/gitpod-io/gitpod/blob/bffbd3216205d568e9820a7eae30d2af8ea855ba/components/gitpod-cli/cmd/preview.go#L27-L32

We plan to change this behavior by making this conversion on the IDE-level instead of CLI-level. And also planning to do it only when needed, cause it's not always needed.

A sample case where this conversion is not needed is the following: A user with JetBrains IDE starts a service on port 3000, which is automatically forwarded from the server to the user machine. But the user had the port 3000 already occupied by some other process. What JetBrains IDE does in this case is looking for the next free port (3001, for example). So whenever user runs: gp preview http://localhost:3000 it should open http://localhost:3001 on the browser.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.