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

moosetechnology / GitProjectHealth / 11294373435

11 Oct 2024 02:41PM UTC coverage: 58.623% (+2.4%) from 56.272%
11294373435

push

github

web-flow
Merge pull request #81 from moosetechnology/refactoring/rename

Refactoring/rename

34 of 105 new or added lines in 7 files covered. (32.38%)

5 existing lines in 1 file now uncovered.

8957 of 15279 relevant lines covered (58.62%)

0.59 hits per line

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

73.94
/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st
1
Class {
2
        #name : #BitBucketModelImporter,
3
        #superclass : #GPModelImporter,
4
        #instVars : [
5
                'withCommitDiffs',
6
                'withInitialCommits'
7
        ],
8
        #category : #'BitBucketHealth-Model-Importer'
9
}
10

11
{ #category : #accessing }
12
BitBucketModelImporter >> bitBucketApi [
×
13

×
14
        self
×
15
                deprecated: 'Use #repoApi instead'
×
16
                on: '7 October 2024'
×
17
                in:
×
18
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
×
19

×
20
        ^ repoApi
×
21
]
×
22

23
{ #category : #accessing }
24
BitBucketModelImporter >> bitBucketApi: anObject [
1✔
25

1✔
26
        self
1✔
27
                deprecated: 'Use #repoApi: instead'
1✔
28
                on: '7 October 2024'
1✔
29
                in:
1✔
30
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
1✔
31

1✔
32
        repoApi := anObject
1✔
33
]
1✔
34

35
{ #category : #'private - api' }
36
BitBucketModelImporter >> completeImportProject: aGLHProject [
1✔
37

1✔
38
        aGLHProject repository: GLHRepository new.
1✔
39
        self glhModel add: aGLHProject repository.
1✔
40
        "TODO: import repository"
1✔
41
        ^ aGLHProject
1✔
42
]
1✔
43

44
{ #category : #commit }
45
BitBucketModelImporter >> completeImportedCommit: aCommit [ 
×
46
        
×
47
        ('completing commit: ' , aCommit short_id printString) recordInfo.
×
48
        self importCreatorOfCommit: aCommit.
×
49

×
50
        self withCommitDiffs ifTrue: [
×
51
                | diffs |
×
52
                aCommit diffs ifEmpty: [
×
53
                        diffs := self importDiffOfCommit: aCommit.
×
54
                        self glhModel addAll: diffs unless: self blockForDiffEquality ] ].
×
55

×
56
        ^ aCommit
×
57
]
×
58

59
{ #category : #convert }
NEW
60
BitBucketModelImporter >> convertBitBucketDiffToGitDiff: response [
×
61

×
NEW
62
        | bitbucketDiff filePath fromHash toHash sourceLine sourceSpan destinationLine destinationSpan result filePathSource filePathDestination |
×
NEW
63
        fromHash := (response at: 'fromHash') ifNil: ''.
×
NEW
64
        toHash := (response at: 'toHash') ifNil: ''.
×
NEW
65

×
NEW
66
        
×
NEW
67
        "Iterate over each diff in 'diffs'"
×
NEW
68
        result := (response at: #diffs) collect: [ :diff | "Extract file path, hashes"
×
NEW
69
                |gitDiff|
×
NEW
70
                gitDiff := ''.
×
NEW
71
                          filePathSource := (diff at: 'source')
×
NEW
72
                                                    ifNil: ''
×
NEW
73
                                                    ifNotNil: [ :source |
×
NEW
74
                                                    source at: 'toString' ].
×
NEW
75
                          filePathDestination := (diff at: 'destination')
×
NEW
76
                                                         ifNil: ''
×
NEW
77
                                                         ifNotNil: [ :destination |
×
NEW
78
                                                         destination at: 'toString' ].
×
NEW
79

×
NEW
80
                          "Build the diff header"
×
NEW
81
                          " gitDiff := gitDiff , 'diff --git a/', filePath, ' b/', filePath, String cr."
×
NEW
82
                          " gitDiff := gitDiff , 'index ', fromHash, '..', toHash, ' 100644', String cr."
×
NEW
83
                          gitDiff := gitDiff , '--- a/' , filePathSource , String cr.
×
NEW
84
                          gitDiff := gitDiff , '+++ b/' , filePathDestination
×
NEW
85
                                     , String cr.
×
NEW
86

×
NEW
87
                          "Iterate over hunks"
×
NEW
88
                          (diff at: 'hunks') do: [ :hunk |
×
NEW
89
                                  sourceLine := hunk at: 'sourceLine'.
×
NEW
90
                                  sourceSpan := hunk at: 'sourceSpan'.
×
NEW
91
                                  destinationLine := hunk at: 'destinationLine'.
×
NEW
92
                                  destinationSpan := hunk at: 'destinationSpan'.
×
NEW
93

×
NEW
94
                                  "Hunk header"
×
NEW
95
                                  gitDiff := gitDiff
×
NEW
96
                                             , ('@@ -{1},{2} +{3},{4} @@' format: {
×
NEW
97
                                                                      sourceLine.
×
NEW
98
                                                                      sourceSpan.
×
NEW
99
                                                                      destinationLine.
×
NEW
100
                                                                      destinationSpan }) , String cr.
×
NEW
101

×
NEW
102
                                  "Iterate over segments"
×
NEW
103
                                  (hunk at: 'segments') do: [ :segment |
×
NEW
104
                                          (segment at: 'lines') do: [ :line |
×
NEW
105
                                                                (segment at: 'type') = 'CONTEXT' ifTrue: [
×
NEW
106
                                                          gitDiff := gitDiff , (line at: 'line')
×
NEW
107
                                                                     , String cr ].
×
NEW
108
                                                                (segment at: 'type') = 'REMOVED' ifTrue: [
×
NEW
109
                                                          gitDiff := gitDiff , '-' , (line at: 'line')
×
NEW
110
                                                                     , String cr ].
×
NEW
111
                                                  (segment at: 'type') = 'ADDED' ifTrue: [
×
NEW
112
                                                          gitDiff := gitDiff , '+' , (line at: 'line')
×
NEW
113
                                                                     , String cr ] ] ] ].
×
NEW
114
                          GLHDiff new
×
NEW
115
                                  diffString: gitDiff;
×
NEW
116
                                  old_path: filePathSource;
×
NEW
117
                                  new_path: filePathDestination ].
×
NEW
118

×
NEW
119
        ^ result
×
120
]
×
121

122
{ #category : #'private - api' }
123
BitBucketModelImporter >> getContributionFromDiffs: diffs [
1✔
124

1✔
125
        | contribution |
1✔
126
        contribution := {
1✔
127
                                ('additions' -> 0).
1✔
128
                                ('deletions' -> 0) } asDictionary.
1✔
129

1✔
130
        diffs do: [ :diff |
1✔
131
                | hunks segments |
1✔
132
                hunks := diff at: #hunks ifAbsent: Array new.
1✔
133

1✔
134
                hunks do: [ :hunk |
1✔
135
                        | addedSegment removedSegment |
1✔
136
                        segments := hunk at: #segments.
1✔
137

1✔
138
                        addedSegment := segments
1✔
139
                                                detect: [ :segment |
1✔
140
                                                (segment at: #type) = 'ADDED' ]
1✔
141
                                                ifNone: [ nil ].
1✔
142
                        removedSegment := segments
1✔
143
                                                  detect: [ :segment |
1✔
144
                                                  (segment at: #type) = 'REMOVED' ]
1✔
145
                                                  ifNone: [ nil ].
1✔
146

1✔
147
                        addedSegment ifNotNil: [
1✔
148
                                contribution
1✔
149
                                        at: #additions
1✔
150
                                        put:
1✔
151
                                        (contribution at: #additions) + (addedSegment at: #lines) size ].
1✔
152
                        removedSegment ifNotNil: [
1✔
153
                                contribution
1✔
154
                                        at: #deletions
1✔
155
                                        put:
1✔
156
                                        (contribution at: #deletions) + (removedSegment at: #lines) size ] ] ].
1✔
157

1✔
158
        ^ contribution
1✔
159
]
1✔
160

161
{ #category : #'comment import' }
162
BitBucketModelImporter >> importAndLoadLatestsCommitsOfProject: aGLHProject [ 
×
163
        
×
164
        ^ self importCommitsOfProject: aGLHProject since: (Date today - 3 week) asDateAndTime  until: Date today asDateAndTime 
×
165
]
×
166

167
{ #category : #'import - commits' }
168
BitBucketModelImporter >> importCommitsOfProject: aGLHProject since: since until: until [
1✔
169

1✔
170
        | commits |
1✔
171
        commits := self repoApi
1✔
172
                           commitsOfRepoProjectId: aGLHProject id
1✔
173
                           inProjectGroupId: aGLHProject group id
1✔
174
                           since: since
1✔
175
                           until: until.
1✔
176

1✔
177
        commits := commits collect: [ :commit |
1✔
178
                           | glhCommit commitDiffs contribution |
1✔
179
                           glhCommit := self parseCommitIntoGLHCommit: commit.
1✔
180
                           commitDiffs := self repoApi
1✔
181
                                                  diffsOfCommit: glhCommit id
1✔
182
                                                  inRepoProjectId: aGLHProject id
1✔
183
                                                  inProjectGroupId: aGLHProject group id.
1✔
184

1✔
185
                           contribution := self getContributionFromDiffs:
1✔
186
                                                   (commitDiffs at: #diffs).
1✔
187
                           glhCommit additions: (contribution at: #additions).
1✔
188
                           glhCommit deletions: (contribution at: #deletions).
1✔
189
                           glhCommit ].
1✔
190

1✔
191
        
1✔
192
        commits := self glhModel addAll: commits unless: self blockOnIdEquality.
1✔
193
        ^ aGLHProject repository commits addAll: commits unless: self blockOnIdEquality.
1✔
194
]
1✔
195

196
{ #category : #'import - projects' }
197
BitBucketModelImporter >> importContributedProjectsOfUser: aGLHUser [
1✔
198

1✔
199
        | projects repositories repositoriesCommits userRepositories userProjects |
1✔
200
        "get all projects"
1✔
201
        projects := self repoApi projects.
1✔
202

1✔
203
        "get all repos of projects"
1✔
204
        repositories := projects flatCollect: [ :project |
1✔
205
                                self repoApi repositoryProjectsOfProjectGroupId:
1✔
206
                                        (project at: #key) ].
1✔
207

1✔
208

1✔
209
        "get all commits of repo"
1✔
210
        repositoriesCommits := repositories collect: [ :repository |
1✔
211
                                       repository -> (self repoApi
1✔
212
                                                commitsOfRepoProjectId: (repository at: #slug)
1✔
213
                                                inProjectGroupId:
1✔
214
                                                ((repository at: #project) at: #key)
1✔
215
                                                since: DateAndTime now - 10 days
1✔
216
                                                until: DateAndTime now) ].
1✔
217

1✔
218

1✔
219
        "look if user is author of min one commit"
1✔
220
        userRepositories := repositoriesCommits select: [ :repository |
1✔
221
                                    | repos |
1✔
222
                                    repos := repository value
1✔
223
                                                     ifEmpty: [ false ]
1✔
224
                                                     ifNotEmpty: [
1✔
225
                                                             repository value
1✔
226
                                                                     detect: [ :commit |
1✔
227
                                                                     ((commit at: #author) at: #name)
1✔
228
                                                                     = aGLHUser username ]
1✔
229
                                                                     ifFound: [ true ]
1✔
230
                                                                     ifNone: [ false ] ] ].
1✔
231

1✔
232

1✔
233
        "Transform user repositories in GLHProject"
1✔
234
        userProjects := userRepositories collect: [ :repoCommits |
1✔
235
                                | repo project |
1✔
236
                                repo := repoCommits key.
1✔
237
                                project := repo at: #project.
1✔
238

1✔
239
                                (self glhModel allWithType: GLHProject)
1✔
240
                                        detect: [ :glhProject |
1✔
241
                                        glhProject id = (project at: #key) ]
1✔
242
                                        ifFound: [ :glhProject | glhProject ]
1✔
243
                                        ifNone: [
1✔
244
                                                | glhProject |
1✔
245
                                                glhProject := self parseRepoIntoGLHProject: repo.
1✔
246
                                                glhModel add: glhProject.
1✔
247
                                                glhProject ] ].
1✔
248

1✔
249
        aGLHUser contributedProjects: userProjects.
1✔
250

1✔
251
        ^ userProjects
1✔
252
]
1✔
253

254
{ #category : #'import - commits' }
255
BitBucketModelImporter >> importCreatorOfCommit: aGLHCommit [
1✔
256

1✔
257
        | creator |
1✔
258
        (self glhModel allWithType: GLHUser)
1✔
259
                detect: [ :user | user username = aGLHCommit author_name ]
1✔
260
                ifFound: [ :user |
1✔
261
                        aGLHCommit commitCreator: user.
1✔
262
                        ^ user ].
1✔
263

1✔
264
        creator := self importUserByUsername: aGLHCommit author_name.
1✔
265
        aGLHCommit commitCreator: creator.
1✔
266
        ^ creator
1✔
267
]
1✔
268

269
{ #category : #api }
270
BitBucketModelImporter >> importDiffOfCommit: aCommit [
×
271

×
272
        | result diffsResult |
×
273
        aCommit diffs ifNotEmpty: [
×
274
                'Diff already importer: ' , aCommit short_id printString recordInfo.
×
275
                ^ aCommit diffs ].
×
276
        ('Import diff of commit: ' , aCommit short_id printString) recordInfo.
×
277
        result := self repoApi
×
278
                          diffsOfCommit: aCommit id
×
NEW
279
                          inRepoProjectId: aCommit repository project id
×
NEW
280
                          inProjectGroupId: aCommit repository project group id.
×
281

×
282
        diffsResult := self convertBitBucketDiffToGitDiff: result.
×
283

×
284

×
285
        aCommit diffs addAll: diffsResult unless: self blockForDiffEquality.
×
286

×
287
        "changes are added into the model during the import"
×
288
        aCommit diffs do: [ :diff | self importDiffRangesForDiff: diff ].
×
289

×
290
        ^ aCommit diffs
×
291
]
×
292

293
{ #category : #'import - merge-requests' }
294
BitBucketModelImporter >> importMergeRequestCommits: mergeRequest [
1✔
295

1✔
296
        | commits |
1✔
297
        commits := self repoApi
1✔
298
                           commitsOfPullRequest: mergeRequest id
1✔
299
                           ofRepoProjectId: mergeRequest project id
1✔
300
                           inProjectGroupId: mergeRequest project group id.
1✔
301

1✔
302
        commits := commits collect: [ :commit |
1✔
303
                           self parseCommitIntoGLHCommit: commit ].
1✔
304

1✔
305
        mergeRequest commits: commits.
1✔
306

1✔
307
        ^ commits
1✔
308
]
1✔
309

310
{ #category : #'import - merge-requests' }
311
BitBucketModelImporter >> importMergeRequests: aGLHProject since: fromDate until: toDate [
1✔
312

1✔
313
        | pullRequests |
1✔
314
        pullRequests := self repoApi
1✔
315
                                pullRequestsOfRepoProjectId: aGLHProject id
1✔
316
                                inProjectGroupId: aGLHProject group id
1✔
317
                                since: fromDate
1✔
318
                                until: toDate.
1✔
319

1✔
320
        pullRequests := pullRequests collect: [ :pullRequest |
1✔
321
                                self parsePullRequestIntoGLPHEMergeRequest:
1✔
322
                                        pullRequest ].
1✔
323

1✔
324
        pullRequests := self glhModel addAll: pullRequests unless: self blockOnIdEquality.
1✔
325

1✔
326
        ^ pullRequests
1✔
327
]
1✔
328

329
{ #category : #'import - merge-requests' }
330
BitBucketModelImporter >> importMergeResquestAuthor: mergeRequest [
×
331
        mergeRequest author ifNotNil: [ ^mergeRequest ]
×
332
]
×
333

334
{ #category : #'import - merge-requests' }
335
BitBucketModelImporter >> importMergeResquestMerger: mergeRequest [
1✔
336

1✔
337
        | activities mergeActivity mergeUser |
1✔
338
        mergeRequest merge_user ifNotNil: [ ^ mergeRequest merge_user ].
1✔
339
        mergeRequest state = 'merged' ifFalse: [ ^ nil ].
1✔
340

1✔
341
        activities := self repoApi
1✔
342
                              activitiesOfPullRequest: mergeRequest id
1✔
343
                              inRepoProjectId: mergeRequest project id
1✔
344
                              ofProjectGroupId: mergeRequest project group id.
1✔
345

1✔
346
        mergeActivity := activities detect: [ :activity |
1✔
347
                                 (activity at: #action) = 'MERGED' ].
1✔
348

1✔
349
        mergeUser := mergeActivity at: #user.
1✔
350

1✔
351
        mergeUser := (glhModel allWithType: GLHUser)
1✔
352
                             detect: [ :user | user id = (mergeUser at: #id) ]
1✔
353
                             ifFound: [ :user | user ]
1✔
354
                             ifNone: [
1✔
355
                                     | glhUser |
1✔
356
                                     glhUser := self parseUserIntoGLHUser: mergeUser.
1✔
357
                                     glhModel add: glhUser.
1✔
358
                                     glhUser ].
1✔
359

1✔
360
        mergeRequest merge_user: mergeUser.
1✔
361
        ^ mergeUser
1✔
362
]
1✔
363

364
{ #category : #'import - users' }
365
BitBucketModelImporter >> importUserByUsername: username [
1✔
366

1✔
367
         
1✔
368

1✔
369
        ^ self userCatalogue collectUsernames at: username ifAbsent: [
1✔
370
                |users glhUser user|
1✔
371
                
1✔
372
                users := self repoApi usersByUsername: username.
1✔
373
                users ifEmpty: [ ^ nil ].
1✔
374
                user := users first.
1✔
375

1✔
376
                glhUser := self parseUserIntoGLHUser: user.
1✔
377
                self glhModel add: glhUser unless: self blockOnIdEquality.
1✔
378
                self userCatalogue addUser: glhUser withName: username. 
1✔
379
                glhUser
1✔
380
                 ].
1✔
381
        
1✔
382
        
1✔
383
]
1✔
384

385
{ #category : #parsing }
386
BitBucketModelImporter >> parseCommitIntoGLHCommit: commitDictionary [
1✔
387

1✔
388
        | author committer parentIds |
1✔
389
        author := commitDictionary at: #author.
1✔
390
        committer := commitDictionary at: #committer.
1✔
391

1✔
392
        parentIds := (commitDictionary at: #parents) collect: [ :parent |
1✔
393
                             parent at: #id ].
1✔
394

1✔
395
        ^ GLHCommit new
1✔
396
                  id: (commitDictionary at: #id);
1✔
397
                  message: (commitDictionary at: #message);
1✔
398
                  author_email: (author at: #emailAddress);
1✔
399
                  author_name: (author at: #name);
1✔
400
                  authored_date: (DateAndTime fromUnixTime:
1✔
401
                                           (commitDictionary at: #authorTimestamp) / 1000);
1✔
402
                  created_at: (DateAndTime fromUnixTime:
1✔
403
                                           (commitDictionary at: #authorTimestamp) / 1000);
1✔
404
                  committed_date: (DateAndTime fromUnixTime:
1✔
405
                                           (commitDictionary at: #committerTimestamp) / 1000);
1✔
406
                  committer_email: (committer at: #emailAddress);
1✔
407
                  committer_name: (committer at: #name);
1✔
408
                  parent_ids: parentIds
1✔
409
]
1✔
410

411
{ #category : #parsing }
412
BitBucketModelImporter >> parseProjectIntoGLHGroup: projectRepository [
1✔
413

1✔
414
        ^GLHGroup new
1✔
415
                                                     name: (projectRepository at: #name);
1✔
416
                                                     id: (projectRepository at: #key);
1✔
417
                                                     description: (projectRepository at: #description).
1✔
418
]
1✔
419

420
{ #category : #parsing }
421
BitBucketModelImporter >> parsePullRequestIntoGLPHEMergeRequest: pullRequestDictionary [
1✔
422

1✔
423
        | repository project toRef fromRef glpheMergeRequest author state reviewers |
1✔
424
        toRef := pullRequestDictionary at: #toRef.
1✔
425
        fromRef := pullRequestDictionary at: #fromRef.
1✔
426
        
1✔
427
        reviewers := pullRequestDictionary at: #reviewers.
1✔
428
        reviewers := reviewers collect: [ :reviewer | 
1✔
429
                |reviewerUser|
1✔
430
                reviewerUser := reviewer at: #user.
1✔
431
                (self glhModel allWithType: GLHUser) detect: [ :user | user id = (reviewerUser at: #id) ]         ifFound: [ :user | user ] ifNone: [ 
1✔
432
                        |glhUser|
1✔
433
                        glhUser := self parseUserIntoGLHUser: reviewerUser.
1✔
434
                        glhModel  add: glhUser.
1✔
435
                        glhUser.                
1✔
436
                ]
1✔
437
                
1✔
438
        ].
1✔
439

1✔
440
        repository := toRef at: #repository.
1✔
441
        project := (self glhModel allWithType: GLHProject)
1✔
442
                           detect: [ :glhProject |
1✔
443
                           glhProject id = (repository at: #id) ]
1✔
444
                           ifFound: [ :glhProject | glhProject ]
1✔
445
                           ifNone: [
1✔
446
                                   project := self parseRepoIntoGLHProject: repository.
1✔
447
                                   self glhModel add: project.
1✔
448
                                   project ].
1✔
449

1✔
450

1✔
451
        author := pullRequestDictionary at: #author.
1✔
452
        author := (self glhModel allWithType: GLHUser)
1✔
453
                          detect: [ :user | user id = ((author at: #user) at: #id) ]
1✔
454
                          ifFound: [ :user | user ]
1✔
455
                          ifNone: [
1✔
456
                          self importUserByUsername:
1✔
457
                                  ((author at: #user) at: #displayName) ].
1✔
458

1✔
459

1✔
460
        glpheMergeRequest := GLPHEMergeRequest new
1✔
461
                                     name: (pullRequestDictionary at: #title);
1✔
462
                                     title: (pullRequestDictionary at: #title);
1✔
463
                                     id: (pullRequestDictionary at: #id);
1✔
464
                                     project: project;
1✔
465
                                     project_id: project id;
1✔
466
                                     target_branch: (toRef at: #id);
1✔
467
                                     target_project_id:
1✔
468
                                             ((toRef at: #repository) at: #id);
1✔
469
                                     source_branch: (fromRef at: #id);
1✔
470
                                     target_project_id:
1✔
471
                                             ((fromRef at: #repository) at: #id);
1✔
472
                                     updated_at: (DateAndTime fromUnixTime:
1✔
473
                                                              (pullRequestDictionary at: #updatedDate)
1✔
474
                                                              / 1000);
1✔
475
                                     created_at: (DateAndTime fromUnixTime:
1✔
476
                                                              (pullRequestDictionary at: #createdDate)
1✔
477
                                                              / 1000);
1✔
478
                                     author: author.
1✔
479

1✔
480
        "STATE"
1✔
481
        state := pullRequestDictionary at: #state.
1✔
482
        state = 'OPEN' ifTrue: [ glpheMergeRequest state: 'opened' ].
1✔
483
        state = 'MERGED' ifTrue: [
1✔
484
                glpheMergeRequest state: 'merged'.
1✔
485
                glpheMergeRequest merged_at: (DateAndTime fromUnixTime:
1✔
486
                                 (pullRequestDictionary at: #closedDate) / 1000) ].
1✔
487

1✔
488
        state = 'DECLINED' ifTrue: [
1✔
489
                glpheMergeRequest state: 'closed'.
1✔
490
                glpheMergeRequest closed_at: (DateAndTime fromUnixTime:
1✔
491
                                 (pullRequestDictionary at: #closedDate) / 1000) ].
1✔
492

1✔
493
        ^ glpheMergeRequest
1✔
494
]
1✔
495

496
{ #category : #parsing }
497
BitBucketModelImporter >> parseRepoIntoGLHProject: repositoryDictionary [
1✔
498

1✔
499
        | project group glhProject |
1✔
500
        project := repositoryDictionary at: #project.
1✔
501

1✔
502
        group := (self glhModel allWithType: GLHGroup)
1✔
503
                         detect: [ :glhGroup | glhGroup id = (project at: #key) ]
1✔
504
                         ifFound: [ :glhGroup | glhGroup ]
1✔
505
                         ifNone: [
1✔
506
                                 | newGroup |
1✔
507
                                 newGroup := self parseProjectIntoGLHGroup: project.
1✔
508
                                 glhModel add: newGroup.
1✔
509
                                 newGroup ].
1✔
510

1✔
511

1✔
512
        glhProject := GLHProject new
1✔
513
                              name: (repositoryDictionary at: #name);
1✔
514
                              id: (repositoryDictionary at: #slug);
1✔
515
                                                  repository: GLHRepository new;
1✔
516
                              group: group.
1✔
517

1✔
518
        group addProject: glhProject.
1✔
519

1✔
520
        ^ glhProject
1✔
521
]
1✔
522

523
{ #category : #parsing }
524
BitBucketModelImporter >> parseUserIntoGLHUser: userDictionnary [
1✔
525

1✔
526
        ^ GLHUser new name: (userDictionnary at: #displayName);
1✔
527
                public_email: (userDictionnary at: #emailAddress);
1✔
528
                id: (userDictionnary at: #id);
1✔
529
                username: (userDictionnary at: #name).
1✔
530
]
1✔
531

532
{ #category : #accessing }
533
BitBucketModelImporter >> withCommitDiffs [
×
534

×
535
        ^ withCommitDiffs
×
536
]
×
537

538
{ #category : #accessing }
539
BitBucketModelImporter >> withCommitDiffs: anObject [
×
540

×
541
        withCommitDiffs := anObject
×
542
]
×
543

544
{ #category : #accessing }
545
BitBucketModelImporter >> withInitialCommits [
×
546

×
547
        ^ withInitialCommits
×
548
]
×
549

550
{ #category : #accessing }
551
BitBucketModelImporter >> withInitialCommits: anObject [
×
552

×
553
        withInitialCommits := anObject
×
554
]
×
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

© 2025 Coveralls, Inc