Skip to content

Commit

Permalink
fix(docs): update field names and query params
Browse files Browse the repository at this point in the history
- Added query params to tree/{commit-hash}/summary
- Updated field names of issue/{commit-hash}/tests
- Updated field names of issue/{commit-hash}/builds

Part of #86
  • Loading branch information
murilx committed Feb 6, 2025
1 parent a9fc4e2 commit 1171c10
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 84 deletions.
38 changes: 19 additions & 19 deletions backend/kernelCI_app/typeModels/issueDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,33 @@ class IssueDetailsPathParameters(BaseModel):


class IssueBuildItem(BaseModel):
id: Build__Id = Field(alias="build__id")
architecture: Build__Architecture = Field(alias="build__architecture")
config_name: Build__ConfigName = Field(alias="build__config_name")
valid: Build__Valid = Field(alias="build__valid")
start_time: Build__StartTime = Field(alias="build__start_time")
duration: Build__Duration = Field(alias="build__duration")
compiler: Build__Compiler = Field(alias="build__compiler")
log_url: Build__LogUrl = Field(alias="build__log_url")
tree_name: Checkout__TreeName = Field(alias="build__checkout__tree_name")
id: Build__Id = Field(validation_alias="build__id")
architecture: Build__Architecture = Field(validation_alias="build__architecture")
config_name: Build__ConfigName = Field(validation_alias="build__config_name")
valid: Build__Valid = Field(validation_alias="build__valid")
start_time: Build__StartTime = Field(validation_alias="build__start_time")
duration: Build__Duration = Field(validation_alias="build__duration")
compiler: Build__Compiler = Field(validation_alias="build__compiler")
log_url: Build__LogUrl = Field(validation_alias="build__log_url")
tree_name: Checkout__TreeName = Field(validation_alias="build__checkout__tree_name")
git_repository_branch: Checkout__GitRepositoryBranch = Field(
alias="build__checkout__git_repository_branch"
validation_alias="build__checkout__git_repository_branch"
)


class IssueTestItem(BaseModel):
id: Test__Id = Field(alias="test__id")
status: Test__Status = Field(alias="test__status")
duration: Test__Duration = Field(alias="test__duration")
path: Test__Path = Field(alias="test__path")
start_time: Test__StartTime = Field(alias="test__start_time")
id: Test__Id = Field(validation_alias="test__id")
status: Test__Status = Field(validation_alias="test__status")
duration: Test__Duration = Field(validation_alias="test__duration")
path: Test__Path = Field(validation_alias="test__path")
start_time: Test__StartTime = Field(validation_alias="test__start_time")
environment_compatible: Test__EnvironmentCompatible = Field(
alias="test__environment_compatible"
validation_alias="test__environment_compatible"
)
environment_misc: Test__EnvironmentMisc = Field(alias="test__environment_misc")
tree_name: Checkout__TreeName = Field(alias="test__build__checkout__tree_name")
environment_misc: Test__EnvironmentMisc = Field(validation_alias="test__environment_misc")
tree_name: Checkout__TreeName = Field(validation_alias="test__build__checkout__tree_name")
git_repository_branch: Checkout__GitRepositoryBranch = Field(
alias="test__build__checkout__git_repository_branch"
validation_alias="test__build__checkout__git_repository_branch"
)


Expand Down
2 changes: 1 addition & 1 deletion backend/kernelCI_app/typeModels/treeDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ class TreeDetailsBuildsResponse(BaseModel):


class TreeQueryParameters(BaseModel):
origin: str = "maestro"
origin: str
git_url: str
git_branch: str
4 changes: 3 additions & 1 deletion backend/kernelCI_app/views/treeDetailsSummaryView.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
process_tests_issue,
process_filters,
)
from kernelCI_app.typeModels.treeDetails import SummaryResponse
from kernelCI_app.typeModels.treeDetails import SummaryResponse, TreeQueryParameters
from kernelCI_app.utils import (
convert_issues_dict_to_list,
)
Expand Down Expand Up @@ -153,6 +153,8 @@ def _sanitize_rows(self, rows):

@extend_schema(
responses=SummaryResponse,
parameters=[TreeQueryParameters],
methods=["GET"],
)
def get(self, request, commit_hash: str | None):
rows = get_tree_details_data(request, commit_hash)
Expand Down
4 changes: 2 additions & 2 deletions backend/requests/issue-details-tests-get.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This will get the tests from the issue with the latest version, for a specific version pass ?version=n (n being an integer)
http 'http://localhost:8000/api/issue/maestro:0820fe153b255bf52750bbf1fecb198d8772f5a9/tests'

HTTP/1.1 200 OK
# HTTP/1.1 200 OK
# Allow: GET, HEAD, OPTIONS
# Cache-Control: max-age=0
# Content-Length: 1589
Expand Down Expand Up @@ -92,4 +92,4 @@ HTTP/1.1 200 OK
# "status": "FAIL",
# "tree_name": "net-next"
# }
# ]
# ]
123 changes: 62 additions & 61 deletions backend/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@ paths:
- in: query
name: origin
schema:
default: maestro
title: Origin
type: string
required: true
tags:
- tree
security:
Expand Down Expand Up @@ -558,9 +558,9 @@ paths:
- in: query
name: origin
schema:
default: maestro
title: Origin
type: string
required: true
tags:
- tree
security:
Expand Down Expand Up @@ -601,6 +601,24 @@ paths:
schema:
type: string
required: true
- in: query
name: git_branch
schema:
title: Git Branch
type: string
required: true
- in: query
name: git_url
schema:
title: Git Url
type: string
required: true
- in: query
name: origin
schema:
title: Origin
type: string
required: true
tags:
- tree
security:
Expand Down Expand Up @@ -638,9 +656,9 @@ paths:
- in: query
name: origin
schema:
default: maestro
title: Origin
type: string
required: true
tags:
- tree
security:
Expand Down Expand Up @@ -1266,19 +1284,16 @@ components:
title: Git Repository Branch
tree_name:
anyOf:
- type: string
- $ref: '#/components/schemas/Checkout__TreeName'
- type: 'null'
title: Tree Name
issue_id:
anyOf:
- type: string
- $ref: '#/components/schemas/Issue__Id'
- type: 'null'
title: Issue Id
issue_version:
anyOf:
- type: integer
- $ref: '#/components/schemas/Issue__Version'
- type: 'null'
title: Issue Version
required:
- id
- architecture
Expand Down Expand Up @@ -1599,37 +1614,37 @@ components:
type: object
IssueBuildItem:
properties:
build__id:
id:
$ref: '#/components/schemas/Build__Id'
build__architecture:
architecture:
$ref: '#/components/schemas/Build__Architecture'
build__config_name:
config_name:
$ref: '#/components/schemas/Build__ConfigName'
build__valid:
valid:
$ref: '#/components/schemas/Build__Valid'
build__start_time:
start_time:
$ref: '#/components/schemas/Build__StartTime'
build__duration:
duration:
$ref: '#/components/schemas/Build__Duration'
build__compiler:
compiler:
$ref: '#/components/schemas/Build__Compiler'
build__log_url:
log_url:
$ref: '#/components/schemas/Build__LogUrl'
build__checkout__tree_name:
tree_name:
$ref: '#/components/schemas/Checkout__TreeName'
build__checkout__git_repository_branch:
git_repository_branch:
$ref: '#/components/schemas/Checkout__GitRepositoryBranch'
required:
- build__id
- build__architecture
- build__config_name
- build__valid
- build__start_time
- build__duration
- build__compiler
- build__log_url
- build__checkout__tree_name
- build__checkout__git_repository_branch
- id
- architecture
- config_name
- valid
- start_time
- duration
- compiler
- log_url
- tree_name
- git_repository_branch
title: IssueBuildItem
type: object
IssueBuildsResponse:
Expand Down Expand Up @@ -1657,10 +1672,6 @@ components:
$ref: '#/components/schemas/Issue__CulpritTool'
culprit_harness:
$ref: '#/components/schemas/Issue__CulpritHarness'
build_valid:
$ref: '#/components/schemas/Issue__BuildValid'
test_status:
$ref: '#/components/schemas/Issue__TestStatus'
comment:
$ref: '#/components/schemas/Issue__Comment'
misc:
Expand All @@ -1675,53 +1686,47 @@ components:
- culprit_code
- culprit_tool
- culprit_harness
- build_valid
- test_status
- comment
- misc
title: IssueDetailsResponse
type: object
IssueTestItem:
properties:
test__id:
id:
$ref: '#/components/schemas/Test__Id'
test__status:
status:
$ref: '#/components/schemas/Test__Status'
test__duration:
duration:
$ref: '#/components/schemas/Test__Duration'
test__path:
path:
$ref: '#/components/schemas/Test__Path'
test__start_time:
start_time:
$ref: '#/components/schemas/Test__StartTime'
test__environment_compatible:
environment_compatible:
$ref: '#/components/schemas/Test__EnvironmentCompatible'
test__environment_misc:
environment_misc:
$ref: '#/components/schemas/Test__EnvironmentMisc'
test__build__checkout__tree_name:
tree_name:
$ref: '#/components/schemas/Checkout__TreeName'
test__build__checkout__git_repository_branch:
git_repository_branch:
$ref: '#/components/schemas/Checkout__GitRepositoryBranch'
required:
- test__id
- test__status
- test__duration
- test__path
- test__start_time
- test__environment_compatible
- test__environment_misc
- test__build__checkout__tree_name
- test__build__checkout__git_repository_branch
- id
- status
- duration
- path
- start_time
- environment_compatible
- environment_misc
- tree_name
- git_repository_branch
title: IssueTestItem
type: object
IssueTestsResponse:
items:
$ref: '#/components/schemas/IssueTestItem'
title: IssueTestsResponse
type: array
Issue__BuildValid:
anyOf:
- type: boolean
- type: 'null'
Issue__Comment:
anyOf:
- type: string
Expand Down Expand Up @@ -1752,10 +1757,6 @@ components:
anyOf:
- type: string
- type: 'null'
Issue__TestStatus:
anyOf:
- type: string
- type: 'null'
Issue__Version:
type: integer
Jsonb:
Expand Down

0 comments on commit 1171c10

Please sign in to comment.