Skip to content

Commit

Permalink
Filtering out cards without milestones
Browse files Browse the repository at this point in the history
  • Loading branch information
rladdusaw committed Sep 7, 2020
1 parent b601560 commit 56e4d9c
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -122,8 +122,10 @@ public List<Sprint> getAdditionalActiveSprints() throws Exception {
for (GHProject project : projects) {
String sprintId = String.valueOf(project.getId());
Map<String, List<Card>> partitionedCards = getCards(project);
int count = 0;
for (Entry<String, List<Card>> partition : partitionedCards.entrySet()) {
sprints.add(new Sprint(sprintId, partition.getKey(), ORGANIZATION, partition.getValue()));
sprints.add(new Sprint(sprintId + "-" + count, partition.getKey(), ORGANIZATION, partition.getValue()));
count++;
}
}
return sprints;
Expand Down Expand Up @@ -244,7 +246,10 @@ private Map<String, List<Card>> getCards(GHProject project) throws IOException {
cardContents.put(card.getId(), card.getContent());
}
Map<GHMilestone, List<GHProjectCard>> partitionedCards = projectCards.stream()
// Card without contents is a note
.filter(c -> cardContents.get(c.getId()) != null)
// Card without a milestone is not on the sprint
.filter(c -> cardContents.get(c.getId()).getMilestone() != null)
.collect(Collectors.groupingBy(c -> cardContents.get(c.getId()).getMilestone()));
for (Entry<GHMilestone, List<GHProjectCard>> partition : partitionedCards.entrySet()) {
List<Card> cards = new ArrayList<Card>();
Expand Down

0 comments on commit 56e4d9c

Please sign in to comment.