Skip to content

[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

Merged
merged 1 commit into from
Nov 12, 2022
Merged

[public-api] User service #14496

merged 1 commit into from
Nov 12, 2022

Conversation

jeanp413
Copy link
Member

@jeanp413 jeanp413 commented Nov 8, 2022

Description

Implements user service and remaining methods needed for complete migration in gitpod-desktop extension

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@jeanp413 jeanp413 changed the title User service [public-api] User service Nov 8, 2022
@akosyakov
Copy link
Member

akosyakov commented Nov 8, 2022

@easyCZ Could you have a look whether proposed APIs sound good to you? Or you will model them differently?

Copy link
Member

@easyCZ easyCZ left a 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.

@easyCZ
Copy link
Member

easyCZ commented Nov 8, 2022

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?

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jeanp413 discussed with @easyCZ that you can iterate as you want and ask for guidance, but generally for experimental there are no strict requirements

/hold

please merge when you are comfortable

@jeanp413
Copy link
Member Author

Or are you defining them for completeness but would only use a subset of them?

For the ssh methods only need the list ssh keys, others are just there for completeness

@jeanp413 jeanp413 marked this pull request as ready for review November 11, 2022 07:25
@jeanp413 jeanp413 requested review from a team November 11, 2022 07:25
@jeanp413 jeanp413 requested a review from csweichel as a code owner November 11, 2022 07:25
@github-actions github-actions bot added team: SID team: IDE team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team labels Nov 11, 2022
@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-jp-user-service.4 because the annotations in the pull request description changed
(with .werft/ from main)

Comment on lines 31 to 35
// 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) {}
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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

Comment on lines +94 to +96
message SendHeartbeatRequest {
string workspace_id = 1;
}
Copy link
Member

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

Suggested change
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;
}

Copy link
Member

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.

Copy link
Member

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.

@easyCZ
Copy link
Member

easyCZ commented Nov 11, 2022

Let's try to land some of this. Ideally, we would split up the PRs into:

  1. Just protos, without any implementation. This ensures that we look at the API unbiased on what's possible and focus solely on the UX of the API
  2. Ideally, 1 PR per API Service to further drive that focus.

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) {}
Copy link
Member

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.

@akosyakov
Copy link
Member

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?

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?

Copy link
Member

@easyCZ easyCZ left a 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.

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-jp-user-service.8 because the annotations in the pull request description changed
(with .werft/ from main)

@jeanp413
Copy link
Member Author

jeanp413 commented Nov 12, 2022

/werft run

👍 started the job as gitpod-build-jp-user-service.9
(with .werft/ from main)

@jeanp413
Copy link
Member Author

/unhold

@roboquat roboquat merged commit 5c8f4c1 into main Nov 12, 2022
@roboquat roboquat deleted the jp/user-service branch November 12, 2022 09:34
@jeanp413 jeanp413 mentioned this pull request Nov 13, 2022
4 tasks
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed: IDE IDE change is running in production labels Nov 14, 2022
@roboquat roboquat added the deployed: workspace Workspace team change is running in production label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: public-api deployed: IDE IDE change is running in production deployed: webapp Meta team change is running in production deployed: workspace Workspace team change is running in production release-note-none size/XXL team: IDE team: SID team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants