URL for workspaces
Problem statement
How are we exposing the WebIDE connected to a remote server on the browser?
Context
The following is our current understanding of how things will work or how they are working in the spike
Currently, the WebIDE for a project(say gitlab-org/gitlab
) is exposed on the URL https://gitlab.com/-/ide/project/gitlab-org/gilab
. The workspace that will be created will have an editor injected in it(let's say the editor is exposed on port 3000) whose URL would be something like <port>-<workspace_name>.<ga4k_agent_id_or_name>.<common_suffix>
. <common_suffix>
can be gitlab.io
or gitlab.com
or anything else. We will be generating a TLS certificate of *.<ga4k_agent_id_or_name>.<common_suffix>
for each GA4K agentk and the certificate will be available on the kubernetes cluster for decrypting traffic.
Possible solution
Solution 1
- The remote workspace exposes the endpoints as
<port>-<workspace_name>.<ga4k_agent_id_or_name>.<common_suffix>
- Use the WebIDE URL for the workspace i.e.
https://gitlab.com/-/ide/project/gitlab-org/gilab/-/workspace/<workspace_name>/
-> this will automatically connect to port3000
in the given workspace where the editor is exposed. The browser will still show the URLhttps://gitlab.com/-/ide/project/gitlab-org/gilab/-/workspace/<workspace_name>/
Solution 2 - Refer this comment to understand why this is not feasible
- The remote workspace exposes the endpoints as
<port>-<workspace_name>.<ga4k_agent_id_or_name>.<common_suffix>
- The browser URL for viewing an application on any port in the workspace, would be
https://gitlab.com/-/ide/project/gitlab-org/gilab/-/workspace/<workspace_name>/<port>/
which will correspond to<port>-<workspace_name>.<ga4k_agent_id_or_name>.<common_suffix>
. - The browser URL for viewing the editor(exposed on port 3000) in the workspace, would be
https://gitlab.com/-/ide/project/gitlab-org/gilab/-/workspace/<workspace_name>/3000/
.
Solution 3
- The remote workspace exposes the endpoints as
<port>-<workspace_name>.<ga4k_agent_id_or_name>.<common_suffix>
- The browser URL for viewing the editor(exposed on port 3000) in the workspace, would be
3000-<workspace_name>.<ga4k_agent_id_or_name>.<common_suffix>
.
Solution 4
... ?
Things to consider
- How each solution can be restrictive/problematic for the user developing in the workspace?
- User experience
- Technical challenges
Historically, we thought about URL for workspace in #371968 (closed)