mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
Teach ServicingPipeline to paginate project board items (#18328)
Oops, it didn't support more than 100 items!
This commit is contained in:
parent
a3a4464667
commit
3e6690290f
@ -105,48 +105,59 @@ Function Get-GraphQlProjectNumberGivenName($Organization, $Name) {
|
|||||||
|
|
||||||
Function Get-GraphQlProjectWithNodes($Organization, $Number) {
|
Function Get-GraphQlProjectWithNodes($Organization, $Number) {
|
||||||
# It's terrible, but it pulls *all* of the info we need all at once!
|
# It's terrible, but it pulls *all* of the info we need all at once!
|
||||||
$Project = Invoke-GitHubGraphQlApi -Query '
|
$cursor = ""
|
||||||
query($organization: String! $number: Int!) {
|
$hasMore = $true
|
||||||
organization(login: $organization) {
|
$nodes = @()
|
||||||
projectV2(number: $number) {
|
While ($hasMore) {
|
||||||
id
|
$Project = Invoke-GitHubGraphQlApi -Query '
|
||||||
number
|
query($organization: String!, $number: Int!, $after: String) {
|
||||||
title
|
organization(login: $organization) {
|
||||||
fields(first:20){
|
projectV2(number: $number) {
|
||||||
nodes {
|
id
|
||||||
... on ProjectV2FieldCommon { id name }
|
number
|
||||||
... on ProjectV2SingleSelectField { options { id name } }
|
title
|
||||||
}
|
fields(first:20){
|
||||||
}
|
nodes {
|
||||||
items {
|
... on ProjectV2FieldCommon { id name }
|
||||||
nodes {
|
... on ProjectV2SingleSelectField { options { id name } }
|
||||||
id
|
|
||||||
status: fieldValueByName(name: "Status") {
|
|
||||||
... on ProjectV2ItemFieldSingleSelectValue { name }
|
|
||||||
}
|
}
|
||||||
content {
|
}
|
||||||
... on Issue {
|
items(first: 100, after: $after) {
|
||||||
number
|
pageInfo { hasNextPage endCursor }
|
||||||
closedByPullRequestsReferences(first: 8) {
|
nodes {
|
||||||
... on PullRequestConnection {
|
id
|
||||||
nodes {
|
status: fieldValueByName(name: "Status") {
|
||||||
number
|
... on ProjectV2ItemFieldSingleSelectValue { name }
|
||||||
mergeCommit { oid }
|
}
|
||||||
|
content {
|
||||||
|
... on Issue {
|
||||||
|
number
|
||||||
|
closedByPullRequestsReferences(first: 8) {
|
||||||
|
... on PullRequestConnection {
|
||||||
|
nodes {
|
||||||
|
number
|
||||||
|
mergeCommit { oid }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
... on PullRequest {
|
||||||
... on PullRequest {
|
number
|
||||||
number
|
mergeCommit { oid }
|
||||||
mergeCommit { oid }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
' -Variables @{ organization = $Organization; number = $Number; after = $cursor }
|
||||||
|
|
||||||
|
$n += $Project.organization.projectV2.items.nodes
|
||||||
|
$cursor = $Project.organization.projectV2.items.pageInfo.endCursor
|
||||||
|
$hasMore = $Project.organization.projectV2.items.pageInfo.hasNextPage
|
||||||
}
|
}
|
||||||
' -Variables @{ organization = $Organization; number = $Number }
|
$Project.organization.projectV2.items.nodes = $n
|
||||||
$Project
|
$Project
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user