Skip to content

Commit

Permalink
Merge pull request #132 from hongkailiu/autobumper
Browse files Browse the repository at this point in the history
Enable assignment in autobumper
  • Loading branch information
openshift-merge-robot authored Sep 12, 2019
2 parents 0e3b197 + 302d5ae commit 4adee95
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/autobumper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
githubOrg = "openshift"
githubRepo = "release"
githubLogin = "openshift-bot"
githubTeam = "openshift/openshift-team-developer-productivity-test-platform"
)

var extraFiles = map[string]bool{
Expand All @@ -28,6 +29,7 @@ type options struct {
gitName string
gitEmail string
targetDir string
assign string
}

func parseOptions() options {
Expand All @@ -37,6 +39,7 @@ func parseOptions() options {
flag.StringVar(&o.gitName, "git-name", "", "The name to use on the git commit. Requires --git-email. If not specified, uses the system default.")
flag.StringVar(&o.gitEmail, "git-email", "", "The email to use on the git commit. Requires --git-name. If not specified, uses the system default.")
flag.StringVar(&o.targetDir, "target-dir", "", "The directory containing the target repo.")
flag.StringVar(&o.assign, "assign", githubTeam, "The github username or group name to assign the created pull request to.")
flag.Parse()
return o
}
Expand All @@ -54,6 +57,9 @@ func validateOptions(o options) error {
if o.targetDir == "" {
return fmt.Errorf("--target-dir is mandatory")
}
if o.assign == "" {
return fmt.Errorf("--assign is mandatory")
}
return nil
}

Expand Down Expand Up @@ -88,7 +94,7 @@ func main() {
logrus.WithError(err).Fatal("Failed to push changes.")
}

if err := bumper.UpdatePR(gc, githubOrg, githubRepo, images, "", "Update prow to", o.githubLogin+":"+remoteBranch, "master"); err != nil {
if err := bumper.UpdatePR(gc, githubOrg, githubRepo, images, "/cc @"+o.assign, "Update prow to", o.githubLogin+":"+remoteBranch, "master"); err != nil {
logrus.WithError(err).Fatal("PR creation failed.")
}
}

0 comments on commit 4adee95

Please sign in to comment.