本文整理汇总了Golang中k8s/io/contrib/mungegithub/github.Config.ClosePR方法的典型用法代码示例。如果您正苦于以下问题:Golang Config.ClosePR方法的具体用法?Golang Config.ClosePR怎么用?Golang Config.ClosePR使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类k8s/io/contrib/mungegithub/github.Config
的用法示例。
在下文中一共展示了Config.ClosePR方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: MungePullRequest
// MungePullRequest is the workhorse the will actually make updates to the PR
func (PingCIMunger) MungePullRequest(config *github_util.Config, pr *github.PullRequest, issue *github.Issue, commits []github.RepositoryCommit, events []github.IssueEvent) {
if !github_util.HasLabel(issue.Labels, "lgtm") {
return
}
if mergeable, err := config.IsPRMergeable(pr); err != nil {
glog.V(2).Infof("Skipping %d - problem determining mergeability", *pr.Number)
} else if !mergeable {
glog.V(2).Infof("Skipping %d - not mergeable", *pr.Number)
}
status, err := config.GetStatus(pr, []string{"Shippable", "continuous-integration/travis-ci/pr"})
if err != nil {
glog.Errorf("unexpected error getting status: %v", err)
return
}
if status == "incomplete" {
glog.V(2).Infof("status is incomplete, closing and re-opening")
msg := "Continuous integration appears to have missed, closing and re-opening to trigger it"
config.WriteComment(*pr.Number, msg)
config.ClosePR(pr)
time.Sleep(5 * time.Second)
config.OpenPR(pr, 10)
}
}