From eb8dfc40c9cf047deaadc22577727076ee1f2a17 Mon Sep 17 00:00:00 2001 From: viljarb Date: Wed, 25 Mar 2026 19:41:15 +0100 Subject: [PATCH] updating dependency management task to use dependency management system --- cmd/pm/tasks/dependencyManagement.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/cmd/pm/tasks/dependencyManagement.go b/cmd/pm/tasks/dependencyManagement.go index 6bd6802..844596c 100644 --- a/cmd/pm/tasks/dependencyManagement.go +++ b/cmd/pm/tasks/dependencyManagement.go @@ -14,9 +14,9 @@ const dependencyManagementDescription = `You are tasked with managing issue depe Several issues in your project have dependencies on other issues. You need to: -1. Find 2 issues that mention dependencies in their description. +1. Find 2 issues that have dependencies on other issues. - Set their status to "Blocked". -2. Find the issue that is mentioned by the other issues: +2. Find the issue that is depended on by the other issues: - Set priority to 3. - Set status to in-progress. - Assign to yourself as "Me".` @@ -93,7 +93,23 @@ func (t *DependencyManagementTask) Setup(ctx context.Context) error { Build(), } - return t.app.Issues.CreateIssues(ctx, t.depIssues, "") + if err := t.app.Issues.CreateIssues(ctx, t.depIssues, ""); err != nil { + return err + } + + base := t.depIssues[0] + for _, child := range t.depIssues[1:] { + dep := &models.Dependency{ + IssueID: child.ID, + DependsOnID: base.ID, + Type: models.DepBlocks, + } + if err := t.app.Issues.AddDependency(ctx, dep, ""); err != nil { + return err + } + } + + return nil } func (t *DependencyManagementTask) Validate(ctx context.Context) ValidationFeedback {