autoResolveIssue automatically resolves the issue associated with a plan by setting its status to DONE.
(ctx context.Context, projectID string, planID int64)
| 282 | |
| 283 | // autoResolveIssue automatically resolves the issue associated with a plan by setting its status to DONE. |
| 284 | func (s *Scheduler) autoResolveIssue(ctx context.Context, projectID string, planID int64) { |
| 285 | issue, err := s.store.GetIssue(ctx, &store.FindIssueMessage{ProjectIDs: []string{projectID}, PlanUID: &planID}) |
| 286 | if err != nil { |
| 287 | slog.Error("failed to get issue for auto-resolve", log.BBError(err)) |
| 288 | return |
| 289 | } |
| 290 | if issue == nil { |
| 291 | return |
| 292 | } |
| 293 | if issue.Status != storepb.Issue_OPEN { |
| 294 | return |
| 295 | } |
| 296 | |
| 297 | if _, err := s.store.UpdateIssue(ctx, issue.ProjectID, issue.UID, &store.UpdateIssueMessage{Status: new(storepb.Issue_DONE)}); err != nil { |
| 298 | slog.Error("failed to auto-resolve issue", slog.String("project", projectID), slog.Int64("issueUID", issue.UID), log.BBError(err)) |
| 299 | return |
| 300 | } |
| 301 | slog.Info("auto-resolved deferred rollout issue", slog.String("project", projectID), slog.Int64("issueUID", issue.UID), slog.Int64("planID", planID)) |
| 302 | } |
no test coverage detected