refactor: workspace setting definitions

This commit is contained in:
Steven
2024-07-29 22:03:21 +08:00
parent 61d01a53eb
commit ecf77e0774
36 changed files with 1277 additions and 1052 deletions

View File

@ -16,12 +16,16 @@ func TestWorkspaceSettingStore(t *testing.T) {
ts := NewTestingStore(ctx, t)
tempSecret := uuid.New().String()
workspaceSetting, err := ts.UpsertWorkspaceSetting(ctx, &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SECRET_SESSION,
Value: &storepb.WorkspaceSetting_SecretSession{SecretSession: tempSecret},
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL,
Value: &storepb.WorkspaceSetting_General{
General: &storepb.WorkspaceSetting_GeneralSetting{
SecretSession: tempSecret,
},
},
})
require.NoError(t, err)
foundWorkspaceSetting, err := ts.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SECRET_SESSION,
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL,
})
require.NoError(t, err)
require.Equal(t, workspaceSetting, foundWorkspaceSetting)