Skip to content

Commit 860a4b4

Browse files
author
Frans Fürst
committed
jenkins/utils: fix ValidationError due to missing type attribute
Change-Id: I39de0fbb4a4cdfbd4e259d58266a7487bbc5a7c3
1 parent 4cae586 commit 860a4b4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cmk_dev/jenkins_utils/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ class BuildNode(PedanticBaseModel):
290290
displayName: str
291291

292292
# BuildNode instances never have a _class, but we want to derive PedanticBaseModel
293-
type: Literal["undefined"] = "undefined"
293+
type: str = "BuildNode"
294+
294295
_ignored_keys = {
295296
"offline", # : bool
296297
"absoluteRemotePath", # : None | str = None
@@ -331,6 +332,11 @@ class StageInfo(PedanticBaseModel):
331332
begin: int
332333
duration: int
333334
execNode: str
335+
336+
# StageInfo instances not always have a _class, but we want to derive PedanticBaseModel
337+
type: str = "StageInfo"
338+
339+
# not the same as JobResult unfortunately
334340
status: Literal["FAILED", "IN_PROGRESS", "SUCCESS", "ABORTED", "NOT_EXECUTED", "UNSTABLE"]
335341

336342
@model_validator(mode="before")
@@ -356,6 +362,10 @@ class BuildStages(PedanticBaseModel):
356362
id: str
357363
name: str
358364
status: str
365+
366+
# StageInfo instances not always have a _class, but we want to derive PedanticBaseModel
367+
type: Literal["undefined"] = "undefined"
368+
359369
# ignore: pauseDurationMillis, queueDurationMillis, _links
360370

361371
@model_validator(mode="before")
@@ -382,6 +392,7 @@ class Change(PedanticBaseModel):
382392
author_email: str
383393
url: str
384394
affected: Sequence[str] = []
395+
type: str = "Change"
385396

386397
def markdown(self) -> str:
387398
"""Returns a nice looking rich.Text representation"""

0 commit comments

Comments
 (0)