本文整理匯總了Golang中k8s/io/contrib/mungegithub/github.MungeObject.GetPRFixesList方法的典型用法代碼示例。如果您正苦於以下問題:Golang MungeObject.GetPRFixesList方法的具體用法?Golang MungeObject.GetPRFixesList怎麽用?Golang MungeObject.GetPRFixesList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類k8s/io/contrib/mungegithub/github.MungeObject
的用法示例。
在下文中一共展示了MungeObject.GetPRFixesList方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Munge
// Munge is the workhorse the will actually make updates to the PR
func (a *AssignFixesMunger) Munge(obj *github.MungeObject) {
if !obj.IsPR() {
return
}
// we need the PR for the "User" (creator of the PR not the assignee)
pr, err := obj.GetPR()
if err != nil {
glog.Infof("Couldn't get PR %v", obj.Issue.Number)
return
}
prOwner := github.DescribeUser(pr.User)
issuesFixed := obj.GetPRFixesList()
if issuesFixed == nil {
return
}
for _, fixesNum := range issuesFixed {
// "issue" is the issue referenced by the "fixes #<num>"
issueObj, err := a.config.GetObject(fixesNum)
if err != nil {
glog.Infof("Couldn't get issue %v", fixesNum)
continue
}
issue := issueObj.Issue
if !a.AssignfixesReassign && issue.Assignee != nil {
glog.V(6).Infof("skipping %v: reassign: %v assignee: %v", *issue.Number, a.AssignfixesReassign, github.DescribeUser(issue.Assignee))
continue
}
glog.Infof("Assigning %v to %v (previously assigned to %v)", *issue.Number, prOwner, github.DescribeUser(issue.Assignee))
// although it says "AssignPR" it's more generic than that and is really just an issue.
issueObj.AssignPR(prOwner)
}
}