mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
adds support for workspace presets to the coderd database. Support in the API and web frontend will be added in subsequent pull requests. This is the smallest meaningful contribution that I could get passing tests for.
* Add workspace preset tables to the database in a migration * Add queries to manipulate workspace presets to the database * Generate db related code for the newly added queries * Implement new methods to satisfy the Querier interface in dbauthz, dbmem, dbmock and querymetrics * Implement the required tests for dbauthz * Update the audit table to track changes to the new column in workspace builds
This commit is contained in:
@ -2016,6 +2016,51 @@ func (mr *MockStoreMockRecorder) GetParameterSchemasByJobID(ctx, jobID any) *gom
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParameterSchemasByJobID", reflect.TypeOf((*MockStore)(nil).GetParameterSchemasByJobID), ctx, jobID)
|
||||
}
|
||||
|
||||
// GetPresetByWorkspaceBuildID mocks base method.
|
||||
func (m *MockStore) GetPresetByWorkspaceBuildID(arg0 context.Context, arg1 uuid.UUID) (database.GetPresetByWorkspaceBuildIDRow, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetPresetByWorkspaceBuildID", arg0, arg1)
|
||||
ret0, _ := ret[0].(database.GetPresetByWorkspaceBuildIDRow)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetPresetByWorkspaceBuildID indicates an expected call of GetPresetByWorkspaceBuildID.
|
||||
func (mr *MockStoreMockRecorder) GetPresetByWorkspaceBuildID(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetByWorkspaceBuildID", reflect.TypeOf((*MockStore)(nil).GetPresetByWorkspaceBuildID), arg0, arg1)
|
||||
}
|
||||
|
||||
// GetPresetParametersByPresetID mocks base method.
|
||||
func (m *MockStore) GetPresetParametersByPresetID(arg0 context.Context, arg1 uuid.UUID) ([]database.GetPresetParametersByPresetIDRow, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetPresetParametersByPresetID", arg0, arg1)
|
||||
ret0, _ := ret[0].([]database.GetPresetParametersByPresetIDRow)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetPresetParametersByPresetID indicates an expected call of GetPresetParametersByPresetID.
|
||||
func (mr *MockStoreMockRecorder) GetPresetParametersByPresetID(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetParametersByPresetID", reflect.TypeOf((*MockStore)(nil).GetPresetParametersByPresetID), arg0, arg1)
|
||||
}
|
||||
|
||||
// GetPresetsByTemplateVersionID mocks base method.
|
||||
func (m *MockStore) GetPresetsByTemplateVersionID(arg0 context.Context, arg1 uuid.UUID) ([]database.GetPresetsByTemplateVersionIDRow, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetPresetsByTemplateVersionID", arg0, arg1)
|
||||
ret0, _ := ret[0].([]database.GetPresetsByTemplateVersionIDRow)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetPresetsByTemplateVersionID indicates an expected call of GetPresetsByTemplateVersionID.
|
||||
func (mr *MockStoreMockRecorder) GetPresetsByTemplateVersionID(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPresetsByTemplateVersionID", reflect.TypeOf((*MockStore)(nil).GetPresetsByTemplateVersionID), arg0, arg1)
|
||||
}
|
||||
|
||||
// GetPreviousTemplateVersion mocks base method.
|
||||
func (m *MockStore) GetPreviousTemplateVersion(ctx context.Context, arg database.GetPreviousTemplateVersionParams) (database.TemplateVersion, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@ -4051,6 +4096,21 @@ func (mr *MockStoreMockRecorder) InsertOrganizationMember(ctx, arg any) *gomock.
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertOrganizationMember", reflect.TypeOf((*MockStore)(nil).InsertOrganizationMember), ctx, arg)
|
||||
}
|
||||
|
||||
// InsertPreset mocks base method.
|
||||
func (m *MockStore) InsertPreset(arg0 context.Context, arg1 database.InsertPresetParams) (database.TemplateVersionPreset, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "InsertPreset", arg0, arg1)
|
||||
ret0, _ := ret[0].(database.TemplateVersionPreset)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// InsertPreset indicates an expected call of InsertPreset.
|
||||
func (mr *MockStoreMockRecorder) InsertPreset(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertPreset", reflect.TypeOf((*MockStore)(nil).InsertPreset), arg0, arg1)
|
||||
}
|
||||
|
||||
// InsertProvisionerJob mocks base method.
|
||||
func (m *MockStore) InsertProvisionerJob(ctx context.Context, arg database.InsertProvisionerJobParams) (database.ProvisionerJob, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
Reference in New Issue
Block a user