Add get and update user plugin preferences rpcs#2471
Conversation
| OrganizationRoleSource organization_role_source = 4; | ||
| } | ||
|
|
||
| message UserSelectedPlugin { |
There was a problem hiding this comment.
Is there an existing type for this? What is a user-selected plugin? Needs docs explaining what this is at the minimum
There was a problem hiding this comment.
we can actually dont need this type anymore. Removed.
| string name = 2; | ||
| } | ||
|
|
||
| message UserPluginPreference { |
There was a problem hiding this comment.
What is this? needs docs at the minimum
There was a problem hiding this comment.
That is this used for? The documentation just says what the fields are, I'm not sure what this structure is for, and how it fits into the Buf product.
|
|
||
| message UserPluginPreference { | ||
| string user_id = 1; | ||
| PluginLanguage selected_language = 2; |
There was a problem hiding this comment.
Asymmetry between UserSelectedPlugin having Selected in it vs. this not, likely could be explained by understanding what API is and is for via docs
|
@bufdev cleaned up this PR and added more docs around the new types |
| OrganizationRoleSource organization_role_source = 4; | ||
| } | ||
|
|
||
| // UserPluginPreference is a nested structure that contains the |
There was a problem hiding this comment.
Please use complete sentences (with periods).
| OrganizationRoleSource organization_role_source = 4; | ||
| } | ||
|
|
||
| // UserPluginPreference is a nested structure that contains the |
| message UserPluginPreference { | ||
| // The id of the user | ||
| string user_id = 1; | ||
| // The selected language that the user has indicidated |
There was a problem hiding this comment.
I'm not sure what a preferred language for plugins is. What is this used for? How does this fit into the Buf product?
There was a problem hiding this comment.
This is for the new Generated SDKs tab. We changed the flow so a user first selects their preferred language and then we display a list of plugins pertaining to that language. We want to persist the language and the plugins the user selected so the next time they visit this page we dont need to have them go through the selection process again
There was a problem hiding this comment.
The point here is that any context should be added to the docs - I should be able to read these docs and understand immediately what is going on here.
There was a problem hiding this comment.
Understood. Added a explanation that this type is meant for Generated SDKs.
| } | ||
| // UpdateUserSettings update the user settings including description. | ||
| rpc UpdateUserSettings(UpdateUserSettingsRequest) returns (UpdateUserSettingsResponse); | ||
| // GetUserPluginPreferences gets plugin preferences for the user. |
There was a problem hiding this comment.
plugin preferences is the language and the list of plugins a user has selected in the new Generated SDKs tab
| } | ||
|
|
||
| // UserPluginPreference contains the users selected language as well as a list of plugins selected for that language. | ||
| // This is used for Generate SDKs where the user can choose a language and corresponding plugins to be persisted. |
There was a problem hiding this comment.
I still don't know what this means - what does it mean for a plugin to be persisted? What does it mean to choose a language?
I'd check out https://github.com/bazelbuild/remote-apis/blob/main/build/bazel/remote/asset/v1/remote_asset.proto as a good example of Protobuf API documentation.
This adds two new endpoints
GetUserPluginPreferencesandUpdateUserPluginPreferencesto theUserService