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

moosetechnology / GitProjectHealth / 15488373517

06 Jun 2025 10:23AM UTC coverage: 74.275% (+1.8%) from 72.472%
15488373517

Pull #201

github

web-flow
Merge 4dc57a52f into b9fe8bddf
Pull Request #201: Metric custom dora

111 of 490 new or added lines in 9 files covered. (22.65%)

54 existing lines in 2 files now uncovered.

16983 of 22865 relevant lines covered (74.28%)

0.74 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
                'release',
27
                'tag'
28
        ],
29
        #category : #'GitLabHealth-Model-Generator'
30
}
31

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

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

42
{ #category : #accessing }
43
GLHMetamodelGenerator class >> submetamodels [
×
44

×
45
        ^ { FamixMooseQueryGenerator . FamixGenerator }
×
46
]
×
47

48
{ #category : #definition }
49
GLHMetamodelGenerator >> branchProperties [
×
50

×
51
        branch property: #name type: #String
×
52
]
×
53

54
{ #category : #definition }
55
GLHMetamodelGenerator >> changeProperties [
×
56

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

64
{ #category : #definition }
65
GLHMetamodelGenerator >> commitProperties [
×
66

×
67
        commit property: #parent_ids type: #Object defaultValue: 'OrderedCollection new'.
×
68

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

×
82

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

89
{ #category : #definition }
90
GLHMetamodelGenerator >> defineClasses [
×
91

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

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

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

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

×
142
        diffRange := builder
×
143
                             newClassNamed: #DiffRange
×
144
                             comment:
×
145
                             'a indicate on which line of code are concerned by a diff (usually declared with @@ oldRange, newRange @@) '.
×
146
                
×
147
        note := builder
×
148
                             newClassNamed: #Note
×
149
                             comment:
×
150
                             'a note (a diff) proposed in a Merge Request; can be accepted, modified or deleted'.
×
NEW
151
                
×
NEW
152
        
×
NEW
153
        tag := builder
×
NEW
154
                             newClassNamed: #Tag
×
NEW
155
                             comment:
×
NEW
156
                             'a Tag is a reference to a specific point in the repository''s history'.
×
NEW
157
        
×
NEW
158
        release := builder
×
NEW
159
                             newClassNamed: #Release
×
NEW
160
                             comment:
×
NEW
161
                             'a Release is typically associated with a tag and provide additional metadata and assets that can be distributed to users'.
×
NEW
162

×
NEW
163

×
NEW
164

×
NEW
165

×
UNCOV
166
]
×
167

168
{ #category : #definition }
169
GLHMetamodelGenerator >> defineHierarchy [
×
170

×
171
        super defineHierarchy.
×
172
        entity --|> #TEntityMetaLevelDependency.
×
173
        fileDirectory --|> file.
×
174
        fileBlob --|> file.
×
175

×
176
        group --|> #TNamedEntity.
×
177
        project --|> #TNamedEntity.
×
178
        user --|> #TNamedEntity.
×
179
        commit --|> #TNamedEntity.
×
180
        diff --|> #TNamedEntity.
×
181
        job --|> #TNamedEntity.
×
182
        note --|> #TNamedEntity.
×
183

×
184
        change --|> #TNamedEntity.
×
185
        change <|-- addition.
×
186
        change <|-- deletion.
×
187
        change <|-- lineOfCode.
×
188
        mergeRequest --|> #TNamedEntity
×
189
]
×
190

191
{ #category : #definition }
192
GLHMetamodelGenerator >> defineProperties [
×
193

×
194
        super defineProperties.
×
195
        "Group properties"
×
196
        group property: #id type: #Number.
×
197
        group property: #web_url type: #String.
×
198
        group property: #description type: #String.
×
199
        group property: #visibility type: #String.
×
200
        group property: #avatar_url type: #String.
×
201

×
202
        "Project properties"
×
203
        project property: #id type: #Number.
×
204
        project property: #topics type: #Object.
×
205
        project property: #archived type: #Boolean.
×
206
        project property: #archived type: #Boolean.
×
207
        project property: #description type: #String.
×
208
        project property: #readme_url type: #String.
×
209
        project property: #avatar_url type: #String.
×
210
        project property: #web_url type: #String.
×
211
        project property: #creator_id type: #Number.
×
212

×
213
        self pipelinesProperties.
×
214
        self userProperties.
×
215
        self branchProperties.
×
216
        self fileProperties.
×
217
        self commitProperties.
×
218
        self diffProperties.
×
219
        self jobProperties.
×
220
        self changeProperties.
×
221
        self mergeRequestProperties.
×
222
        self diffRangeProperties.
×
223
        self noteProperties.
×
NEW
224
        self tagProperties.
×
NEW
225
        self releaseProperties.
×
UNCOV
226
]
×
227

228
{ #category : #definition }
229
GLHMetamodelGenerator >> defineRelations [
×
230

×
231
        super defineRelations.
×
232
        (group property: #projects) <>-* (project property: #group).
×
233
        (group property: #subGroups) <>-* (group property: #group).
×
234
        (project property: #pipelines) <>-* (pipeline property: #project).
×
235
        (project property: #creator) *- (user property: #createdProjects).
×
236
        (project property: #contributors)
×
237
        *-* (user property: #contributedProjects).
×
238
        (project property: #repository) <>- (repository property: #project).
×
239
        (repository property: #branches) <>-* (branch property: #repository).
×
240
        (branch property: #files) <>-* (file property: #branch).
×
241
        (fileDirectory property: #files)
×
242
        <>-* (file property: #directoryOwner).
×
243
        (repository property: #commits) <>-* (commit property: #repository).
×
244
        (branch property: #commits) <>-* (commit property: #branch).
×
245

×
246
        (commit property: #diffs) <>-* (diff property: #commit).
×
247
        (user property: #commits) <>-* (commit property: #commitCreator).
×
248
        (commit property: #parentCommits)
×
249
        *-* (commit property: #childCommits).
×
250
        (commit property: #jobs) <>-* (job property: #commit).
×
251
        (pipeline property: #jobs) <>-* (job property: #pipeline).
×
252
        (pipeline property: #user) *- (user property: #launchedPipelines).
×
253

×
254
        (user property: #jobs) <>-* (job property: #user).
×
255

×
256
        "MERGE REQUEST RELATIONS"
×
257
        (mergeRequest property: #author)
×
258
        *- (user property: #createdMergeRequests).
×
259

×
260
        (mergeRequest property: #approved_by)
×
261
        *-* (user property: #approcheMergeRequests).
×
262

×
263
        (mergeRequest property: #merge_user) *- (user property: #usedMerges).
×
264

×
265
        (mergeRequest property: #closed_by)
×
266
        *- (user property: #closedMergeRequests).
×
267

×
268
        (mergeRequest property: #merged_by)
×
269
        *- (user property: #mergerOfMergeRequests).
×
270

×
271
        (mergeRequest property: #assignees)
×
272
        *-* (user property: #assignedMergeRequests).
×
273

×
274
        (mergeRequest property: #assignee)
×
275
        *- (user property: #currentlyAssignedMergeRequest).
×
276

×
277
        (mergeRequest property: #reviewers)
×
278
        *-* (user property: #reviewedMergeResquest).
×
279

×
280
        (mergeRequest property: #pipelines)
×
281
        <>-* (pipeline property: #mergeResquest).
×
282

×
283
        (mergeRequest property: #mergedCommit)
×
284
        - (commit property: #commitedMergeRequest).
×
285

×
286
        (mergeRequest property: #mergeRequestCommit)
×
287
        - (commit property: #commitedMergeRequest).
×
288

×
289
        (mergeRequest property: #squashCommit)
×
290
        - (commit property: #squashedMergeRequest).
×
291

×
292
        (mergeRequest property: #diffs) -* (diff property: #mergeRequest).
×
293

×
294
        (project property: #mergeRequests)
×
295
        <>-* (mergeRequest property: #project).
×
296
        
×
297
        (note property: #mergeRequest) *- (mergeRequest property: #note).
×
298

×
299
        "DIFF"
×
300
        (diff property: #file) <>-* (file property: #diffs).
×
301
        (diff property: #diffRanges) <>-* (diffRange property: #diff).
×
NEW
302
        (diffRange property: #changes) -* (change property: #diffRange).
×
NEW
303
        
×
NEW
304

×
NEW
305
        "TAG AND RELEASE"
×
NEW
306
        (tag property: #commit ) - (commit property: #tag). 
×
NEW
307
        (tag property: #release ) - (release property: #tag). 
×
NEW
308
        (tag property: #repository ) *-<> (repository property: #tags).
×
NEW
309
        (release property: #author ) *-<> (user property: #releases). 
×
NEW
310
        (release property: #project ) *-<> (project property: #releases). 
×
NEW
311
         
×
NEW
312

×
UNCOV
313
]
×
314

315
{ #category : #definition }
316
GLHMetamodelGenerator >> diffProperties [
×
317

×
318
        (diff property: #diffString type: #String) comment:
×
319
                'The string presenting the diff. It should follow the [Detailed-Unified](https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html) format'.
×
320
                
×
321
        (diff property: #new_path type: #String) comment:
×
322
                'The path to the file in the resulted repository commitish'.
×
323
                
×
324
        (diff property: #old_path type: #String) comment:
×
325
                'The path to the file in the origin repository commitish'.
×
326
                
×
327
        (diff property: #new_file type: #Boolean defaultValue: false)
×
328
                comment: 'Is the file of the diff is a new file'.
×
329
                
×
330
        (diff property: #renamed_file type: #Boolean defaultValue: false)
×
331
                comment:
×
332
                'Is the file of the diff has been renamed (see old_path/new_path) file'.
×
333
                
×
334
        (diff property: #deleted_file type: #Boolean defaultValue: false)
×
335
                comment: 'Is the file of the diff has been removed'
×
336
]
×
337

338
{ #category : #definition }
339
GLHMetamodelGenerator >> diffRangeProperties [
×
340
"must parse the range. 
×
341
        originalLineRange = '-120,5' --> change starts at line #120
×
342
        5 is the number of lines in the original file affected by the change"
×
343
        diffRange property: #originalLineRange type: #String.
×
344
        diffRange property: #newLineRange type: #String.
×
345
        diffRange property: #lineOfCode type: #String
×
346
]
×
347

×
348
{ #category : #definition }
×
349
GLHMetamodelGenerator >> fileProperties [
×
350

×
351
        file property: #name type: #String
×
352
]
×
353

×
354
{ #category : #definition }
×
355
GLHMetamodelGenerator >> jobProperties [
×
356

×
357
        job property: #id type: #Number.
×
358
        job property: #allow_failure type: #Boolean.
×
359
        job property: #web_url type: #String.
×
360
        job property: #duration type: #Object.
×
361
        job property: #name type: #String. 
×
362
        job property: #ref type: #String.
×
363
]
×
364

×
365
{ #category : #definition }
×
366
GLHMetamodelGenerator >> mergeRequestProperties [
×
367

×
368
        mergeRequest property: #id type: #Number.
×
369
        mergeRequest property: #iid type: #Number.
×
370
        mergeRequest property: #project_id type: #Number.
×
371
        mergeRequest property: #title type: #String.
×
372
        mergeRequest property: #description type: #String.
×
373
        mergeRequest property: #state type: #String.
×
374
        mergeRequest property: #created_at type: #Object.
×
375
        mergeRequest property: #updated_at type: #Object.
×
376
        mergeRequest property: #merged_at type: #Object.
×
377
        mergeRequest property: #closed_at type: #Object.
×
378
        mergeRequest property: #target_branch type: #String.
×
379
        mergeRequest property: #source_branch type: #String.
×
380
        mergeRequest property: #user_notes_count type: #Number.
×
381
        mergeRequest property: #upvotes type: #Number.
×
382
        mergeRequest property: #downvotes type: #Number.
×
383
        mergeRequest property: #source_project_id type: #Number.
×
384
        mergeRequest property: #target_project_id type: #Number.
×
385
        mergeRequest property: #labels type: #Object.
×
386
        mergeRequest property: #draft type: #Boolean.
×
387
        mergeRequest property: #work_in_progress type: #Boolean.
×
388
        mergeRequest property: #milestone type: #String.
×
389
        mergeRequest property: #merge_when_pipeline_succeeds type: #Boolean.
×
390
        mergeRequest property: #merge_status type: #String.
×
391
        mergeRequest property: #detailed_merge_status type: #String.
×
392
        mergeRequest property: #sha type: #String.
×
393
        mergeRequest property: #merge_commit_sha type: #String.
×
394
        mergeRequest property: #squash_commit_sha type: #String.
×
395
        mergeRequest property: #discussion_locked type: #String.
×
396
        mergeRequest property: #should_remove_source_branch type: #Boolean.
×
397
        mergeRequest property: #force_remove_source_branch type: #Boolean.
×
398
        mergeRequest property: #reference type: #String.
×
399
        mergeRequest property: #references_short type: #String.
×
400
        mergeRequest property: #references_relative type: #String.
×
401
        mergeRequest property: #references_full type: #String.
×
402
        mergeRequest property: #web_url type: #String.
×
403
        mergeRequest property: #time_stats_time_estimate type: #Number.
×
404
        mergeRequest property: #time_stats_total_time_spent type: #Number.
×
405
        mergeRequest property: #time_stats_human_time_estimate type: #String.
×
406
        mergeRequest
×
407
                property: #time_stats_human_total_time_spent
×
408
                type: #String.
×
409
        mergeRequest property: #squash type: #Boolean.
×
410
        mergeRequest property: #squash_on_merge type: #Boolean.
×
411
        mergeRequest property: #task_completion_status_count type: #Number.
×
412
        mergeRequest
×
413
                property: #task_completion_status_completed_count
×
414
                type: #Number.
×
415
        mergeRequest property: #has_conflicts type: #Boolean.
×
416
        mergeRequest property: #blocking_discussions_resolved type: #Boolean.
×
417
        mergeRequest property: #subscribed type: #Boolean.
×
418
        mergeRequest property: #changes_count type: #String.
×
419
        mergeRequest property: #latest_build_started_at type: #String.
×
420
        mergeRequest property: #latest_build_finished_at type: #String.
×
421
        mergeRequest property: #first_deployed_to_production_at type: #String.
×
422
        mergeRequest property: #approved type: #Boolean.
×
423

×
424
        "see https://github.com/moosetechnology/GitProjectHealth/issues/88"
×
425
        mergeRequest property: #commits type: #Object
×
426
]
×
427

×
428
{ #category : #'as yet unclassified' }
×
429
GLHMetamodelGenerator >> noteProperties [ 
×
430
        note property: #id type: #Number.
×
431
        note property: #body type: #String. 
×
432
        note property: #attachment type: #Object.
×
433
        note property: #author type: #Object.
×
434
        note property: #created_at type: #Object.
×
435
        note property: #updated_at type: #Object.
×
436
        note property: #system type: #Boolean.
×
437
        note property: #noteable_id type: #Number.
×
438
        note property: #noteable_type type: #String.
×
439
        note property: #project_id type: #Number.
×
440
        note property: #noteable_iid type: #Number.
×
441
        note property: #resolvable type: #Boolean.
×
442
        note property: #confidential type: #Boolean.
×
443
        note property: #internal type: #Boolean.
×
444
        note property: #imported type: #Boolean.
×
445
        note property: #imported_from type: #String.
×
446
         
×
447
 
×
448
 
×
449
 
×
450
 
×
451
 
×
452
 
×
453
 
×
454
 
×
455

×
456
]
×
457

×
458
{ #category : #'as yet unclassified' }
×
459
GLHMetamodelGenerator >> pipelinesProperties [
×
460
        
×
461
        "Pipelines properties"
×
462
        
×
463
        (pipeline property: #id type: #String) comment:
×
464
                'The id of the pipeline'.
×
465
        (pipeline property: #name type: #String) comment:
×
466
                'name of the pipeline'.        
×
467
                        
×
468
        (pipeline property: #status type: #String) comment:
×
469
                '#success or #failure'.        
×
470
        (pipeline property: #ref type: #String) comment:
×
471
                'reference its emmited source (merge request or else)'.        
×
472
        (pipeline property: #sha type: #String) comment:
×
473
                'sha of its emmited source'.        
×
474
        
×
475
        (pipeline property: #sourceEvent type: #String) comment: 'triggering event from where the pipeline originate, such as #push #fork, etc.'.
×
476
        
×
477
        (pipeline property: #runDate type: #Object) comment:
×
478
                'Date this pipeline was run'.
×
479
        (pipeline property: #created_at type: #Object) comment: 'creation date of the pipeline'.
×
480
        (pipeline property: #updated_at type: #Object) comment: 'update date of the pipeline'.
×
481
        (pipeline property: #started_at type: #Object) comment: 'start date of the pipeline'.
×
482
        (pipeline property: #finished_at type: #Object) comment: 'finish date of the pipeline'.        
×
483
        (pipeline property: #duration type: #Object) comment: 'the running duration of a pipeline'.
×
484

×
485
]
×
486

×
NEW
487
{ #category : #definition }
×
NEW
488
GLHMetamodelGenerator >> releaseProperties [
×
NEW
489

×
NEW
490
        release property: #description type: #String.
×
NEW
491
        release property: #tag_name type: #String.
×
NEW
492
        release property: #name type: #String.
×
NEW
493
        
×
NEW
494
        release property: #created_at type: #Object.
×
NEW
495
        release property: #released_at type: #Object.
×
NEW
496
        release property: #commit_path type: #String.
×
NEW
497
        release property: #tag_path type: #String.
×
NEW
498
]
×
NEW
499

×
NEW
500
{ #category : #definition }
×
NEW
501
GLHMetamodelGenerator >> tagProperties [
×
NEW
502

×
NEW
503
        tag property: #name type: #String.
×
NEW
504
        tag property: #message type: #String.
×
NEW
505
        tag property: #target type: #String.
×
NEW
506
        tag property: #protected type: #Boolean.
×
NEW
507
        tag property: #created_at type: #Object.
×
NEW
508

×
NEW
509
]
×
NEW
510

×
511
{ #category : #definition }
×
512
GLHMetamodelGenerator >> userProperties [
×
513

×
514
        user property: #id type: #Number.
×
515
        user property: #username type: #String.
×
516
        user property: #name type: #String.
×
517
        user property: #state type: #String.
×
518
        user property: #avatar_url type: #String.
×
519
        user property: #web_url type: #String.
×
520
        user property: #created_at type: #String.
×
521
        user property: #bio type: #String.
×
522
        user property: #location type: #String.
×
523
        user property: #public_email type: #String.
×
524
        user property: #email type: #String.
×
525
        user property: #commit_email type: #String.
×
526
        user property: #skype type: #String.
×
527
        user property: #linkedin type: #String.
×
528
        user property: #twitter type: #String.
×
529
        user property: #website_url type: #String.
×
530
        user property: #organization type: #String.
×
531
        user property: #job_title type: #String.
×
532
        user property: #pronouns type: #String.
×
533
        user property: #bot type: #String.
×
534
        user property: #work_information type: #String.
×
535
        user property: #followers type: #String.
×
536
        user property: #following type: #String
×
537
]
×
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