-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add tree commits documentation
- Loading branch information
Showing
3 changed files
with
163 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from datetime import datetime | ||
from typing import List | ||
from pydantic import BaseModel, RootModel, Field | ||
|
||
from kernelCI_app.typeModels.commonDetails import BuildStatusCount | ||
from kernelCI_app.typeModels.databases import ( | ||
Checkout__GitCommitHash, | ||
Checkout__GitCommitName | ||
) | ||
|
||
|
||
class TreeCommitsTestStatusCount(BaseModel): | ||
fail_count: int = Field(alias="fail") | ||
error_count: int = Field(alias="error") | ||
miss_count: int = Field(alias="miss") | ||
pass_count: int = Field(alias="pass") | ||
done_count: int = Field(alias="done") | ||
skip_count: int = Field(alias="skip") | ||
null_count: int = Field(alias="null") | ||
|
||
|
||
class TreeCommitsQueryParameters(BaseModel): | ||
origin: str | ||
git_url: str | ||
git_branch: str | ||
start_time_stamp_in_seconds: str | ||
end_time_stamp_in_seconds: str | ||
# TODO: Add filters field in this model | ||
|
||
|
||
class TreeCommitsData(BaseModel): | ||
git_commit_hash: Checkout__GitCommitHash | ||
git_commit_name: Checkout__GitCommitName | ||
earliest_start_time: datetime | ||
builds: BuildStatusCount | ||
boots: TreeCommitsTestStatusCount | ||
tests: TreeCommitsTestStatusCount | ||
|
||
|
||
class TreeCommitsResponse(RootModel): | ||
root: List[TreeCommitsData] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters