Add server-side workflows with YAML files, task freeze and lead tools
This commit is contained in:
+11
-1
@@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"g.fc.run/misc/byre/internal/api"
|
||||
"g.fc.run/misc/byre/internal/store"
|
||||
)
|
||||
|
||||
func (m *Manager) Fork(ctx context.Context, src api.Task, project api.Project, n int, creator api.User) (api.Task, error) {
|
||||
@@ -33,6 +34,15 @@ func (m *Manager) Fork(ctx context.Context, src api.Task, project api.Project, n
|
||||
return api.Task{}, fmt.Errorf("%w: snapshot %d of task %s has no recorded agent message at or before it to fork the conversation from", ErrConflict, n, src.Id)
|
||||
}
|
||||
|
||||
var frozen *store.FrozenWorkflow
|
||||
if src.Workflow != nil {
|
||||
f, err := m.store.TaskWorkflow(ctx, src.Id)
|
||||
if err != nil {
|
||||
return api.Task{}, err
|
||||
}
|
||||
frozen = &f
|
||||
}
|
||||
|
||||
t, err := m.createTask(ctx, project, api.Task{
|
||||
Title: fmt.Sprintf("%s (fork of #%d)", src.Title, n),
|
||||
MergeTitle: src.MergeTitle,
|
||||
@@ -40,7 +50,7 @@ func (m *Manager) Fork(ctx context.Context, src api.Task, project api.Project, n
|
||||
TodoItem: src.TodoItem,
|
||||
ForkedFrom: &src.Id,
|
||||
ForkedAt: &n,
|
||||
}, snap.CommitSha, creator.Login)
|
||||
}, frozen, snap.CommitSha, creator.Login)
|
||||
if err != nil {
|
||||
return api.Task{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user