Skip to content

Commit 1801fee

Browse files
committed
api.models: add KernelVersion to Revision
Add a KernelVersion model and include it in Revision to store the Linux kernel version information. Signed-off-by: Guillaume Tucker <[email protected]>
1 parent a0d1d12 commit 1801fee

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

api/models.py

+22
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,25 @@ class User(ModelId):
102102
)
103103

104104

105+
class KernelVersion(BaseModel):
106+
"""Linux kernel version model"""
107+
version: int = Field(
108+
description="Major version number e.g. 4 in 'v4.19'"
109+
)
110+
patchlevel: int = Field(
111+
description="Minor version number or 'patch level' e.g. 19 in 'v4.19'"
112+
)
113+
sublevel: Optional[int] = Field(
114+
description="Stable version or 'sub-level' e.g. 123 in 'v4.19.123'"
115+
)
116+
extra: Optional[str] = Field(
117+
description="Extra version string e.g. -rc2 in 'v4.19-rc2'"
118+
)
119+
name: Optional[str] = Field(
120+
description="Version name e.g. People's Front for v4.19"
121+
)
122+
123+
105124
class Revision(BaseModel):
106125
"""Linux kernel Git revision model"""
107126
tree: str = Field(
@@ -120,6 +139,9 @@ class Revision(BaseModel):
120139
default=None,
121140
description='git describe of the revision'
122141
)
142+
version: Optional[KernelVersion] = Field(
143+
description="Kernel version"
144+
)
123145

124146

125147
class Node(DatabaseModel):

0 commit comments

Comments
 (0)