Skip to content

Commit 2de5754

Browse files
Michael UsachenkoGitLab
authored andcommitted
Merge branch 'michaelusa/ontology-terminal-immutable' into 'main'
feat(ontology): add mutable and terminal_values property annotations See merge request gitlab-org/orbit/knowledge-graph!1619
2 parents 413fd48 + e73c73c commit 2de5754

31 files changed

Lines changed: 311 additions & 0 deletions

config/ontology/nodes/ci/deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,42 @@ properties:
2121
type: int64
2222
source: id
2323
nullable: false
24+
mutable: false
2425
description: "Unique ID."
2526

2627
iid:
2728
type: int64
2829
source: iid
2930
nullable: false
31+
mutable: false
3032
description: "Project-scoped deployment number."
3133

3234
project_id:
3335
type: int64
3436
source: project_id
3537
nullable: false
38+
mutable: false
3639
description: "Owning project ID."
3740

3841
ref:
3942
type: string
4043
source: ref
4144
nullable: false
45+
mutable: false
4246
description: "Git ref (branch or tag) deployed."
4347

4448
tag:
4549
type: boolean
4650
source: tag
4751
nullable: false
52+
mutable: false
4853
description: "Whether the ref is a tag."
4954

5055
sha:
5156
type: string
5257
source: sha
5358
nullable: false
59+
mutable: false
5460
description: "Deployed commit SHA."
5561

5662
status:
@@ -66,18 +72,21 @@ properties:
6672
4: canceled
6773
5: skipped
6874
6: blocked
75+
terminal_values: [success, failed, canceled, skipped]
6976

7077
deployable_type:
7178
type: string
7279
source: deployable_type
7380
nullable: false
81+
mutable: false
7482
description: "Polymorphic type (typically CommitStatus, the STI base class for Ci::Build)."
7583
selectivity: low
7684

7785
deployable_id:
7886
type: int64
7987
source: deployable_id
8088
nullable: true
89+
mutable: false
8190
description: "Deployable ID."
8291

8392
on_stop:
@@ -96,6 +105,7 @@ properties:
96105
type: timestamp
97106
source: created_at
98107
nullable: true
108+
mutable: false
99109
description: "Creation timestamp."
100110

101111
finished_at:
@@ -114,12 +124,14 @@ properties:
114124
type: int64
115125
source: environment_id
116126
nullable: false
127+
mutable: false
117128
description: "Target environment ID."
118129

119130
user_id:
120131
type: int64
121132
source: user_id
122133
nullable: true
134+
mutable: false
123135
description: "Deploying user ID."
124136

125137
traversal_path:

config/ontology/nodes/ci/environment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ properties:
2121
type: int64
2222
source: id
2323
nullable: false
24+
mutable: false
2425
description: "Unique ID."
2526

2627
project_id:
2728
type: int64
2829
source: project_id
2930
nullable: false
31+
mutable: false
3032
description: "Owning project ID."
3133

3234
name:
@@ -126,6 +128,7 @@ properties:
126128
type: timestamp
127129
source: created_at
128130
nullable: true
131+
mutable: false
129132
description: "Creation timestamp."
130133

131134
updated_at:
@@ -138,6 +141,7 @@ properties:
138141
type: int64
139142
source: merge_request_id
140143
nullable: true
144+
mutable: false
141145
description: "MR that created this review environment."
142146

143147
traversal_path:

config/ontology/nodes/ci/job.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ properties:
2121
type: int64
2222
source: id
2323
nullable: false
24+
mutable: false
2425
description: "Unique ID."
2526

2627
name:
2728
type: string
2829
source: name
2930
nullable: false
31+
mutable: false
3032
description: "Job name from .gitlab-ci.yml."
3133

3234
status:
@@ -49,17 +51,20 @@ properties:
4951
10: waiting_for_resource
5052
11: waiting_for_callback
5153
12: canceling
54+
terminal_values: [success, failed, canceled, skipped]
5255

5356
ref:
5457
type: string
5558
source: ref
5659
nullable: false
60+
mutable: false
5761
description: "Branch or tag name."
5862

5963
tag:
6064
type: boolean
6165
source: tag
6266
nullable: true
67+
mutable: false
6368
description: "Whether running on a git tag."
6469

6570
allow_failure:
@@ -84,6 +89,7 @@ properties:
8489
type: enum
8590
source: when
8691
nullable: false
92+
mutable: false
8793
description: "Run condition."
8894
enum_type: string
8995
values:
@@ -156,6 +162,7 @@ properties:
156162
type: timestamp
157163
source: created_at
158164
nullable: true
165+
mutable: false
159166
description: "Creation timestamp."
160167

161168
started_at:
@@ -180,6 +187,7 @@ properties:
180187
type: string
181188
source: type
182189
nullable: false
190+
mutable: false
183191
description: "STI class: Ci::Build, Ci::Bridge, or GenericCommitStatus."
184192
selectivity: low
185193

@@ -216,6 +224,7 @@ properties:
216224
type: enum
217225
source: scheduling_type
218226
nullable: false
227+
mutable: false
219228
description: "Scheduling mode: stage or DAG."
220229
values:
221230
0: stage
@@ -225,30 +234,35 @@ properties:
225234
type: int64
226235
source: project_id
227236
nullable: false
237+
mutable: false
228238
description: "Owning project ID."
229239

230240
user_id:
231241
type: int64
232242
source: user_id
233243
nullable: true
244+
mutable: false
234245
description: "Triggering user ID."
235246

236247
upstream_pipeline_id:
237248
type: int64
238249
source: upstream_pipeline_id
239250
nullable: true
251+
mutable: false
240252
description: "Upstream pipeline ID for bridge jobs."
241253

242254
stage_id:
243255
type: int64
244256
source: stage_id
245257
nullable: true
258+
mutable: false
246259
description: "Containing stage ID."
247260

248261
pipeline_id:
249262
type: int64
250263
source: commit_id
251264
nullable: true
265+
mutable: false
252266
description: "Containing pipeline ID. Source column is commit_id (legacy Rails naming)."
253267

254268
auto_canceled_by_id:

config/ontology/nodes/ci/pipeline.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,28 @@ properties:
2121
type: int64
2222
source: id
2323
nullable: false
24+
mutable: false
2425
description: "Unique ID."
2526

2627
iid:
2728
type: int64
2829
source: iid
2930
nullable: true
31+
mutable: false
3032
description: "Project-scoped pipeline number."
3133

3234
sha:
3335
type: string
3436
source: sha
3537
nullable: false
38+
mutable: false
3639
description: "Commit SHA the pipeline runs against."
3740

3841
ref:
3942
type: string
4043
source: ref
4144
nullable: false
45+
mutable: false
4246
description: "Branch or tag name."
4347

4448
status:
@@ -61,11 +65,13 @@ properties:
6165
10: waiting_for_resource
6266
11: waiting_for_callback
6367
12: canceling
68+
terminal_values: [success, failed, canceled, skipped]
6469

6570
source:
6671
type: enum
6772
source: source
6873
nullable: false
74+
mutable: false
6975
description: "Trigger source."
7076
values:
7177
0: unknown
@@ -93,6 +99,7 @@ properties:
9399
type: boolean
94100
source: tag
95101
nullable: false
102+
mutable: false
96103
description: "Whether running on a git tag."
97104

98105
duration:
@@ -125,6 +132,7 @@ properties:
125132
type: timestamp
126133
source: created_at
127134
nullable: true
135+
mutable: false
128136
description: "Creation timestamp."
129137

130138
started_at:
@@ -143,6 +151,7 @@ properties:
143151
type: timestamp
144152
source: committed_at
145153
nullable: true
154+
mutable: false
146155
description: "Commit timestamp."
147156

148157
updated_at:
@@ -155,6 +164,7 @@ properties:
155164
type: string
156165
source: before_sha
157166
nullable: false
167+
mutable: false
158168
description: "Previous commit SHA before the triggering push."
159169

160170
yaml_errors:
@@ -173,18 +183,21 @@ properties:
173183
type: int64
174184
source: project_id
175185
nullable: false
186+
mutable: false
176187
description: "Owning project ID."
177188

178189
user_id:
179190
type: int64
180191
source: user_id
181192
nullable: true
193+
mutable: false
182194
description: "Triggering user ID."
183195

184196
merge_request_id:
185197
type: int64
186198
source: merge_request_id
187199
nullable: true
200+
mutable: false
188201
description: "Triggering MR ID."
189202

190203
auto_canceled_by_id:

config/ontology/nodes/ci/runner.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ properties:
2222
type: int64
2323
source: id
2424
nullable: false
25+
mutable: false
2526
description: "Unique ID."
2627

2728
runner_type:
2829
type: enum
2930
source: runner_type
3031
nullable: false
32+
mutable: false
3133
description: "Scope: instance, group, or project."
3234
values:
3335
1: instance_type
@@ -89,6 +91,7 @@ properties:
8991
type: timestamp
9092
source: created_at
9193
nullable: true
94+
mutable: false
9295
description: "Registration timestamp."
9396

9497
contacted_at:

config/ontology/nodes/ci/stage.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ properties:
2121
type: int64
2222
source: id
2323
nullable: false
24+
mutable: false
2425
description: "Unique ID."
2526

2627
name:
2728
type: string
2829
source: name
2930
nullable: false
31+
mutable: false
3032
description: "Stage name (e.g. build, test, deploy)."
3133

3234
status:
@@ -48,6 +50,7 @@ properties:
4850
10: waiting_for_resource
4951
11: waiting_for_callback
5052
12: canceling
53+
terminal_values: [success, failed, canceled, skipped]
5154

5255
position:
5356
type: int64
@@ -59,6 +62,7 @@ properties:
5962
type: timestamp
6063
source: created_at
6164
nullable: true
65+
mutable: false
6266
description: "Creation timestamp."
6367

6468
updated_at:
@@ -71,12 +75,14 @@ properties:
7175
type: int64
7276
source: project_id
7377
nullable: false
78+
mutable: false
7479
description: "Owning project ID."
7580

7681
pipeline_id:
7782
type: int64
7883
source: pipeline_id
7984
nullable: true
85+
mutable: false
8086
description: "Containing pipeline ID."
8187

8288
traversal_path:

0 commit comments

Comments
 (0)