Skip to content
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

[papi] Add UserService/UpdateUser to proto #19163

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions components/public-api/gitpod/v1/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,69 @@ option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1";
service UserService {
// GetAuthenticatedUser allows to retrieve the current user.
rpc GetAuthenticatedUser(GetAuthenticatedUserRequest) returns (GetAuthenticatedUserResponse) {}

// UpdateUser updates the properties of a user.
rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) {}

// SetWorkspaceAutoStartOptions updates the auto start options for the Gitpod Dashboard.
// +internal - only used by the Gitpod Dashboard.
rpc SetWorkspaceAutoStartOptions(SetWorkspaceAutoStartOptionsRequest) returns (SetWorkspaceAutoStartOptionsResponse) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this method? I thought autoStart option is not useful, and can cause some confuse for me (Once saw that we want to remove it, I'm happy with that Closed PR XD, but closed already).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not aware of removing auto start. Do we have an issue or any discussion on that?

Copy link
Contributor

@mustard-mh mustard-mh Nov 29, 2023

Choose a reason for hiding this comment

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

Sorry @AlexTugarev , this is not-blocking comment.

This is the PR to remove auth start option. I'm not clear if we want to keep it or remove it.

update: I just prefer to remove the auto start options

Copy link
Member Author

Choose a reason for hiding this comment

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

It's still used to preserve the options for the next workspace start.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, there is the autostart options to the prefixed URL.

}

message GetAuthenticatedUserRequest {}
message GetAuthenticatedUserResponse {
User user = 1;
}

message SetWorkspaceAutoStartOptionsRequest {
string user_id = 1;
repeated WorkspaceAutostartOption workspace_autostart_options = 2;
message WorkspaceAutostartOption {
string clone_url = 1;
string organization_id = 2;
optional string workspace_class = 3;
optional EditorReference editor_settings = 4;
optional string region = 5;
}
}
message SetWorkspaceAutoStartOptionsResponse {}

message UpdateUserRequest {
string user_id = 1;
optional string name = 2;
optional string accepted_privacy_policy_date = 3;
optional ProfileDetails profile = 4;
akosyakov marked this conversation as resolved.
Show resolved Hide resolved
message ProfileDetails {
optional string last_updated_details_nudge = 1;
optional string accepted_privacy_policy_date = 2;
optional string company_name = 3;
optional string email_address = 4;
optional string job_role = 5;
optional string job_role_other = 6;
repeated string exploration_reasons = 7;
repeated string signup_goals = 8;
optional string signup_goals_other = 10;
optional string onboarded_timestamp = 11;
optional string company_size = 12;
}
optional string email_address = 5;
optional EditorReference editor_settings = 6;
optional EmailNotificationSettings email_notification_settings = 7;
message EmailNotificationSettings {
optional bool allows_changelog_mail = 1;
optional bool allows_devx_mail = 2;
optional bool allows_onboarding_mail = 3;
}
optional WorkspaceTimeoutSettings workspace_timeout_settings = 8;
message WorkspaceTimeoutSettings {
optional google.protobuf.Duration inactivity = 1;
optional bool disabled_disconnected = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

we have another workspace timeout in Refind workspace proto PR https://github.com/gitpod-io/gitpod/pull/19138/files#diff-393d8178f08b8814eea780cf779ac93bc55fd0b90588e907a825cbb51de9f33aR250

Should them be aligned?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's align them in implementation PR.
TBH, this is already confusing enough. Changed that already twice, and it's unclear how to map them. In the beginning we'll need to map them in order to maintain compatibility in FE shim, right?

Here I did the bare minimum for the conversion.
https://github.com/gitpod-io/gitpod/pull/19142/files#diff-8fdb520274403fe903bd0ad9c9094f3951b4940b9cf838aa5c36b6548f9aafbdR964-R967

Happy to align, if there is an example for the conversion available.

}
}
message UpdateUserResponse {
User user = 1;
}

message User {
// id is a UUID of the user
string id = 1;
Expand Down
Loading
Loading