-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[public-api] define endpoints for ports and git token #15110
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
Conversation
7b758df
to
f19d682
Compare
87da101
to
1d18114
Compare
@@ -249,12 +251,37 @@ message WorkspaceInstanceStatus { | |||
// Admission describes who can access a workspace instance and its ports. | |||
AdmissionLevel admission = 6; | |||
|
|||
// ports is the list of served ports in the workspace. |
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.
Exposed, not served. It is only about access regardless of whether anyone is listening
@easyCZ could you have a look please? |
@@ -249,12 +251,37 @@ message WorkspaceInstanceStatus { | |||
// Admission describes who can access a workspace instance and its ports. | |||
AdmissionLevel admission = 6; | |||
|
|||
// ports is the list of served ports in the workspace. | |||
repeated Port ports = 7; |
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.
There's a bit of an assymetry here.
ControlPort(ControlPortRequest)
is identified by Workspace ID, but the resulting ports
are shown on the Workspace Instance
. What limits us from putting the Ports on the WorkspaceStatus rather than the WorkspaceInstanceStatus?
// repo details the Git working copy status of the workspace. | ||
// Note: this is a best-effort field and more often than not will not be present. Its absence does not | ||
// indicate the absence of a working copy. | ||
// contentservice.GitStatus repo = 7; | ||
} | ||
|
||
// PortVisibility defines who may access a workspace port which is guarded by an authentication in the proxy | ||
enum PortVisibility { |
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.
enum PortVisibility { | |
enum PortPolicy { |
As it feels more appropriate
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.
Another alternative can be PortPrivacy
. I think it is what VS Code apis are using, i.e. public, private, team, org and so on
@@ -27,6 +27,8 @@ service WorkspacesService { | |||
// NOT_FOUND: the workspace_id is unkown | |||
// FAILED_PRECONDITION: if there's no running instance | |||
rpc StopWorkspace(StopWorkspaceRequest) returns (stream StopWorkspaceResponse) {} | |||
|
|||
rpc ControlPort(ControlPortRequest) returns (ControlPortResponse) {} |
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.
Maybe we can call it CreatePortPolicy
to remain closer to CRUD
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 actually considered to call it UpdatePort
.
message Port { | ||
// port number | ||
uint64 port = 1; | ||
|
||
// visiblity of this port | ||
PortVisibility visibility = 2; | ||
|
||
// url is the outward-facing URL where the port can be accessed on. | ||
string url = 3; | ||
} |
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.
Perhaps it makes sense to have the following objects to structure the request & response:
message PortSpec {
// port number
uint64 port = 1;
// visiblity of this port
PortVisibility visibility = 2;
}
message PortStatus {
// the URL which can be used to access the port
string url = 1;
}
They would then be used in the following:
message Workspace {
...
repeated Port ports = 10;
}
message WorkspaceStatus {
repeated PortStatus ports_status = 10;
}
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'm confused with workspace
and workspace instance
in Public API, we are going to remove the concept of instance
for public API right? @easyCZ
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 will keep it first, and update it in the future if needed
Note: these are suggestions and not necessarily something you are required to do. I'm more than happy to discuss and adjust. I don't always have perfect context on your IDE APIs so some suggestions may not work given the context. |
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.
/hold
I approved that you don't need to wait for another round to merge. But please have look at Milan's comments. As Milan said we don't need to get it yet 100% right, but would be good to move in the right direction.
1d18114
to
1502188
Compare
/unhold |
Description
Define endpoints for ports and git token
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh