Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var currentVersion = "4.0.2"
var currentVersion = "4.1.0"

if (project.hasProperty("snapshot")) {
currentVersion = "${currentVersion}-SNAPSHOT"
Expand Down
7 changes: 0 additions & 7 deletions src/main/graphql/zenhub/GetMilestone.graphql

This file was deleted.

11 changes: 1 addition & 10 deletions src/main/graphql/zenhub/GetSprints.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@ query GetSprints($workspaceId: ID!, $sprintsEndCursor: String) {
endCursor
}
nodes {
id
name
startAt
endAt
# No need to get all issues as we rarely exceed 50 issues in a sprint
issues(first: 100) {
nodes {
id
}
}
...SprintFragment
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use a fragment here for better code re-use

}
}
}
Expand Down
13 changes: 1 addition & 12 deletions src/main/graphql/zenhub/GetSprintsByState.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
query GetSprintsByState($workspaceId: ID!, $sprintFilters: SprintFiltersInput!, $firstSprints: Int!, $orderSprintsBy: SprintOrderInput!, $endCursor: String) {
workspace(id: $workspaceId) {
id
displayName
Comment on lines -3 to -4
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these values aren't used

sprints(
first: $firstSprints
filters: $sprintFilters
Expand All @@ -13,16 +11,7 @@ query GetSprintsByState($workspaceId: ID!, $sprintFilters: SprintFiltersInput!,
endCursor
}
nodes {
id
name
startAt
endAt
# No need to get all issues as we rarely exceed 50 issues in a sprint
issues(first: 100) {
nodes {
id
}
}
...SprintFragment
}
}
}
Expand Down
8 changes: 0 additions & 8 deletions src/main/graphql/zenhub/SetMilestoneStartDate.graphql

This file was deleted.

5 changes: 5 additions & 0 deletions src/main/graphql/zenhub/fragments/IssueFragment.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ fragment IssueFragment on Issue {
id
title
number
assignees {
nodes {
login
}
}
Comment on lines +5 to +9
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this to display assignee info in the sprint summary report

estimate {
value
}
Expand Down
12 changes: 12 additions & 0 deletions src/main/graphql/zenhub/fragments/SprintFragment.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
fragment SprintFragment on Sprint {
id
name
startAt
endAt
# No need to get all issues as we rarely exceed 50 issues in a sprint
issues(first: 100) {
nodes {
id
}
}
}
19 changes: 0 additions & 19 deletions src/main/kotlin/zenhub/ZenHubClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -437,25 +437,6 @@ class ZenHubClient(
apolloClient.query(query).toFlow().single().data?.workspace?.epics
}

fun getMilestone(
githubRepoId: Int,
milestoneNumber: Int
): GetMilestoneQuery.MilestoneByRepoGhIdAndNumber? = runBlocking {
val query = GetMilestoneQuery(githubRepoId, milestoneNumber)
apolloClient.query(query).toFlow().single().data?.milestoneByRepoGhIdAndNumber
}

fun setMilestoneStartDate(
milestoneId: String,
startDate: Instant?
): SetMilestoneStartDateMutation.Milestone? = runBlocking {
val input =
SetMilestoneStartDateInput(
Optional.absent(), milestoneId, Optional.present(startDate.toString()))
val mutation = SetMilestoneStartDateMutation(input)
apolloClient.mutation(mutation).toFlow().single().data?.setMilestoneStartDate?.milestone
}

fun getEpicsByIds(epicIds: List<String>): List<EpicData> = runBlocking {
val epics = mutableListOf<EpicData>()
val numPages = epicIds.size / DEFAULT_PAGE_SIZE
Expand Down