-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[public-api] User service #14496
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
[public-api] User service #14496
Conversation
@easyCZ Could you have a look whether proposed APIs sound good to you? Or you will model them differently? |
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.
Broadly, this makes sense.
Worth asking the question whether SSH Keys strictly live on a User level, or if they could live seperately, or on a team. If that's the case, you'd then create a SSHKeyService
rather than embed it on the user.
For these definitions, are you looking to implement all of them? Or are you defining them for completeness but would only use a subset of them? |
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.
For the ssh methods only need the list ssh keys, others are just there for completeness |
started the job as gitpod-build-jp-user-service.4 because the annotations in the pull request description changed |
// SendHeartbeat sends a heartbeat signal to a running workspace. | ||
rpc SendHeartbeat(SendHeartbeatRequest) returns (SendHeartbeatResponse) {} | ||
|
||
// SendCloseHeartbeat sends a close heartbeat signal to a running workspace. | ||
rpc SendCloseHeartbeat(SendCloseHeartbeatRequest) returns (SendCloseHeartbeatResponse) {} |
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.
FWIW, I'm not convinced these should exist on the Public API, at least not on the Workspace Service. Why? Because these are not directly usable by our users, and are mostly an implementation detail of how we communicate with the rest of the system.
I think these are a good use-case for a private API package which still benefits from the API quality aspects, but doesn't actually get exposed to the public users.
For now, we can keep them here but when we move the APIs to the "stable" package, I wouldn't include them.
Maybe we can for now move them under a WorkspaceInstance
service, or something closer related to IDE behaviour, rather than a Workspace behaviour and properties. What do you think?
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.
For now we can move it to some experimental service like IDEWorkspaceInstanceService.
In future we would like to allow 3rd party IDEs, instead of dealing with supporting each of it. It is part of our long term motivation in Public API then integrators should be able to report heartbeating and closing.
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.
Got it. Perhaps WorkspaceIDEService
makes sense for that use-case
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.
In general, I'd like each service to be as minimal as possible, with additional services possibly layering on top and composing the basic services. Here, I'd see it as IDEWorkspaceService
-> WorkspaceService.GetWorkspace
-> use that info to do something to the instance for example
message SendHeartbeatRequest { | ||
string workspace_id = 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.
If we extend this struct with, we can avoid having an RPC for every property in our domain model
message SendHeartbeatRequest { | |
string workspace_id = 1; | |
} | |
message SendHeartbeatRequest { | |
string workspace_id = 1; | |
// indicates this is the terminal heartbeat and no further ones will be sent. This happens when the IDE closes. | |
bool terminal = 2; | |
} |
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.
Could you elaborate which property?
We would like to split 2 different functions SendHearbeat
and report that a client closed. Before it was mixed in one but turned out to be orthogonal things from client perspective.
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.
If they are orthogonal, then that's fine and should be seperate RPCs. From the implementation it did look like they are coupled but I don't know your domain that well so that makes sense.
Let's try to land some of this. Ideally, we would split up the PRs into:
Could we remove the changes to the workspace service from this PR (and push into a new one) and we can land this as is with the User Service? |
rpc SendHeartbeat(SendHeartbeatRequest) returns (SendHeartbeatResponse) {} | ||
|
||
// SendCloseHeartbeat sends a close heartbeat signal to a running workspace. | ||
rpc SendCloseHeartbeat(SendCloseHeartbeatRequest) returns (SendCloseHeartbeatResponse) {} |
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 would call it SendClose
or SendCloseSignal
. The point is that it is not heartbeating fiction anymore.
That's all experimental and there can be follow up issues to address API and implementation? Nobody is using it right now? Should not we rather approve, merge and go via this loop to let @jeanp413 iterate faster? |
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.
Sure, let's land as is. But please do follow-up on moving the Heartbeat methods into a different service.
54d24a0
to
12731f6
Compare
started the job as gitpod-build-jp-user-service.8 because the annotations in the pull request description changed |
/werft run 👍 started the job as gitpod-build-jp-user-service.9 |
/unhold |
Description
Implements user service and remaining methods needed for complete migration in gitpod-desktop extension
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide