Skip to content

Commit

Permalink
Replaced the flake-manager, issue-cacher, and issue-sync with the clu…
Browse files Browse the repository at this point in the history
…ster-manager and issue-creator.
  • Loading branch information
cjwagner committed Apr 10, 2017
1 parent ca26207 commit f911658
Show file tree
Hide file tree
Showing 16 changed files with 2,628 additions and 1,207 deletions.
23 changes: 14 additions & 9 deletions mungegithub/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ type DebugStats struct {
LimitResetTime time.Time
}

//Initializes an empty MungeObject. This is needed to properly init the config
//field in a new MungeObject from outside this package.
func NewEmptyMungeObject(config *Config) *MungeObject {
return &MungeObject{config: config, Annotations: map[string]string{}}
}

// NewTestObject should NEVER be used outside of _test.go code. It creates a
// MungeObject with the given fields. Normally these should be filled in lazily
// as needed
Expand Down Expand Up @@ -693,26 +699,25 @@ func (config *Config) GetObject(num int) (*MungeObject, error) {
}

// NewIssue will file a new issue and return an object for it.
// If "owner" is not empty, the issue will be assigned to "owner".
func (config *Config) NewIssue(title, body string, labels []string, owner string) (*MungeObject, error) {
// If "owners" is not empty, the issue will be assigned to the owners.
func (config *Config) NewIssue(title, body string, labels []string, owners []string) (*MungeObject, error) {
config.analytics.CreateIssue.Call(config, nil)
glog.Infof("Creating an issue: %q", title)
if config.DryRun {
return nil, fmt.Errorf("can't make issues in dry-run mode")
}
var assignee *string
if owner != "" {
assignee = &owner
if len(owners) == 0 {
owners = make([]string, 0)
}
if len(body) > maxCommentLen {
body = body[:maxCommentLen]
}

issue, _, err := config.client.Issues.Create(config.Org, config.Project, &github.IssueRequest{
Title: &title,
Body: &body,
Labels: &labels,
Assignee: assignee,
Title: &title,
Body: &body,
Labels: &labels,
Assignees: &owners,
})
if err != nil {
glog.Errorf("createIssue: %v", err)
Expand Down
14 changes: 5 additions & 9 deletions mungegithub/mungers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ go_test(
"check-labels_test.go",
"cherrypick-auto-approve_test.go",
"cla_test.go",
"cluster-manager_test.go",
"comment-deleter-jenkins_test.go",
"flake-manager_test.go",
"issue-creator_test.go",
"path_label_test.go",
"release-note-label_test.go",
"stale-green-ci_test.go",
Expand All @@ -35,10 +36,9 @@ go_test(
"//mungegithub/github/testing:go_default_library",
"//mungegithub/mungers/e2e:go_default_library",
"//mungegithub/mungers/e2e/fake:go_default_library",
"//mungegithub/mungers/flakesync:go_default_library",
"//mungegithub/mungers/matchers/comment:go_default_library",
"//mungegithub/mungers/mungerutil:go_default_library",
"//mungegithub/mungers/sync:go_default_library",
"//mungegithub/mungers/testowner:go_default_library",
"//vendor:github.com/golang/glog",
"//vendor:github.com/google/go-github/github",
"//vendor:k8s.io/contrib/test-utils/utils",
Expand All @@ -64,13 +64,13 @@ go_library(
"cherrypick-queue.go",
"cla.go",
"close-stale-pr.go",
"cluster-manager.go",
"comment-deleter.go",
"comment-deleter-jenkins.go",
"doc.go",
"docs-no-retest.go",
"flake-manager.go",
"issue-cacher.go",
"issue-categorizer.go",
"issue-creator.go",
"lgtm_after_commit.go",
"mungers.go",
"nag-flake-issues.go",
Expand All @@ -94,15 +94,12 @@ go_library(
"//mungegithub/mungers/approvers:go_default_library",
"//mungegithub/mungers/e2e:go_default_library",
"//mungegithub/mungers/e2e/fake:go_default_library",
"//mungegithub/mungers/flakesync:go_default_library",
"//mungegithub/mungers/matchers/comment:go_default_library",
"//mungegithub/mungers/matchers/event:go_default_library",
"//mungegithub/mungers/mungerutil:go_default_library",
"//mungegithub/mungers/shield:go_default_library",
"//mungegithub/mungers/sync:go_default_library",
"//mungegithub/mungers/testowner:go_default_library",
"//vendor:github.com/NYTimes/gziphandler",
"//vendor:github.com/arbovm/levenshtein",
"//vendor:github.com/golang/glog",
"//vendor:github.com/google/go-github/github",
"//vendor:github.com/prometheus/client_golang/prometheus",
Expand Down Expand Up @@ -135,7 +132,6 @@ filegroup(
"//mungegithub/mungers/matchers/event:all-srcs",
"//mungegithub/mungers/mungerutil:all-srcs",
"//mungegithub/mungers/shield:all-srcs",
"//mungegithub/mungers/sync:all-srcs",
"//mungegithub/mungers/testowner:all-srcs",
],
tags = ["automanaged"],
Expand Down

0 comments on commit f911658

Please sign in to comment.