feat(taskactions): rejecting a pr_open task closes its pull request
This commit is contained in:
1 parent
8aaab2b9b7
commit
ee3dbda777
13 files changed
+443
-232
No files matched your search
@@ -16,6 +16,7 @@ func NewService(
|
||||
maxRetries func(*taskactions.Task) int,
|
||||
cancel func(int64) bool,
|
||||
closeIssue func(context.Context, string, string, int, string) error,
|
||||
closePR func(context.Context, string, string, int, string) error,
|
||||
removeLogs func(int64) error,
|
||||
removeWorktree func(*taskactions.Task) error,
|
||||
publish func(events.Event),
|
||||
@@ -26,6 +27,7 @@ func NewService(
|
||||
MaxRetries: maxRetries,
|
||||
CancelTask: cancel,
|
||||
CloseIssue: closeIssue,
|
||||
ClosePR: closePR,
|
||||
RemoveLogs: removeLogs,
|
||||
RemoveWorktree: removeWorktree,
|
||||
Publish: publish,
|
||||
|
||||
@@ -20,7 +20,7 @@ func (s Store) TaskByID(ctx context.Context, id int64) (*taskactions.Task, error
|
||||
}
|
||||
// A pinned definition that no longer parses offers no resume points.
|
||||
stages, _ := workflow.StageNames(t.WorkflowDefinitionYAML)
|
||||
return &taskactions.Task{ID: t.ID, Owner: t.Owner, Repo: t.Repo, Identity: t.Identity, Status: t.Status, ParkReason: t.ParkReason, IssueNumber: t.IssueNumber, RetryCount: t.RetryCount, Attempt: t.Attempt, Branch: t.Branch, RetryMode: t.RetryMode, ForgeBacked: t.IsForgeBacked(), ReviewGate: t.ReviewGate, RereviewRounds: t.RereviewRounds, Stages: stages}, nil
|
||||
return &taskactions.Task{ID: t.ID, Owner: t.Owner, Repo: t.Repo, Identity: t.Identity, Status: t.Status, ParkReason: t.ParkReason, IssueNumber: t.IssueNumber, PRNumber: t.PRNumber, RetryCount: t.RetryCount, Attempt: t.Attempt, Branch: t.Branch, RetryMode: t.RetryMode, ForgeBacked: t.IsForgeBacked(), ReviewGate: t.ReviewGate, RereviewRounds: t.RereviewRounds, Stages: stages}, nil
|
||||
}
|
||||
|
||||
// CancelExecution delegates to the store.
|
||||
|
||||
Reference in new issue
Block a user