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

upd(api/models.py): Update comment on flag #2749

Merged
merged 1 commit into from
Dec 4, 2024
Merged
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
2 changes: 2 additions & 0 deletions kernelci/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@
default=[],
description="User groups that are permitted to update node"
)
# This flag should be reset on each update in API code, unless
# we are changing it's state intentionally
processed_by_kcidb_bridge: bool = Field(
description="Flag to indicate if the node was processed by KCIDB-Bridge",
default=False
Expand All @@ -274,7 +276,7 @@
self.updated = datetime.utcnow()

@field_validator('user_groups')
def validate_groups(cls, groups): # pylint: disable=no-self-argument

Check warning on line 279 in kernelci/api/models.py

View workflow job for this annotation

GitHub Actions / Lint

Method could be a function
"""Unique group constraint"""
unique_names = set(groups)
if len(unique_names) != len(groups):
Expand Down Expand Up @@ -419,7 +421,7 @@
default='checkout',
description='Type of the object',
)
data: CheckoutData = Field(

Check failure on line 424 in kernelci/api/models.py

View workflow job for this annotation

GitHub Actions / Lint

Incompatible types in assignment (expression has type "CheckoutData", base class "Node" defined the type as "Optional[Dict[str, Any]]") [assignment]
description="Checkout details",
default=None
)
Expand Down Expand Up @@ -494,7 +496,7 @@
default='kbuild',
description='Type of the object',
)
data: KbuildData = Field(

Check failure on line 499 in kernelci/api/models.py

View workflow job for this annotation

GitHub Actions / Lint

Incompatible types in assignment (expression has type "KbuildData", base class "Node" defined the type as "Optional[Dict[str, Any]]") [assignment]
description="Kbuild details",
default=None
)
Expand Down Expand Up @@ -589,7 +591,7 @@
default='test',
description='Type of the object',
)
data: TestData = Field(

Check failure on line 594 in kernelci/api/models.py

View workflow job for this annotation

GitHub Actions / Lint

Incompatible types in assignment (expression has type "TestData", base class "Node" defined the type as "Optional[Dict[str, Any]]") [assignment]
description="Test details",
default=None
)
Expand All @@ -606,7 +608,7 @@
default='job',
description='Type of the object',
)
data: TestData = Field(

Check failure on line 611 in kernelci/api/models.py

View workflow job for this annotation

GitHub Actions / Lint

Incompatible types in assignment (expression has type "TestData", base class "Node" defined the type as "Optional[Dict[str, Any]]") [assignment]
description="Test suite details",
default=None
)
Expand Down Expand Up @@ -688,7 +690,7 @@
"FAIL if the regression is still 'active', ie. the test "
"is still failing"),
)
data: RegressionData = Field(

Check failure on line 693 in kernelci/api/models.py

View workflow job for this annotation

GitHub Actions / Lint

Incompatible types in assignment (expression has type "RegressionData", base class "Node" defined the type as "Optional[Dict[str, Any]]") [assignment]
description="Regression details",
default=None
)
Expand Down Expand Up @@ -742,7 +744,7 @@
'data.defconfig',
'data.config_full',
'data.compiler',
'data.platform',]

Check warning on line 747 in kernelci/api/models.py

View workflow job for this annotation

GitHub Actions / Lint

missing whitespace after ','
for field in cmp_fields:
getter = attrgetter(field)
if getter(fail_node) != getter(pass_node):
Expand Down Expand Up @@ -803,7 +805,7 @@
# suppress pylint error below
# It's a known issue: https://github.com/pylint-dev/pylint/issues/6900
@field_validator('data')
def validate_data(cls, val): # pylint: disable=no-self-argument

Check warning on line 808 in kernelci/api/models.py

View workflow job for this annotation

GitHub Actions / Lint

Method could be a function
"""Do not allow 'None' as event payload data"""
if not val:
raise ValueError('None is not allowed as event payload')
Expand Down
Loading