Merge remote-tracking branch 'origin/master' into pr-create

This commit is contained in:
Mislav Marohnić 2019-11-11 12:24:09 +01:00
commit a275398dac
39 changed files with 13268 additions and 226 deletions

47
test/fixtures/issueList.json vendored Normal file
View file

@ -0,0 +1,47 @@
{
"data": {
"assigned": {
"issues": {
"edges": [
{
"node": {
"number": 9,
"title": "corey thinks squash tastes bad"
}
},
{
"node": {
"number": 10,
"title": "broccoli is a superfood"
}
}
]
}
},
"mentioned": {
"issues": {
"edges": [
{
"node": {
"number": 8,
"title": "rabbits eat carrots"
}
},
{
"node": {
"number": 11,
"title": "swiss chard is neutral"
}
}
]
}
},
"recent": {
"issues": {
"edges": []
}
},
"pageInfo": { "hasNextPage": false }
}
}

47
test/fixtures/issueStatus.json vendored Normal file
View file

@ -0,0 +1,47 @@
{
"data": {
"assigned": {
"issues": {
"edges": [
{
"node": {
"number": 9,
"title": "corey thinks squash tastes bad"
}
},
{
"node": {
"number": 10,
"title": "broccoli is a superfood"
}
}
]
}
},
"mentioned": {
"issues": {
"edges": [
{
"node": {
"number": 8,
"title": "rabbits eat carrots"
}
},
{
"node": {
"number": 11,
"title": "swiss chard is neutral"
}
}
]
}
},
"recent": {
"issues": {
"edges": []
}
},
"pageInfo": { "hasNextPage": false }
}
}

36
test/fixtures/issueView.json vendored Normal file
View file

@ -0,0 +1,36 @@
{
"data": {
"repository": {
"issues": {
"edges": [
{
"node": {
"number": 8,
"title": "rabbits eat carrots",
"url": "https://github.com/github/gh-cli/pull/10"
}
},
{
"node": {
"number": 9,
"title": "corey thinks squash tastes bad"
}
},
{
"node": {
"number": 10,
"title": "broccoli is a superfood"
}
},
{
"node": {
"number": 11,
"title": "swiss chard is neutral"
}
}
]
}
},
"pageInfo": { "hasNextPage": false }
}
}

View file

@ -1,50 +1,38 @@
{"data":{
"repository": {
"pullRequests": {
"edges": [
{
"node": {
"number": 10,
"title": "Blueberries are a good fruit",
"url": "https://github.com/github/gh-cli/pull/10",
"headRefName": "[blueberries]"
{
"data": {
"repository": {
"pullRequests": {
"edges": [
{
"node": {
"number": 32,
"title": "New feature",
"url": "https://github.com/monalisa/hello/pull/32",
"headRefName": "feature"
}
},
{
"node": {
"number": 29,
"title": "Fixed bad bug",
"url": "https://github.com/monalisa/hello/pull/29",
"headRefName": "bug-fix"
}
},
{
"node": {
"number": 28,
"title": "Improve documentation",
"url": "https://github.com/monalisa/hello/pull/28",
"headRefName": "docs"
}
}
],
"pageInfo": {
"hasNextPage": false,
"endCursor": ""
}
]
}
}
},
"viewerCreated": {
"edges": [
{
"node": {
"number": 8,
"title": "Strawberries are not actually berries",
"url": "https://github.com/github/gh-cli/pull/8",
"headRefName": "[strawberries]"
}
}
],
"pageInfo": { "hasNextPage": false }
},
"reviewRequested": {
"edges": [
{
"node": {
"number": 9,
"title": "Apples are tasty",
"url": "https://github.com/github/gh-cli/pull/9",
"headRefName": "[apples]"
}
},
{
"node": {
"number": 11,
"title": "Figs are my favorite",
"url": "https://github.com/github/gh-cli/pull/1",
"headRefName": "[figs]"
}
}
],
"pageInfo": { "hasNextPage": false }
}
}}
}

50
test/fixtures/prStatus.json vendored Normal file
View file

@ -0,0 +1,50 @@
{"data":{
"repository": {
"pullRequests": {
"edges": [
{
"node": {
"number": 10,
"title": "Blueberries are a good fruit",
"url": "https://github.com/github/gh-cli/pull/10",
"headRefName": "[blueberries]"
}
}
]
}
},
"viewerCreated": {
"edges": [
{
"node": {
"number": 8,
"title": "Strawberries are not actually berries",
"url": "https://github.com/github/gh-cli/pull/8",
"headRefName": "[strawberries]"
}
}
],
"pageInfo": { "hasNextPage": false }
},
"reviewRequested": {
"edges": [
{
"node": {
"number": 9,
"title": "Apples are tasty",
"url": "https://github.com/github/gh-cli/pull/9",
"headRefName": "[apples]"
}
},
{
"node": {
"number": 11,
"title": "Figs are my favorite",
"url": "https://github.com/github/gh-cli/pull/1",
"headRefName": "[figs]"
}
}
],
"pageInfo": { "hasNextPage": false }
}
}}

View file

@ -6,7 +6,7 @@
"node": {
"number": 10,
"title": "Blueberries are a good fruit",
"url": "https://github.com/github/gh-cli/pull/10",
"url": "https://github.com/OWNER/REPO/pull/10",
"headRefName": "[blueberries]"
}
}
@ -19,7 +19,7 @@
"node": {
"number": 8,
"title": "Strawberries are not actually berries",
"url": "https://github.com/github/gh-cli/pull/8",
"url": "https://github.com/OWNER/REPO/pull/8",
"headRefName": "[strawberries]"
}
}
@ -32,7 +32,7 @@
"node": {
"number": 9,
"title": "Apples are tasty",
"url": "https://github.com/github/gh-cli/pull/9",
"url": "https://github.com/OWNER/REPO/pull/9",
"headRefName": "[apples]"
}
},
@ -40,7 +40,7 @@
"node": {
"number": 11,
"title": "Figs are my favorite",
"url": "https://github.com/github/gh-cli/pull/1",
"url": "https://github.com/OWNER/REPO/pull/1",
"headRefName": "[figs]"
}
}

View file

@ -113,6 +113,7 @@ func RunCommand(root *cobra.Command, s string) (string, error) {
root.SetArgs(strings.Split(s, " "))
_, err = root.ExecuteC()
})
if err != nil {
return "", err
}