Skip to content

Commit

Permalink
Small improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniessink committed Aug 27, 2024
1 parent 1f14006 commit fed400a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
2 changes: 1 addition & 1 deletion components/collector/src/source_collectors/github/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Github collector base classes."""
"""GitHub collector base classes."""

from abc import ABC

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,56 @@


class TotalCount(TypedDict):
"""The TotalCount JSON as returned by the Github merge request API endpoint."""
"""The TotalCount JSON as returned by the GitHub merge request API endpoint."""

totalCount: str


class Node(TypedDict):
"""The Node JSON as returned by the Github merge request API endpoint."""
"""The Node JSON as returned by the GitHub merge request API endpoint."""

id: int
title: str
baseRefName: str
state: str
url: str
createdAt: str
updatedAt: str
mergedAt: str
createdAt: str | None
updatedAt: str | None
mergedAt: str | None
reviewDecision: str
reactions: TotalCount
comments: TotalCount


class PageInfo(TypedDict):
"""The PageInfo JSON as returned by the Github merge request API endpoint."""
"""The PageInfo JSON as returned by the GitHub merge request API endpoint."""

hasNextPage: bool
endCursor: str


class PullRequests(TypedDict):
"""The PullRequests JSON as returned by the Github merge request API endpoint."""
"""The PullRequests JSON as returned by the GitHub merge request API endpoint."""

pageInfo: PageInfo
totalCount: int
nodes: list[Node]


class Repository(TypedDict):
"""The Repository JSON as returned by the Github merge request API endpoint."""
"""The Repository JSON as returned by the GitHub merge request API endpoint."""

pullRequests: PullRequests


class Data(TypedDict):
"""The Data JSON as returned by the Github merge request API endpoint."""
"""The Data JSON as returned by the GitHub merge request API endpoint."""

repository: Repository


class Response(TypedDict):
"""The Response JSON as returned by the Github merge request API endpoint."""
"""The Response JSON as returned by the GitHub merge request API endpoint."""

data: Data

Expand All @@ -70,22 +76,22 @@ def create_node_json(
number: int,
branch: str = "default",
state: str = "MERGED",
review_decision: str | None = None,
review_decision: str = "?",
) -> Node:
"""Create a merge request."""
return {
"id": number,
"title": f"Merge request {number}",
"baseRefName": branch,
"state": state,
"url": f"https://github/pull{number}",
"createdAt": "2017-04-29T08:46:00Z",
"updatedAt": "2017-04-29T09:40:00Z",
"mergedAt": None,
"reviewDecision": review_decision,
"reactions": {"totalCount": number},
"comments": {"totalCount": number},
}
return Node(
id=number,
title=f"Merge request {number}",
baseRefName=branch,
state=state,
url=f"https://github/pull{number}",
createdAt="2017-04-29T08:46:00Z",
updatedAt="2017-04-29T09:40:00Z",
mergedAt=None,
reviewDecision=review_decision,
reactions=TotalCount(totalCount=str(number)),
comments=TotalCount(totalCount=str(number)),
)

@staticmethod
def merge_requests_json(
Expand Down
7 changes: 2 additions & 5 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ If your currently installed *Quality-time* version is not v5.15.0, please first
### Added

- Allow for configuring Jenkins as source for the metric 'CI-pipeline duration' (GitLab CI was already supported, Azure DevOps will follow later). Partially implements [#6423](https://github.com/ICTU/quality-time/issues/6423).
- Add GitHub as possible source for the 'merge requests' metric. Patch contributed by Tobias Termeczky (the/experts). Closes [#9323](https://github.com/ICTU/quality-time/issues/9323).

## v5.15.0 - 2024-07-30

### Added

- Add GitHub as possible source for the 'merge requests' metric. Patch contributed by Tobias Termeczky (the/experts). Closes [#9323](https://github.com/ICTU/quality-time/issues/9323).

### Deployment notes

If your currently installed *Quality-time* version is not v5.14.0, please first check the upgrade path in the [versioning policy](versioning.md).
Expand All @@ -38,7 +35,7 @@ If your currently installed *Quality-time* version is not v5.14.0, please first
- Give measurement entity tables sticky headers, like the metric tables already have. Closes [#8879](https://github.com/ICTU/quality-time/issues/8879).

### Changed

- Change the order of the metric tabs to follow the natural usage order, first configure metric and sources, then manage the measurements. Closes [#8824](https://github.com/ICTU/quality-time/issues/8824).
- Always show metric trend graph tabs. Display a loader in the tab while loading measurements. If the trend graph cannot be displayed, explain in the tab why not. Closes [#8825](https://github.com/ICTU/quality-time/issues/8825).
- Always show measurement entity tabs. Display a loader in the tab while loading measurements. If the measurement entities cannot be displayed, explain in the tab why not. Closes [#8826](https://github.com/ICTU/quality-time/issues/8826).
Expand Down

0 comments on commit fed400a

Please sign in to comment.