Skip to content

Commit 21ad983

Browse files
authored
Merge pull request #22 from siisurit/6-check-milestone
#6 Check milestone
2 parents 93b95f0 + 89d56f4 commit 21ad983

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

check_done/checks.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ def _is_not_assigned(project_item: ProjectItemInfo) -> bool:
3636
return project_item.assignees.total_count < 1
3737

3838

39+
def _has_no_milestone(project_item: ProjectItemInfo) -> bool:
40+
return project_item.milestone is None
41+
42+
3943
CONDITION_CHECK_AND_WARNING_REASON_LIST = [
4044
(_is_not_closed, "not closed"),
4145
(_is_not_assigned, "missing assignee"),
46+
(_has_no_milestone, "missing milestone"),
4247
]

check_done/done_project_items_info/info.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,16 @@ class AssigneesInfo(BaseModel):
8080
total_count: NonNegativeInt = Field(alias="totalCount")
8181

8282

83+
class MilestoneInfo(BaseModel):
84+
id: str
85+
86+
8387
class ProjectItemInfo(BaseModel):
8488
assignees: AssigneesInfo
8589
closed: bool
8690
number: NonNegativeInt
8791
repository: RepositoryInfo
92+
milestone: MilestoneInfo | None
8893
title: str
8994

9095

check_done/done_project_items_info/queries/project_v2_items.graphql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ query projectV2Issues(
2020
totalCount
2121
}
2222
number
23+
milestone {
24+
id
25+
}
2326
closed
2427
title
2528
repository {
@@ -31,6 +34,9 @@ query projectV2Issues(
3134
totalCount
3235
}
3336
number
37+
milestone {
38+
id
39+
}
3440
closed
3541
title
3642
repository {

0 commit comments

Comments
 (0)