提交 32aaacb6 编写于 作者: M Mislav Marohnić

Include requested teams in `hub pr list -f %sr` view

上级 ee0d6753
......@@ -316,6 +316,10 @@ func formatIssuePlaceholders(issue github.Issue, colorize bool) map[string]strin
for _, requestedReviewer := range issue.RequestedReviewers {
requestedReviewers = append(requestedReviewers, requestedReviewer.Login)
}
for _, requestedTeam := range issue.RequestedTeams {
teamSlug := fmt.Sprintf("%s/%s", issue.Base.Repo.Owner.Login, requestedTeam.Slug)
requestedReviewers = append(requestedReviewers, teamSlug)
}
var milestoneNumber, milestoneTitle string
if issue.Milestone != nil {
......
......@@ -76,13 +76,19 @@ Feature: hub pr list
{ :number => 999,
:title => "First",
:state => "open",
:base => { :ref => "master", :label => "github:master" },
:base => {
:ref => "master",
:label => "github:master",
:repo => { :owner => { :login => "github" } }
},
:head => { :ref => "patch-1", :label => "octocat:patch-1" },
:user => { :login => "octocat" },
:requested_reviewers => [
{
:login => "rey"
}
{ :login => "rey" },
],
:requested_teams => [
{ :slug => "troopers" },
{ :slug => "cantina-band" },
]
},
{ :number => 102,
......@@ -92,12 +98,8 @@ Feature: hub pr list
:head => { :ref => "patch-2", :label => "octocat:patch-2" },
:user => { :login => "octocat" },
:requested_reviewers => [
{
:login => "luke"
},
{
:login => "jyn"
}
{ :login => "luke" },
{ :login => "jyn" },
]
},
]
......@@ -106,7 +108,7 @@ Feature: hub pr list
When I successfully run `hub pr list -f "%sC%>(8)%i %rs%n"`
Then the output should contain exactly:
"""
#999 rey
#999 rey, github/troopers, github/cantina-band
#102 luke, jyn\n
"""
......
......@@ -596,6 +596,7 @@ type User struct {
type Team struct {
Name string `json:"name"`
Slug string `json:"slug"`
}
type Milestone struct {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册