feat(coderd): add lookup task by name in httpmw.TaskParam (#20647)

* Adds a `GetTaskByOwnerIDAndName` query
* Updates `httpmw.TaskParam` to fall back to task name if no task by
UUID found.
* Updates the `TaskByIdentifier` used in `cli/` to use direct lookup instead of searching.
This commit is contained in:
Cian Johnston
2025-11-05 14:28:34 +00:00
committed by GitHub
parent 46b2f3df8e
commit 34f6e72879
13 changed files with 441 additions and 227 deletions
+15
View File
@@ -3237,6 +3237,21 @@ func (mr *MockStoreMockRecorder) GetTaskByID(ctx, id any) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTaskByID", reflect.TypeOf((*MockStore)(nil).GetTaskByID), ctx, id)
}
// GetTaskByOwnerIDAndName mocks base method.
func (m *MockStore) GetTaskByOwnerIDAndName(ctx context.Context, arg database.GetTaskByOwnerIDAndNameParams) (database.Task, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetTaskByOwnerIDAndName", ctx, arg)
ret0, _ := ret[0].(database.Task)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetTaskByOwnerIDAndName indicates an expected call of GetTaskByOwnerIDAndName.
func (mr *MockStoreMockRecorder) GetTaskByOwnerIDAndName(ctx, arg any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTaskByOwnerIDAndName", reflect.TypeOf((*MockStore)(nil).GetTaskByOwnerIDAndName), ctx, arg)
}
// GetTaskByWorkspaceID mocks base method.
func (m *MockStore) GetTaskByWorkspaceID(ctx context.Context, workspaceID uuid.UUID) (database.Task, error) {
m.ctrl.T.Helper()