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

moosetechnology / GitProjectHealth / 14190600424

01 Apr 2025 08:13AM UTC coverage: 72.386% (+1.0%) from 71.4%
14190600424

Pull #175

github

web-flow
Merge pull request #177 from moosetechnology/not-autoreneraku-for-now

remove autoreneraku for now
Pull Request #175: Develop

1556 of 2760 new or added lines in 40 files covered. (56.38%)

2 existing lines in 1 file now uncovered.

15272 of 21098 relevant lines covered (72.39%)

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.
×
NEW
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 @@) '.
×
NEW
144
                
×
NEW
145
        note := builder
×
NEW
146
                             newClassNamed: #Note
×
NEW
147
                             comment:
×
NEW
148
                             'a note (a diff) proposed in a Merge Request; can be accepted, modified or deleted'.
×
UNCOV
149
]
×
150

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

×
154
        super defineHierarchy.
×
NEW
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.
×
NEW
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

×
196
        "Pipelines properties"
×
197
        (pipeline property: #status type: #String) comment:
×
198
                '#success or #failure'.
×
199
        (pipeline property: #runDate type: #Object) comment:
×
200
                'Date this pipeline was run'.
×
201
        (pipeline property: #id type: #String) comment:
×
202
                'The id of the pipeline'.
×
203

×
204

×
205
        self userProperties.
×
206
        self branchProperties.
×
207
        self fileProperties.
×
208
        self commitProperties.
×
209
        self diffProperties.
×
210
        self jobProperties.
×
211
        self changeProperties.
×
212
        self mergeRequestProperties.
×
NEW
213
        self diffRangeProperties.
×
NEW
214
        self noteProperties.
×
UNCOV
215
]
×
216

217
{ #category : #definition }
218
GLHMetamodelGenerator >> defineRelations [
×
219

×
220
        super defineRelations.
×
221
        (group property: #projects) <>-* (project property: #group).
×
222
        (group property: #subGroups) <>-* (group property: #group).
×
223
        (project property: #pipelines) <>-* (pipeline property: #project).
×
224
        (project property: #creator) *- (user property: #createdProjects).
×
225
        (project property: #contributors)
×
226
        *-* (user property: #contributedProjects).
×
227
        (project property: #repository) <>- (repository property: #project).
×
228
        (repository property: #branches) <>-* (branch property: #repository).
×
229
        (branch property: #files) <>-* (file property: #branch).
×
230
        (fileDirectory property: #files)
×
231
        <>-* (file property: #directoryOwner).
×
232
        (repository property: #commits) <>-* (commit property: #repository).
×
233
        (branch property: #commits) <>-* (commit property: #branch).
×
234

×
235
        (commit property: #diffs) <>-* (diff property: #commit).
×
236
        (user property: #commits) <>-* (commit property: #commitCreator).
×
237
        (commit property: #parentCommits)
×
238
        *-* (commit property: #childCommits).
×
239
        (commit property: #jobs) <>-* (job property: #commit).
×
240
        (pipeline property: #jobs) <>-* (job property: #pipeline).
×
241
        (user property: #jobs) <>-* (job property: #user).
×
242

×
243
        "MERGE REQUEST RELATIONS"
×
244
        (mergeRequest property: #author)
×
245
        *- (user property: #createdMergeRequests).
×
246

×
247
        (mergeRequest property: #approved_by)
×
248
        *-* (user property: #approcheMergeRequests).
×
249

×
250
        (mergeRequest property: #merge_user) *- (user property: #usedMerges).
×
251

×
252
        (mergeRequest property: #closed_by)
×
253
        *- (user property: #closedMergeRequests).
×
254

×
255
        (mergeRequest property: #merged_by)
×
256
        *- (user property: #mergerOfMergeRequests).
×
257

×
258
        (mergeRequest property: #assignees)
×
259
        *-* (user property: #assignedMergeRequests).
×
260

×
261
        (mergeRequest property: #assignee)
×
262
        *- (user property: #currentlyAssignedMergeRequest).
×
263

×
264
        (mergeRequest property: #reviewers)
×
265
        *-* (user property: #reviewedMergeResquest).
×
266

×
267
        (mergeRequest property: #pipeline)
×
268
        - (pipeline property: #mergeResquest).
×
269

×
270
        (mergeRequest property: #mergedCommit)
×
271
        - (commit property: #commitedMergeRequest).
×
272

×
273
        (mergeRequest property: #mergeRequestCommit)
×
274
        - (commit property: #commitedMergeRequest).
×
275

×
276
        (mergeRequest property: #squashCommit)
×
277
        - (commit property: #squashedMergeRequest).
×
278

×
279
        (mergeRequest property: #diffs) -* (diff property: #mergeRequest).
×
280

×
281
        (project property: #mergeRequests)
×
282
        <>-* (mergeRequest property: #project).
×
NEW
283
        
×
NEW
284
        (note property: #mergeRequest) *- (mergeRequest property: #note).
×
285

×
286
        "DIFF"
×
287
        (diff property: #file) <>-* (file property: #diffs).
×
288
        (diff property: #diffRanges) <>-* (diffRange property: #diff).
×
289
        (diffRange property: #changes) -* (change property: #diffRange)
×
290
]
×
291

292
{ #category : #definition }
293
GLHMetamodelGenerator >> diffProperties [
×
294

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

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

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

×
328
        file property: #name type: #String
×
329
]
×
330

×
331
{ #category : #definition }
×
332
GLHMetamodelGenerator >> jobProperties [
×
333

×
334
        job property: #id type: #Number.
×
335
        job property: #allow_failure type: #Boolean.
×
336
        job property: #web_url type: #String.
×
337
        job property: #duration type: #Object.
×
338
        job property: #allow_failure type: #Boolean
×
339
]
×
340

×
341
{ #category : #definition }
×
342
GLHMetamodelGenerator >> mergeRequestProperties [
×
343

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

×
400
        "see https://github.com/moosetechnology/GitProjectHealth/issues/88"
×
401
        mergeRequest property: #commits type: #Object
×
NEW
402
]
×
NEW
403

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

×
432
]
×
433

×
434
{ #category : #definition }
×
435
GLHMetamodelGenerator >> userProperties [
×
436

×
437
        user property: #id type: #Number.
×
438
        user property: #username type: #String.
×
439
        user property: #name type: #String.
×
440
        user property: #state type: #String.
×
441
        user property: #avatar_url type: #String.
×
442
        user property: #web_url type: #String.
×
443
        user property: #created_at type: #String.
×
444
        user property: #bio type: #String.
×
445
        user property: #location type: #String.
×
446
        user property: #public_email type: #String.
×
447
        user property: #email type: #String.
×
448
        user property: #commit_email type: #String.
×
449
        user property: #skype type: #String.
×
450
        user property: #linkedin type: #String.
×
451
        user property: #twitter type: #String.
×
452
        user property: #website_url type: #String.
×
453
        user property: #organization type: #String.
×
454
        user property: #job_title type: #String.
×
455
        user property: #pronouns type: #String.
×
456
        user property: #bot type: #String.
×
457
        user property: #work_information type: #String.
×
458
        user property: #followers type: #String.
×
459
        user property: #following type: #String
×
460
]
×
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