-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[api, server, dashboard] Cleanup UpdateOrganizationSettings API #20603
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
183b555 to
24f38b4
Compare
components/dashboard/src/service/json-rpc-organization-client.ts
Outdated
Show resolved
Hide resolved
|
|
||
| @Column("varchar", { nullable: true }) | ||
| defaultWorkspaceImage?: string | null; | ||
| defaultWorkspaceImage?: string; |
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.
The null is treated as special value by typeorm to clear the column.
This is the only place we did this, and it's also unnecessary: We treat the default value "" the same anyway. 🤷 So we can get rid of that complexity.
| } | ||
|
|
||
| fromTimeoutSettings(timeoutSettings: TimeoutSettings): TimeoutSettingsProtocol { | ||
| fromOrganizationSettings(settings: PlainMessage<OrganizationSettings>): OrganizationSettingsProtocol { |
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.
This is the field translation, untangled from validation etc. from the organization-service-api.ts handler.
| if (req.updateRestrictedEditorNames) { | ||
| update.restrictedEditorNames = req.restrictedEditorNames; | ||
| } else if (req.restrictedEditorNames.length > 0) { | ||
| const settings = req.settings; |
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.
The code here was split into three things:
- gRPC validation (stayed here)
- general field validation (went into
organization-service.ts - field translation (went to
public-api-converter.ts)
| } | ||
| } | ||
|
|
||
| if (settings.maxParallelRunningWorkspaces !== undefined) { |
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.
From the -api.ts handler.
e90ca11 to
fa14fac
Compare
Tool: gitpod/catfood.gitpod.cloud
f36f3a1 to
d32f465
Compare
Tool: gitpod/catfood.gitpod.cloud
d32f465 to
d829633
Compare
Tool: gitpod/catfood.gitpod.cloud
|
/unhold |
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.
LGTM, thanks!
Description
Follow-up for: #20577
This PR cleans up the UpdateOrganizationSettings API shapes and related handlers and dashboard client.
The changes keep the current inconsistencies w.r.t. duplicate shapes and different field IDs, but maintains (or strengthens) the compatibility on the field name level. This allows us to get rid of a ton of duplicate code/field handling.
Related Issue(s)
Fixes #
How to test
Documentation
Preview status
gitpod:summary
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-testPublish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/previewIf enabled this will create the environment on GCE infra
Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
Valid options are
all,workspace,webapp,ide,jetbrains,vscode,ssh. If enabled,with-previewandwith-large-vmwill be enabled./hold