當前位置: 首頁>>代碼示例>>Golang>>正文


Golang MungeObject.GetPRFixesList方法代碼示例

本文整理匯總了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)
	}

}
開發者ID:spxtr,項目名稱:contrib,代碼行數:35,代碼來源:assign-fixes.go


注:本文中的k8s/io/contrib/mungegithub/github.MungeObject.GetPRFixesList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。