Skip to content

Commit

Permalink
Merge pull request #22 from siisurit/6-check-milestone
Browse files Browse the repository at this point in the history
#6 Check milestone
  • Loading branch information
mcsken authored Oct 29, 2024
2 parents 93b95f0 + 89d56f4 commit 21ad983
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions check_done/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ def _is_not_assigned(project_item: ProjectItemInfo) -> bool:
return project_item.assignees.total_count < 1


def _has_no_milestone(project_item: ProjectItemInfo) -> bool:
return project_item.milestone is None


CONDITION_CHECK_AND_WARNING_REASON_LIST = [
(_is_not_closed, "not closed"),
(_is_not_assigned, "missing assignee"),
(_has_no_milestone, "missing milestone"),
]
5 changes: 5 additions & 0 deletions check_done/done_project_items_info/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,16 @@ class AssigneesInfo(BaseModel):
total_count: NonNegativeInt = Field(alias="totalCount")


class MilestoneInfo(BaseModel):
id: str


class ProjectItemInfo(BaseModel):
assignees: AssigneesInfo
closed: bool
number: NonNegativeInt
repository: RepositoryInfo
milestone: MilestoneInfo | None
title: str


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ query projectV2Issues(
totalCount
}
number
milestone {
id
}
closed
title
repository {
Expand All @@ -31,6 +34,9 @@ query projectV2Issues(
totalCount
}
number
milestone {
id
}
closed
title
repository {
Expand Down

0 comments on commit 21ad983

Please sign in to comment.