本文整理匯總了Golang中k8s/io/contrib/mungegithub/config.MungeConfig.ClosePR方法的典型用法代碼示例。如果您正苦於以下問題:Golang MungeConfig.ClosePR方法的具體用法?Golang MungeConfig.ClosePR怎麽用?Golang MungeConfig.ClosePR使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類k8s/io/contrib/mungegithub/config.MungeConfig
的用法示例。
在下文中一共展示了MungeConfig.ClosePR方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: MungePullRequest
func (PingCIMunger) MungePullRequest(config *config.MungeConfig, 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)
}
}