• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / GitProjectHealth / 15138400978

20 May 2025 01:09PM UTC coverage: 72.46% (-0.8%) from 73.222%
15138400978

Pull #196

github

web-flow
Merge 5333b1b84 into 118855527
Pull Request #196: Pipeline 2

781 of 1772 new or added lines in 15 files covered. (44.07%)

38 existing lines in 2 files now uncovered.

15984 of 22059 relevant lines covered (72.46%)

0.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/GitLabHealth-Model-Generator/GLHMetamodelGenerator.class.st
1
Class {
2
        #name : #GLHMetamodelGenerator,
3
        #superclass : #FamixMetamodelGenerator,
4
        #instVars : [
5
                'project',
6
                'group',
7
                'pipeline',
8
                'user',
9
                'repository',
10
                'branch',
11
                'file',
12
                'fileBlob',
13
                'fileDirectory',
14
                'commit',
15
                'commitStats',
16
                'diff',
17
                'job',
18
                'mergeRequest',
19
                'diffRange',
20
                'change',
21
                'addition',
22
                'deletion',
23
                'lineOfCode',
24
                'note',
25
                'entity'
26
        ],
27
        #category : #'GitLabHealth-Model-Generator'
28
}
29

30
{ #category : #accessing }
31
GLHMetamodelGenerator class >> packageName [
×
32
        ^ #'GitLabHealth-Model'
×
33
]
×
34

35
{ #category : #accessing }
36
GLHMetamodelGenerator class >> prefix [
×
37
        ^ #GLH
×
38
]
×
39

40
{ #category : #accessing }
41
GLHMetamodelGenerator class >> submetamodels [
×
42

×
43
        ^ { FamixMooseQueryGenerator . FamixGenerator }
×
44
]
×
45

46
{ #category : #definition }
47
GLHMetamodelGenerator >> branchProperties [
×
48

×
49
        branch property: #name type: #String
×
50
]
×
51

52
{ #category : #definition }
53
GLHMetamodelGenerator >> changeProperties [
×
54

×
55
        change property: #index type: #Number.
×
56
        change property: #relativeIndex type: #Number.
×
57
        change property: #sourceCode type: #String. 
×
58
        addition property: #delimiter type: #String defaultValue: '#+'.
×
59
        deletion property: #delimiter type: #String defaultValue: '#-'
×
60
]
×
61

62
{ #category : #definition }
63
GLHMetamodelGenerator >> commitProperties [
×
64

×
65
        commit property: #parent_ids type: #Object defaultValue: 'OrderedCollection new'.
×
66

×
67
        commit property: #id type: #String.
×
68
        commit property: #short_id type: #String.
×
69
        commit property: #title type: #String.
×
70
        commit property: #author_name type: #String.
×
71
        commit property: #author_email type: #String.
×
72
        commit property: #authored_date type: #Object.
×
73
        commit property: #committer_name type: #String.
×
74
        commit property: #committer_email type: #String.
×
75
        commit property: #committed_date type: #Object.
×
76
        commit property: #created_at type: #Object.
×
77
        commit property: #message type: #String.
×
78
        commit property: #web_url type: #String.
×
79

×
80

×
81
        (commit property: #additions type: #Number) comment:
×
82
                'The number of line that git consider added'.
×
83
        (commit property: #deletions type: #Number) comment:
×
84
                'The number of line that git consider deleted'
×
85
]
×
86

87
{ #category : #definition }
88
GLHMetamodelGenerator >> defineClasses [
×
89

×
90
        super defineClasses.
×
91
        entity := (builder ensureClassNamed: #Entity).
×
92
        group := builder newClassNamed: #Group comment: 'A GitLab Group'.
×
93
        group withGroup.
×
94
        project := builder
×
95
                           newClassNamed: #Project
×
96
                           comment: 'A GitLab Project'.
×
97
        pipeline := builder
×
98
                            newClassNamed: #Pipeline
×
99
                            comment: 'A GitLab Pipeline execution'.
×
100
        user := builder newClassNamed: #User comment: 'A GitLab User'.
×
101
        repository := builder
×
102
                              newClassNamed: #Repository
×
103
                              comment: 'A git repository'.
×
104
        branch := builder newClassNamed: #Branch comment: 'A git branch'.
×
105
        file := builder newClassNamed: #File comment: 'A file'.
×
106
        fileBlob := builder newClassNamed: #FileBlob comment: 'A file blob'.
×
107
        fileDirectory := builder
×
108
                                 newClassNamed: #FileDirectory
×
109
                                 comment: 'A file directory'.
×
110
        commit := builder
×
111
                          newClassNamed: #Commit
×
112
                          comment: 'a commit attached to a repository'.
×
113
        diff := builder newClassNamed: #Diff comment: 'The diff of a commit'.
×
114
        
×
115
        job := builder newClassNamed: #Job comment: 'A CI Job'.
×
116
        
×
117
        mergeRequest := builder
×
118
                                newClassNamed: #MergeRequest
×
119
                                comment: 'a gitlab merge request'.
×
120

×
121
        change := builder
×
122
                          newClassNamed: #Change
×
123
                          comment: 'super class for addition and deletion '.
×
124

×
125
        addition := builder
×
126
                            newClassNamed: #Addition
×
127
                            comment:
×
128
                            'a detected addition of a line, seen within a diff '.
×
129
        addition withTesting.
×
130
        deletion := builder
×
131
                            newClassNamed: #Deletion
×
132
                            comment:
×
133
                            'a detected deletion of a line, seen within a diff '.
×
134
        deletion withTesting.
×
135

×
136
        lineOfCode := builder
×
137
                              newClassNamed: #LineOfCode
×
138
                              comment: 'a line of code in a diff comparaison '.
×
139

×
140
        diffRange := builder
×
141
                             newClassNamed: #DiffRange
×
142
                             comment:
×
143
                             'a indicate on which line of code are concerned by a diff (usually declared with @@ oldRange, newRange @@) '.
×
144
                
×
145
        note := builder
×
146
                             newClassNamed: #Note
×
147
                             comment:
×
148
                             'a note (a diff) proposed in a Merge Request; can be accepted, modified or deleted'.
×
149
]
×
150

151
{ #category : #definition }
152
GLHMetamodelGenerator >> defineHierarchy [
×
153

×
154
        super defineHierarchy.
×
155
        entity --|> #TEntityMetaLevelDependency.
×
156
        fileDirectory --|> file.
×
157
        fileBlob --|> file.
×
158

×
159
        group --|> #TNamedEntity.
×
160
        project --|> #TNamedEntity.
×
161
        user --|> #TNamedEntity.
×
162
        commit --|> #TNamedEntity.
×
163
        diff --|> #TNamedEntity.
×
164
        job --|> #TNamedEntity.
×
165
        note --|> #TNamedEntity.
×
166

×
167
        change --|> #TNamedEntity.
×
168
        change <|-- addition.
×
169
        change <|-- deletion.
×
170
        change <|-- lineOfCode.
×
171
        mergeRequest --|> #TNamedEntity
×
172
]
×
173

174
{ #category : #definition }
175
GLHMetamodelGenerator >> defineProperties [
×
176

×
177
        super defineProperties.
×
178
        "Group properties"
×
179
        group property: #id type: #Number.
×
180
        group property: #web_url type: #String.
×
181
        group property: #description type: #String.
×
182
        group property: #visibility type: #String.
×
183
        group property: #avatar_url type: #String.
×
184

×
185
        "Project properties"
×
186
        project property: #id type: #Number.
×
187
        project property: #topics type: #Object.
×
188
        project property: #archived type: #Boolean.
×
189
        project property: #archived type: #Boolean.
×
190
        project property: #description type: #String.
×
191
        project property: #readme_url type: #String.
×
192
        project property: #avatar_url type: #String.
×
193
        project property: #web_url type: #String.
×
194
        project property: #creator_id type: #Number.
×
195

×
NEW
196
        self pipelinesProperties.
×
197
        self userProperties.
×
198
        self branchProperties.
×
199
        self fileProperties.
×
200
        self commitProperties.
×
201
        self diffProperties.
×
202
        self jobProperties.
×
203
        self changeProperties.
×
204
        self mergeRequestProperties.
×
205
        self diffRangeProperties.
×
206
        self noteProperties.
×
207
]
×
208

209
{ #category : #definition }
210
GLHMetamodelGenerator >> defineRelations [
×
211

×
212
        super defineRelations.
×
213
        (group property: #projects) <>-* (project property: #group).
×
214
        (group property: #subGroups) <>-* (group property: #group).
×
215
        (project property: #pipelines) <>-* (pipeline property: #project).
×
216
        (project property: #creator) *- (user property: #createdProjects).
×
217
        (project property: #contributors)
×
218
        *-* (user property: #contributedProjects).
×
219
        (project property: #repository) <>- (repository property: #project).
×
220
        (repository property: #branches) <>-* (branch property: #repository).
×
221
        (branch property: #files) <>-* (file property: #branch).
×
222
        (fileDirectory property: #files)
×
223
        <>-* (file property: #directoryOwner).
×
224
        (repository property: #commits) <>-* (commit property: #repository).
×
225
        (branch property: #commits) <>-* (commit property: #branch).
×
226

×
227
        (commit property: #diffs) <>-* (diff property: #commit).
×
228
        (user property: #commits) <>-* (commit property: #commitCreator).
×
229
        (commit property: #parentCommits)
×
230
        *-* (commit property: #childCommits).
×
231
        (commit property: #jobs) <>-* (job property: #commit).
×
232
        (pipeline property: #jobs) <>-* (job property: #pipeline).
×
NEW
233
        (pipeline property: #user) *- (user property: #launchedPipelines).
×
NEW
234

×
235
        (user property: #jobs) <>-* (job property: #user).
×
236

×
237
        "MERGE REQUEST RELATIONS"
×
238
        (mergeRequest property: #author)
×
239
        *- (user property: #createdMergeRequests).
×
240

×
241
        (mergeRequest property: #approved_by)
×
242
        *-* (user property: #approcheMergeRequests).
×
243

×
244
        (mergeRequest property: #merge_user) *- (user property: #usedMerges).
×
245

×
246
        (mergeRequest property: #closed_by)
×
247
        *- (user property: #closedMergeRequests).
×
248

×
249
        (mergeRequest property: #merged_by)
×
250
        *- (user property: #mergerOfMergeRequests).
×
251

×
252
        (mergeRequest property: #assignees)
×
253
        *-* (user property: #assignedMergeRequests).
×
254

×
255
        (mergeRequest property: #assignee)
×
256
        *- (user property: #currentlyAssignedMergeRequest).
×
257

×
258
        (mergeRequest property: #reviewers)
×
259
        *-* (user property: #reviewedMergeResquest).
×
260

×
NEW
261
        (mergeRequest property: #pipelines)
×
NEW
262
        <>-* (pipeline property: #mergeResquest).
×
263

×
264
        (mergeRequest property: #mergedCommit)
×
265
        - (commit property: #commitedMergeRequest).
×
266

×
267
        (mergeRequest property: #mergeRequestCommit)
×
268
        - (commit property: #commitedMergeRequest).
×
269

×
270
        (mergeRequest property: #squashCommit)
×
271
        - (commit property: #squashedMergeRequest).
×
272

×
273
        (mergeRequest property: #diffs) -* (diff property: #mergeRequest).
×
274

×
275
        (project property: #mergeRequests)
×
276
        <>-* (mergeRequest property: #project).
×
277
        
×
278
        (note property: #mergeRequest) *- (mergeRequest property: #note).
×
279

×
280
        "DIFF"
×
281
        (diff property: #file) <>-* (file property: #diffs).
×
282
        (diff property: #diffRanges) <>-* (diffRange property: #diff).
×
283
        (diffRange property: #changes) -* (change property: #diffRange)
×
284
]
×
285

286
{ #category : #definition }
287
GLHMetamodelGenerator >> diffProperties [
×
288

×
289
        (diff property: #diffString type: #String) comment:
×
290
                'The string presenting the diff. It should follow the [Detailed-Unified](https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html) format'.
×
291
                
×
292
        (diff property: #new_path type: #String) comment:
×
293
                'The path to the file in the resulted repository commitish'.
×
294
                
×
295
        (diff property: #old_path type: #String) comment:
×
296
                'The path to the file in the origin repository commitish'.
×
297
                
×
298
        (diff property: #new_file type: #Boolean defaultValue: false)
×
299
                comment: 'Is the file of the diff is a new file'.
×
300
                
×
301
        (diff property: #renamed_file type: #Boolean defaultValue: false)
×
302
                comment:
×
303
                'Is the file of the diff has been renamed (see old_path/new_path) file'.
×
304
                
×
305
        (diff property: #deleted_file type: #Boolean defaultValue: false)
×
306
                comment: 'Is the file of the diff has been removed'
×
307
]
×
308

309
{ #category : #definition }
310
GLHMetamodelGenerator >> diffRangeProperties [
×
311
"must parse the range. 
×
312
        originalLineRange = '-120,5' --> change starts at line #120
×
313
        5 is the number of lines in the original file affected by the change"
×
314
        diffRange property: #originalLineRange type: #String.
×
315
        diffRange property: #newLineRange type: #String.
×
316
        diffRange property: #lineOfCode type: #String
×
317
]
×
318

×
319
{ #category : #definition }
×
320
GLHMetamodelGenerator >> fileProperties [
×
321

×
322
        file property: #name type: #String
×
323
]
×
324

×
325
{ #category : #definition }
×
326
GLHMetamodelGenerator >> jobProperties [
×
327

×
328
        job property: #id type: #Number.
×
329
        job property: #allow_failure type: #Boolean.
×
330
        job property: #web_url type: #String.
×
331
        job property: #duration type: #Object.
×
332
        job property: #allow_failure type: #Boolean
×
333
]
×
334

×
335
{ #category : #definition }
×
336
GLHMetamodelGenerator >> mergeRequestProperties [
×
337

×
338
        mergeRequest property: #id type: #Number.
×
339
        mergeRequest property: #iid type: #Number.
×
340
        mergeRequest property: #project_id type: #Number.
×
341
        mergeRequest property: #title type: #String.
×
342
        mergeRequest property: #description type: #String.
×
343
        mergeRequest property: #state type: #String.
×
344
        mergeRequest property: #created_at type: #Object.
×
345
        mergeRequest property: #updated_at type: #Object.
×
346
        mergeRequest property: #merged_at type: #Object.
×
347
        mergeRequest property: #closed_at type: #Object.
×
348
        mergeRequest property: #target_branch type: #String.
×
349
        mergeRequest property: #source_branch type: #String.
×
350
        mergeRequest property: #user_notes_count type: #Number.
×
351
        mergeRequest property: #upvotes type: #Number.
×
352
        mergeRequest property: #downvotes type: #Number.
×
353
        mergeRequest property: #source_project_id type: #Number.
×
354
        mergeRequest property: #target_project_id type: #Number.
×
355
        mergeRequest property: #labels type: #Object.
×
356
        mergeRequest property: #draft type: #Boolean.
×
357
        mergeRequest property: #work_in_progress type: #Boolean.
×
358
        mergeRequest property: #milestone type: #String.
×
359
        mergeRequest property: #merge_when_pipeline_succeeds type: #Boolean.
×
360
        mergeRequest property: #merge_status type: #String.
×
361
        mergeRequest property: #detailed_merge_status type: #String.
×
362
        mergeRequest property: #sha type: #String.
×
363
        mergeRequest property: #merge_commit_sha type: #String.
×
364
        mergeRequest property: #squash_commit_sha type: #String.
×
365
        mergeRequest property: #discussion_locked type: #String.
×
366
        mergeRequest property: #should_remove_source_branch type: #Boolean.
×
367
        mergeRequest property: #force_remove_source_branch type: #Boolean.
×
368
        mergeRequest property: #reference type: #String.
×
369
        mergeRequest property: #references_short type: #String.
×
370
        mergeRequest property: #references_relative type: #String.
×
371
        mergeRequest property: #references_full type: #String.
×
372
        mergeRequest property: #web_url type: #String.
×
373
        mergeRequest property: #time_stats_time_estimate type: #Number.
×
374
        mergeRequest property: #time_stats_total_time_spent type: #Number.
×
375
        mergeRequest property: #time_stats_human_time_estimate type: #String.
×
376
        mergeRequest
×
377
                property: #time_stats_human_total_time_spent
×
378
                type: #String.
×
379
        mergeRequest property: #squash type: #Boolean.
×
380
        mergeRequest property: #squash_on_merge type: #Boolean.
×
381
        mergeRequest property: #task_completion_status_count type: #Number.
×
382
        mergeRequest
×
383
                property: #task_completion_status_completed_count
×
384
                type: #Number.
×
385
        mergeRequest property: #has_conflicts type: #Boolean.
×
386
        mergeRequest property: #blocking_discussions_resolved type: #Boolean.
×
387
        mergeRequest property: #subscribed type: #Boolean.
×
388
        mergeRequest property: #changes_count type: #String.
×
389
        mergeRequest property: #latest_build_started_at type: #String.
×
390
        mergeRequest property: #latest_build_finished_at type: #String.
×
391
        mergeRequest property: #first_deployed_to_production_at type: #String.
×
392
        mergeRequest property: #approved type: #Boolean.
×
393

×
394
        "see https://github.com/moosetechnology/GitProjectHealth/issues/88"
×
395
        mergeRequest property: #commits type: #Object
×
396
]
×
397

×
398
{ #category : #'as yet unclassified' }
×
399
GLHMetamodelGenerator >> noteProperties [ 
×
400
        note property: #id type: #Number.
×
401
        note property: #body type: #String. 
×
402
        note property: #attachment type: #Object.
×
403
        note property: #author type: #Object.
×
404
        note property: #created_at type: #Object.
×
405
        note property: #updated_at type: #Object.
×
406
        note property: #system type: #Boolean.
×
407
        note property: #noteable_id type: #Number.
×
408
        note property: #noteable_type type: #String.
×
409
        note property: #project_id type: #Number.
×
410
        note property: #noteable_iid type: #Number.
×
411
        note property: #resolvable type: #Boolean.
×
412
        note property: #confidential type: #Boolean.
×
413
        note property: #internal type: #Boolean.
×
414
        note property: #imported type: #Boolean.
×
415
        note property: #imported_from type: #String.
×
416
         
×
417
 
×
418
 
×
419
 
×
420
 
×
421
 
×
422
 
×
423
 
×
424
 
×
425

×
NEW
426
]
×
NEW
427

×
NEW
428
{ #category : #'as yet unclassified' }
×
NEW
429
GLHMetamodelGenerator >> pipelinesProperties [
×
NEW
430
        
×
NEW
431
        "Pipelines properties"
×
NEW
432
        
×
NEW
433
        (pipeline property: #id type: #String) comment:
×
NEW
434
                'The id of the pipeline'.
×
NEW
435
        (pipeline property: #name type: #String) comment:
×
NEW
436
                'name of the pipeline'.        
×
NEW
437
                        
×
NEW
438
        (pipeline property: #status type: #String) comment:
×
NEW
439
                '#success or #failure'.        
×
NEW
440
        (pipeline property: #ref type: #String) comment:
×
NEW
441
                'reference its emmited source (merge request or else)'.        
×
NEW
442
        (pipeline property: #sha type: #String) comment:
×
NEW
443
                'sha of its emmited source'.        
×
NEW
444
        
×
NEW
445
        (pipeline property: #sourceEvent type: #String) comment: 'triggering event from where the pipeline originate, such as #push #fork, etc.'.
×
NEW
446
        
×
NEW
447
        (pipeline property: #runDate type: #Object) comment:
×
NEW
448
                'Date this pipeline was run'.
×
NEW
449
        (pipeline property: #created_at type: #Object) comment: 'creation date of the pipeline'.
×
NEW
450
        (pipeline property: #updated_at type: #Object) comment: 'update date of the pipeline'.
×
NEW
451
        (pipeline property: #started_at type: #Object) comment: 'start date of the pipeline'.
×
NEW
452
        (pipeline property: #finished_at type: #Object) comment: 'finish date of the pipeline'.        
×
NEW
453
        (pipeline property: #duration type: #Object) comment: 'the running duration of a pipeline'.
×
NEW
454

×
455
]
×
456

×
457
{ #category : #definition }
×
458
GLHMetamodelGenerator >> userProperties [
×
459

×
460
        user property: #id type: #Number.
×
461
        user property: #username type: #String.
×
462
        user property: #name type: #String.
×
463
        user property: #state type: #String.
×
464
        user property: #avatar_url type: #String.
×
465
        user property: #web_url type: #String.
×
466
        user property: #created_at type: #String.
×
467
        user property: #bio type: #String.
×
468
        user property: #location type: #String.
×
469
        user property: #public_email type: #String.
×
470
        user property: #email type: #String.
×
471
        user property: #commit_email type: #String.
×
472
        user property: #skype type: #String.
×
473
        user property: #linkedin type: #String.
×
474
        user property: #twitter type: #String.
×
475
        user property: #website_url type: #String.
×
476
        user property: #organization type: #String.
×
477
        user property: #job_title type: #String.
×
478
        user property: #pronouns type: #String.
×
479
        user property: #bot type: #String.
×
480
        user property: #work_information type: #String.
×
481
        user property: #followers type: #String.
×
482
        user property: #following type: #String
×
483
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc