Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api.models: re-format Regression data field #388

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ class Hierarchy(BaseModel):
Hierarchy.update_forward_refs()


class RegressionData(BaseModel):
"""Model for the data field of a Regression"""
node_failed: PyObjectId
node_passed: PyObjectId


class Regression(Node):
"""API model for regression tracking"""

Expand All @@ -377,18 +383,14 @@ class Regression(Node):
description='Type of the object',
const=True
)
regression_data: List[Node] = Field(
description='Regression details'

data: RegressionData = Field(
description="Regression details"
)

_OBJECT_ID_FIELDS = Node._OBJECT_ID_FIELDS + [
'regression_data.parent',
]
_TIMESTAMP_FIELDS = Node._TIMESTAMP_FIELDS + [
'regression_data.created',
'regression_data.updated',
'regression_data.timeout',
'regression_data.holdoff',
'data.node_failed',
'data.node_passed',
]


Expand Down
Loading