Revert "fix: Address workflow template issues from code review"
This reverts commit aae8407aa4.
This commit is contained in:
@@ -89,10 +89,9 @@ type UpdateArgs struct {
|
||||
AcceptanceCriteria *string `json:"acceptance_criteria,omitempty"`
|
||||
Notes *string `json:"notes,omitempty"`
|
||||
Assignee *string `json:"assignee,omitempty"`
|
||||
ExternalRef *string `json:"external_ref,omitempty"` // Link to external issue trackers
|
||||
ExternalRef *string `json:"external_ref,omitempty"` // Link to external issue trackers
|
||||
EstimatedMinutes *int `json:"estimated_minutes,omitempty"` // Time estimate in minutes
|
||||
IssueType *string `json:"issue_type,omitempty"` // Issue type (bug|feature|task|epic|chore)
|
||||
Parent *string `json:"parent,omitempty"` // New parent issue ID (empty string to remove parent)
|
||||
AddLabels []string `json:"add_labels,omitempty"`
|
||||
RemoveLabels []string `json:"remove_labels,omitempty"`
|
||||
SetLabels []string `json:"set_labels,omitempty"`
|
||||
|
||||
@@ -371,46 +371,8 @@ func (s *Server) handleUpdate(req *Request) Response {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle parent change
|
||||
parentChanged := false
|
||||
if updateArgs.Parent != nil {
|
||||
parentChanged = true
|
||||
// First, remove any existing parent-child dependency
|
||||
deps, err := store.GetDependencyRecords(ctx, updateArgs.ID)
|
||||
if err != nil {
|
||||
return Response{
|
||||
Success: false,
|
||||
Error: fmt.Sprintf("failed to get dependencies: %v", err),
|
||||
}
|
||||
}
|
||||
for _, dep := range deps {
|
||||
if dep.Type == types.DepParentChild {
|
||||
if err := store.RemoveDependency(ctx, updateArgs.ID, dep.DependsOnID, actor); err != nil {
|
||||
return Response{
|
||||
Success: false,
|
||||
Error: fmt.Sprintf("failed to remove old parent: %v", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add new parent if specified (empty string means just remove parent)
|
||||
if *updateArgs.Parent != "" {
|
||||
newDep := &types.Dependency{
|
||||
IssueID: updateArgs.ID,
|
||||
DependsOnID: *updateArgs.Parent,
|
||||
Type: types.DepParentChild,
|
||||
}
|
||||
if err := store.AddDependency(ctx, newDep, actor); err != nil {
|
||||
return Response{
|
||||
Success: false,
|
||||
Error: fmt.Sprintf("failed to set new parent: %v", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Emit mutation event for event-driven daemon (only if any updates or label operations were performed)
|
||||
if len(updates) > 0 || len(updateArgs.SetLabels) > 0 || len(updateArgs.AddLabels) > 0 || len(updateArgs.RemoveLabels) > 0 || parentChanged {
|
||||
if len(updates) > 0 || len(updateArgs.SetLabels) > 0 || len(updateArgs.AddLabels) > 0 || len(updateArgs.RemoveLabels) > 0 {
|
||||
s.emitMutation(MutationUpdate, updateArgs.ID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user