Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable assignment in autobumper #132

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.")
}
}