diff --git a/cli/pkg/bitbucket/bitbucket.go b/cli/pkg/bitbucket/bitbucket.go index 60e7f7cd4..01afa63e1 100644 --- a/cli/pkg/bitbucket/bitbucket.go +++ b/cli/pkg/bitbucket/bitbucket.go @@ -129,7 +129,7 @@ func (svc BitbucketAPI) ListIssues() ([]*ci.Issue, error) { return nil, fmt.Errorf("implement me") } -func (svc BitbucketAPI) PublishIssue(title string, body string) (int64, error) { +func (svc BitbucketAPI) PublishIssue(title string, body string, labels *[]string) (int64, error) { return 0, fmt.Errorf("implement me") } diff --git a/cli/pkg/digger/digger_test.go b/cli/pkg/digger/digger_test.go index 9ec59e467..92568c2f6 100644 --- a/cli/pkg/digger/digger_test.go +++ b/cli/pkg/digger/digger_test.go @@ -93,7 +93,7 @@ func (m *MockPRManager) ListIssues() ([]*ci.Issue, error) { return nil, nil } -func (m *MockPRManager) PublishIssue(title string, body string) (int64, error) { +func (m *MockPRManager) PublishIssue(title string, body string, labels *[]string) (int64, error) { m.Commands = append(m.Commands, RunInfo{"PublishComment", body, time.Now()}) return 0, nil } diff --git a/ee/cli/pkg/drift/github_issue.go b/ee/cli/pkg/drift/github_issue.go index 0eb2f453b..92fa7449a 100644 --- a/ee/cli/pkg/drift/github_issue.go +++ b/ee/cli/pkg/drift/github_issue.go @@ -32,7 +32,8 @@ func (ghi GithubIssueNotification) Send(projectName string, plan string) error { } return err } else { - _, err := (*ghi.GithubService).PublishIssue(title, message) + labels := []string{"digger"} + _, err := (*ghi.GithubService).PublishIssue(title, message, &labels) if err != nil { log.Printf("error while publishing issue: %v", err) } diff --git a/libs/ci/azure/azure.go b/libs/ci/azure/azure.go index 9a64a6442..e361970bb 100644 --- a/libs/ci/azure/azure.go +++ b/libs/ci/azure/azure.go @@ -192,7 +192,7 @@ func (svc *AzureReposService) ListIssues() ([]*ci.Issue, error) { return nil, fmt.Errorf("implement me") } -func (svc *AzureReposService) PublishIssue(title string, body string) (int64, error) { +func (svc *AzureReposService) PublishIssue(title string, body string, labels *[]string) (int64, error) { return 0, fmt.Errorf("implement me") } diff --git a/libs/ci/ci.go b/libs/ci/ci.go index 25b88cfac..9afaf8db8 100644 --- a/libs/ci/ci.go +++ b/libs/ci/ci.go @@ -6,7 +6,7 @@ type PullRequestService interface { GetChangedFiles(prNumber int) ([]string, error) PublishComment(prNumber int, comment string) (*Comment, error) ListIssues() ([]*Issue, error) - PublishIssue(title string, body string) (int64, error) + PublishIssue(title string, body string, labels *[]string) (int64, error) UpdateIssue(ID int64, title string, body string) (int64, error) EditComment(prNumber int, id string, comment string) error CreateCommentReaction(id string, reaction string) error diff --git a/libs/ci/github/github.go b/libs/ci/github/github.go index 074144a69..82757cdd1 100644 --- a/libs/ci/github/github.go +++ b/libs/ci/github/github.go @@ -139,8 +139,8 @@ func (svc GithubService) ListIssues() ([]*ci.Issue, error) { return allIssues, nil } -func (svc GithubService) PublishIssue(title string, body string) (int64, error) { - githubissue, _, err := svc.Client.Issues.Create(context.Background(), svc.Owner, svc.RepoName, &github.IssueRequest{Title: &title, Body: &body}) +func (svc GithubService) PublishIssue(title string, body string, labels *[]string) (int64, error) { + githubissue, _, err := svc.Client.Issues.Create(context.Background(), svc.Owner, svc.RepoName, &github.IssueRequest{Title: &title, Body: &body, Labels: labels}) if err != nil { return 0, fmt.Errorf("could not publish issue: %v", err) } diff --git a/libs/ci/github/mocks.go b/libs/ci/github/mocks.go index 356297b09..a918fb74a 100644 --- a/libs/ci/github/mocks.go +++ b/libs/ci/github/mocks.go @@ -43,7 +43,7 @@ func (t MockCiService) ListIssues() ([]*ci.Issue, error) { return nil, fmt.Errorf("implement me") } -func (t MockCiService) PublishIssue(title string, body string) (int64, error) { +func (t MockCiService) PublishIssue(title string, body string, labels *[]string) (int64, error) { return 0, fmt.Errorf("implement me") } diff --git a/libs/ci/gitlab/gitlab.go b/libs/ci/gitlab/gitlab.go index 041386a57..846c36c3a 100644 --- a/libs/ci/gitlab/gitlab.go +++ b/libs/ci/gitlab/gitlab.go @@ -192,7 +192,7 @@ func (svc GitLabService) ListIssues() ([]*ci.Issue, error) { return nil, fmt.Errorf("implement me") } -func (svc GitLabService) PublishIssue(title string, body string) (int64, error) { +func (svc GitLabService) PublishIssue(title string, body string, labels *[]string) (int64, error) { return 0, fmt.Errorf("implement me") } diff --git a/libs/ci/mocks.go b/libs/ci/mocks.go index 3818f0874..1a0642d49 100644 --- a/libs/ci/mocks.go +++ b/libs/ci/mocks.go @@ -23,7 +23,7 @@ func (t MockPullRequestManager) ListIssues() ([]*Issue, error) { return nil, nil } -func (t MockPullRequestManager) PublishIssue(title string, body string) (int64, error) { +func (t MockPullRequestManager) PublishIssue(title string, body string, labels *[]string) (int64, error) { return 0, nil } diff --git a/libs/comment_utils/reporting/reporting_test.go b/libs/comment_utils/reporting/reporting_test.go index 73889cdae..60cdcb61f 100644 --- a/libs/comment_utils/reporting/reporting_test.go +++ b/libs/comment_utils/reporting/reporting_test.go @@ -43,7 +43,7 @@ func (t MockCiService) ListIssues() ([]*ci.Issue, error) { return nil, fmt.Errorf("implement me") } -func (t MockCiService) PublishIssue(title string, body string) (int64, error) { +func (t MockCiService) PublishIssue(title string, body string, labels *[]string) (int64, error) { return 0, fmt.Errorf("implement me") } diff --git a/libs/orchestrator/mock.go b/libs/orchestrator/mock.go index ce777a9e4..a9687cc3e 100644 --- a/libs/orchestrator/mock.go +++ b/libs/orchestrator/mock.go @@ -28,7 +28,7 @@ func (mockGithubPullrequestManager *MockGithubPullrequestManager) ListIssues() ( return nil, nil } -func (mockGithubPullrequestManager *MockGithubPullrequestManager) PublishIssue(title string, body string) (int64, error) { +func (mockGithubPullrequestManager *MockGithubPullrequestManager) PublishIssue(title string, body string, labels *[]string) (int64, error) { mockGithubPullrequestManager.commands = append(mockGithubPullrequestManager.commands, "PublishIssue") return 0, nil }