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

moosetechnology / GitProjectHealth / 16019990123

02 Jul 2025 08:24AM UTC coverage: 74.913% (-0.003%) from 74.916%
16019990123

Pull #216

github

web-flow
Merge c530b6a34 into dca6e7037
Pull Request #216: add issue class in model

0 of 20 new or added lines in 1 file covered. (0.0%)

1 existing line in 1 file now uncovered.

17567 of 23450 relevant lines covered (74.91%)

0.75 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
                'issue'
29
        ],
30
        #category : #'GitLabHealth-Model-Generator'
31
}
32

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

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

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

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

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

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

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

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

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

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

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

×
83

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

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

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

×
118
        job := builder newClassNamed: #Job comment: 'A CI Job'.
×
NEW
119

×
120
        mergeRequest := builder
×
121
                                newClassNamed: #MergeRequest
×
122
                                comment: 'a gitlab merge request'.
×
123

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

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

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

×
143
        diffRange := builder
×
144
                             newClassNamed: #DiffRange
×
145
                             comment:
×
146
                             'a indicate on which line of code are concerned by a diff (usually declared with @@ oldRange, newRange @@) '.
×
147

×
NEW
148
        note := builder
×
NEW
149
                        newClassNamed: #Note
×
NEW
150
                        comment:
×
NEW
151
                        'a note (a diff) proposed in a Merge Request; can be accepted, modified or deleted'.
×
152

×
153

×
NEW
154
        tag := builder
×
NEW
155
                       newClassNamed: #Tag
×
NEW
156
                       comment:
×
NEW
157
                       'a Tag is a reference to a specific point in the repository''s history'.
×
NEW
158
                
×
NEW
159
        issue := builder
×
NEW
160
                       newClassNamed: #Issue
×
NEW
161
                       comment:
×
NEW
162
                       'an Issues help collaboration within a team to plan, track, and deliver work'.
×
163

×
NEW
164
        release := builder
×
NEW
165
                           newClassNamed: #Release
×
NEW
166
                           comment:
×
NEW
167
                           'a Release is typically associated with a tag and provide additional metadata and assets that can be distributed to users'
×
UNCOV
168
]
×
169

170
{ #category : #definition }
171
GLHMetamodelGenerator >> defineHierarchy [
×
172

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

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

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

193
{ #category : #definition }
194
GLHMetamodelGenerator >> defineProperties [
×
195

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

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

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

230
{ #category : #definition }
231
GLHMetamodelGenerator >> defineRelations [
×
232

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

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

×
256
        (user property: #jobs) <>-* (job property: #user).
×
257

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

×
262
        (mergeRequest property: #approved_by)
×
263
        *-* (user property: #approcheMergeRequests).
×
264

×
265
        (mergeRequest property: #merge_user) *- (user property: #usedMerges).
×
266

×
267
        (mergeRequest property: #closed_by)
×
268
        *- (user property: #closedMergeRequests).
×
269

×
270
        (mergeRequest property: #merged_by)
×
271
        *- (user property: #mergerOfMergeRequests).
×
272

×
273
        (mergeRequest property: #assignees)
×
274
        *-* (user property: #assignedMergeRequests).
×
275

×
276
        (mergeRequest property: #assignee)
×
277
        *- (user property: #currentlyAssignedMergeRequest).
×
278

×
279
        (mergeRequest property: #reviewers)
×
280
        *-* (user property: #reviewedMergeResquest).
×
281

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

×
285
        (mergeRequest property: #mergedCommit)
×
286
        - (commit property: #commitedMergeRequest).
×
287

×
288
        (mergeRequest property: #mergeRequestCommit)
×
289
        - (commit property: #commitedMergeRequest).
×
290

×
291
        (mergeRequest property: #squashCommit)
×
292
        - (commit property: #squashedMergeRequest).
×
293

×
294
        (mergeRequest property: #diffs) -* (diff property: #mergeRequest).
×
295

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

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

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

×
315
]
×
316

317
{ #category : #definition }
318
GLHMetamodelGenerator >> diffProperties [
×
319

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

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

×
350
{ #category : #definition }
×
351
GLHMetamodelGenerator >> fileProperties [
×
352

×
353
        file property: #name type: #String
×
354
]
×
355

×
356
{ #category : #definition }
×
357
GLHMetamodelGenerator >> jobProperties [
×
358

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

×
367
{ #category : #definition }
×
368
GLHMetamodelGenerator >> mergeRequestProperties [
×
369

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

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

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

×
458
]
×
459

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

×
487
]
×
488

×
489
{ #category : #definition }
×
490
GLHMetamodelGenerator >> releaseProperties [
×
491

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

×
502
{ #category : #definition }
×
503
GLHMetamodelGenerator >> tagProperties [
×
504

×
505
        tag property: #name type: #String.
×
506
        tag property: #message type: #String.
×
507
        tag property: #target type: #String.
×
508
        tag property: #protected type: #Boolean.
×
509
        tag property: #created_at type: #Object.
×
510

×
511
]
×
512

×
513
{ #category : #definition }
×
514
GLHMetamodelGenerator >> userProperties [
×
515

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