-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[api, server, dashboard] Cleanup UpdateOrganizationSettings API #20603
base: main
Are you sure you want to change the base?
Conversation
183b555
to
24f38b4
Compare
components/dashboard/src/service/json-rpc-organization-client.ts
Outdated
Show resolved
Hide resolved
@@ -25,34 +25,34 @@ export class DBOrgSettings implements OrganizationSettings { | |||
workspaceSharingDisabled?: boolean; | |||
|
|||
@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.
@@ -1059,7 +1059,45 @@ export class PublicAPIConverter { | |||
} | |||
} | |||
|
|||
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
)
@@ -551,6 +550,22 @@ export class OrganizationService { | |||
} | |||
} | |||
|
|||
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.
7d10cda
to
e90ca11
Compare
Tool: gitpod/catfood.gitpod.cloud
e90ca11
to
fa14fac
Compare
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-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If 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-preview
andwith-large-vm
will be enabled./hold