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

moosetechnology / GitProjectHealth / 11382630101

17 Oct 2024 09:56AM UTC coverage: 58.036% (-0.03%) from 58.07%
11382630101

Pull #86

github

web-flow
Merge 2c2e14252 into 833d56a24
Pull Request #86: add complete commit import to bitbucket methods

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

1 existing line in 1 file now uncovered.

8984 of 15480 relevant lines covered (58.04%)

0.58 hits per line

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

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

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

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

×
19
        ^ repoApi
×
20
]
×
21

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

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

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

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

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

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

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

×
55
        ^ aCommit
×
56
]
×
57

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

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

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

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

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

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

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

×
118
        ^ result
×
119
]
×
120

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

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

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

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

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

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

1✔
157
        ^ contribution
1✔
158
]
1✔
159

160
{ #category : #'comment import' }
NEW
161
BitBucketModelImporter >> importAndLoadLatestsCommitsOfProject: aGLHProject [
×
NEW
162

×
NEW
163
        | commits |
×
NEW
164
        self completeImportProject: aGLHProject.
×
NEW
165

×
NEW
166
        commits :=  self
×
NEW
167
                  importCommitsOfProject: aGLHProject
×
NEW
168
                  since: (Date today - 3 week) asDateAndTime
×
NEW
169
                  until: Date today asDateAndTime.
×
NEW
170
        commits do: [ :commit | self completeImportedCommit: commit ].
×
NEW
171
        self chainsCommitsFrom: commits.
×
NEW
172
        ^ commits
×
UNCOV
173
]
×
174

175
{ #category : #'import - commits' }
176
BitBucketModelImporter >> importCommitsOfProject: aGLHProject since: since until: until [
1✔
177

1✔
178
        | commits |
1✔
179
        commits := self repoApi
1✔
180
                           commitsOfRepoProjectId: aGLHProject id
1✔
181
                           inProjectGroupId: aGLHProject group id
1✔
182
                           since: since
1✔
183
                           until: until.
1✔
184

1✔
185
        commits := commits collect: [ :commit |
1✔
186
                     
1✔
187
                           self parseCommitIntoGLHCommit: commit ofProject: aGLHProject.
1✔
188

1✔
189
                         ].
1✔
190

1✔
191

1✔
192
        commits := self glhModel
1✔
193
                           addAll: commits
1✔
194
                           unless: self blockOnIdEquality.
1✔
195
        ^ aGLHProject repository commits
1✔
196
                  addAll: commits
1✔
197
                  unless: self blockOnIdEquality
1✔
198
]
1✔
199

200
{ #category : #'import - projects' }
201
BitBucketModelImporter >> importContributedProjectsOfUser: aGLHUser [
1✔
202

1✔
203
        | projects repositories repositoriesCommits userRepositories userProjects |
1✔
204
        "get all projects"
1✔
205
        projects := self repoApi projects.
1✔
206

1✔
207
        "get all repos of projects"
1✔
208
        repositories := projects flatCollect: [ :project |
1✔
209
                                self repoApi repositoryProjectsOfProjectGroupId:
1✔
210
                                        (project at: #key) ].
1✔
211

1✔
212

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

1✔
222

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

1✔
236

1✔
237
        "Transform user repositories in GLHProject"
1✔
238
        userProjects := userRepositories collect: [ :repoCommits |
1✔
239
                                | repo project |
1✔
240
                                repo := repoCommits key.
1✔
241
                                project := repo at: #project.
1✔
242

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

1✔
253
        aGLHUser contributedProjects: userProjects.
1✔
254

1✔
255
        ^ userProjects
1✔
256
]
1✔
257

258
{ #category : #'import - commits' }
259
BitBucketModelImporter >> importCreatorOfCommit: aGLHCommit [
1✔
260

1✔
261
        | creator |
1✔
262
        (self glhModel allWithType: GLHUser)
1✔
263
                detect: [ :user | user username = aGLHCommit author_name ]
1✔
264
                ifFound: [ :user |
1✔
265
                        aGLHCommit commitCreator: user.
1✔
266
                        ^ user ].
1✔
267

1✔
268
        creator := self importUserByUsername: aGLHCommit author_name.
1✔
269
        aGLHCommit commitCreator: creator.
1✔
270
        ^ creator
1✔
271
]
1✔
272

273
{ #category : #api }
274
BitBucketModelImporter >> importDiffOfCommit: aCommit [
×
275

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

×
286
        diffsResult := self convertBitBucketDiffToGitDiff: result.
×
287

×
288

×
289
        diffsResult := aCommit diffs
×
290
                               addAll: diffsResult
×
291
                               unless: self blockForDiffEquality.
×
292

×
293
        "changes are added into the model during the import"
×
294
        diffsResult do: [ :diff | self importDiffRangesForDiff: diff ].
×
295

×
296
        ^ diffsResult
×
297
]
×
298

299
{ #category : #'import - merge-requests' }
300
BitBucketModelImporter >> importMergeRequestCommits: mergeRequest [
1✔
301

1✔
302
        | commits |
1✔
303
        commits := self repoApi
1✔
304
                           commitsOfPullRequest: mergeRequest id
1✔
305
                           ofRepoProjectId: mergeRequest project id
1✔
306
                           inProjectGroupId: mergeRequest project group id.
1✔
307

1✔
308
        commits := commits collect: [ :commit |
1✔
309
                           self parseCommitIntoGLHCommit: commit ofProject: mergeRequest project ].
1✔
310

1✔
311
        mergeRequest commits: commits.
1✔
312

1✔
313
        ^ commits
1✔
314
]
1✔
315

316
{ #category : #'import - merge-requests' }
317
BitBucketModelImporter >> importMergeRequests: aGLHProject since: fromDate until: toDate [
1✔
318

1✔
319
        | pullRequests |
1✔
320
        pullRequests := self repoApi
1✔
321
                                pullRequestsOfRepoProjectId: aGLHProject id
1✔
322
                                inProjectGroupId: aGLHProject group id
1✔
323
                                since: fromDate
1✔
324
                                until: toDate.
1✔
325

1✔
326
        pullRequests := pullRequests collect: [ :pullRequest |
1✔
327
                                self parsePullRequestIntoGLPHEMergeRequest:
1✔
328
                                        pullRequest ].
1✔
329

1✔
330
        pullRequests := self glhModel addAll: pullRequests unless: self blockOnIdEquality.
1✔
331

1✔
332
        ^ pullRequests
1✔
333
]
1✔
334

335
{ #category : #'import - merge-requests' }
336
BitBucketModelImporter >> importMergeResquestAuthor: mergeRequest [
×
337
        mergeRequest author ifNotNil: [ ^mergeRequest ]
×
338
]
×
339

340
{ #category : #'import - merge-requests' }
341
BitBucketModelImporter >> importMergeResquestMerger: mergeRequest [
1✔
342

1✔
343
        | activities mergeActivity mergeUser |
1✔
344
        mergeRequest merge_user ifNotNil: [ ^ mergeRequest merge_user ].
1✔
345
        mergeRequest state = 'merged' ifFalse: [ ^ nil ].
1✔
346

1✔
347
        activities := self repoApi
1✔
348
                              activitiesOfPullRequest: mergeRequest id
1✔
349
                              inRepoProjectId: mergeRequest project id
1✔
350
                              ofProjectGroupId: mergeRequest project group id.
1✔
351

1✔
352
        mergeActivity := activities detect: [ :activity |
1✔
353
                                 (activity at: #action) = 'MERGED' ].
1✔
354

1✔
355
        mergeUser := mergeActivity at: #user.
1✔
356

1✔
357
        mergeUser := (glhModel allWithType: GLHUser)
1✔
358
                             detect: [ :user | user id = (mergeUser at: #id) ]
1✔
359
                             ifFound: [ :user | user ]
1✔
360
                             ifNone: [
1✔
361
                                     | glhUser |
1✔
362
                                     glhUser := self parseUserIntoGLHUser: mergeUser.
1✔
363
                                     glhModel add: glhUser.
1✔
364
                                     glhUser ].
1✔
365

1✔
366
        mergeRequest merge_user: mergeUser.
1✔
367
        ^ mergeUser
1✔
368
]
1✔
369

370
{ #category : #'import - users' }
371
BitBucketModelImporter >> importUserByUsername: username [
1✔
372

1✔
373
         
1✔
374

1✔
375
        ^ self userCatalogue collectUsernames at: username ifAbsent: [
1✔
376
                |users glhUser user|
1✔
377
                
1✔
378
                users := self repoApi usersByUsername: username.
1✔
379
                users ifEmpty: [ ^ nil ].
1✔
380
                user := users first.
1✔
381

1✔
382
                glhUser := self parseUserIntoGLHUser: user.
1✔
383
                self glhModel add: glhUser unless: self blockOnIdEquality.
1✔
384
                self userCatalogue addUser: glhUser withName: username. 
1✔
385
                glhUser
1✔
386
                 ].
1✔
387
        
1✔
388
        
1✔
389
]
1✔
390

391
{ #category : #parsing }
392
BitBucketModelImporter >> parseCommitIntoGLHCommit: commitDictionary ofProject: aGLHProject [
1✔
393

1✔
394
        | author committer parentIds commitDiffs contribution |
1✔
395
        author := commitDictionary at: #author.
1✔
396
        committer := commitDictionary at: #committer.
1✔
397

1✔
398
        parentIds := (commitDictionary at: #parents) collect: [ :parent |
1✔
399
                             parent at: #id ].
1✔
400

1✔
401
        commitDiffs := self repoApi
1✔
402
                               diffsOfCommit: (commitDictionary at: #id)
1✔
403
                               inRepoProjectId: aGLHProject id
1✔
404
                               inProjectGroupId: aGLHProject group id.
1✔
405

1✔
406
        contribution := self getContributionFromDiffs:
1✔
407
                                (commitDiffs at: #diffs).
1✔
408

1✔
409
        ^ GLHCommit new
1✔
410
                  id: (commitDictionary at: #id);
1✔
411
                  message: (commitDictionary at: #message);
1✔
412
                  author_email: (author at: #emailAddress);
1✔
413
                  author_name: (author at: #name);
1✔
414
                  authored_date: (DateAndTime fromUnixTime:
1✔
415
                                           (commitDictionary at: #authorTimestamp) / 1000);
1✔
416
                  created_at: (DateAndTime fromUnixTime:
1✔
417
                                           (commitDictionary at: #authorTimestamp) / 1000);
1✔
418
                  committed_date: (DateAndTime fromUnixTime:
1✔
419
                                           (commitDictionary at: #committerTimestamp) / 1000);
1✔
420
                  committer_email: (committer at: #emailAddress);
1✔
421
                  committer_name: (committer at: #name);
1✔
422
                  parent_ids: parentIds;
1✔
423
                  additions: (contribution at: #additions);
1✔
424
                  deletions: (contribution at: #deletions)
1✔
425
]
1✔
426

427
{ #category : #parsing }
428
BitBucketModelImporter >> parseProjectIntoGLHGroup: projectRepository [
1✔
429

1✔
430
        ^GLHGroup new
1✔
431
                                                     name: (projectRepository at: #name);
1✔
432
                                                     id: (projectRepository at: #key);
1✔
433
                                                     description: (projectRepository at: #description).
1✔
434
]
1✔
435

436
{ #category : #parsing }
437
BitBucketModelImporter >> parsePullRequestIntoGLPHEMergeRequest: pullRequestDictionary [
1✔
438

1✔
439
        | repository project toRef fromRef glpheMergeRequest author state reviewers |
1✔
440
        toRef := pullRequestDictionary at: #toRef.
1✔
441
        fromRef := pullRequestDictionary at: #fromRef.
1✔
442
        
1✔
443
        reviewers := pullRequestDictionary at: #reviewers.
1✔
444
        reviewers := reviewers collect: [ :reviewer | 
1✔
445
                |reviewerUser|
1✔
446
                reviewerUser := reviewer at: #user.
1✔
447
                (self glhModel allWithType: GLHUser) detect: [ :user | user id = (reviewerUser at: #id) ]         ifFound: [ :user | user ] ifNone: [ 
1✔
448
                        |glhUser|
1✔
449
                        glhUser := self parseUserIntoGLHUser: reviewerUser.
1✔
450
                        glhModel  add: glhUser.
1✔
451
                        glhUser.                
1✔
452
                ]
1✔
453
                
1✔
454
        ].
1✔
455

1✔
456
        repository := toRef at: #repository.
1✔
457
        project := (self glhModel allWithType: GLHProject)
1✔
458
                           detect: [ :glhProject |
1✔
459
                           glhProject id = (repository at: #id) ]
1✔
460
                           ifFound: [ :glhProject | glhProject ]
1✔
461
                           ifNone: [
1✔
462
                                   project := self parseRepoIntoGLHProject: repository.
1✔
463
                                   self glhModel add: project.
1✔
464
                                   project ].
1✔
465

1✔
466

1✔
467
        author := pullRequestDictionary at: #author.
1✔
468
        author := (self glhModel allWithType: GLHUser)
1✔
469
                          detect: [ :user | user id = ((author at: #user) at: #id) ]
1✔
470
                          ifFound: [ :user | user ]
1✔
471
                          ifNone: [
1✔
472
                          self importUserByUsername:
1✔
473
                                  ((author at: #user) at: #displayName) ].
1✔
474

1✔
475

1✔
476
        glpheMergeRequest := GLPHEMergeRequest new
1✔
477
                                     name: (pullRequestDictionary at: #title);
1✔
478
                                     title: (pullRequestDictionary at: #title);
1✔
479
                                     id: (pullRequestDictionary at: #id);
1✔
480
                                     project: project;
1✔
481
                                     project_id: project id;
1✔
482
                                     target_branch: (toRef at: #id);
1✔
483
                                     target_project_id:
1✔
484
                                             ((toRef at: #repository) at: #id);
1✔
485
                                     source_branch: (fromRef at: #id);
1✔
486
                                     target_project_id:
1✔
487
                                             ((fromRef at: #repository) at: #id);
1✔
488
                                     updated_at: (DateAndTime fromUnixTime:
1✔
489
                                                              (pullRequestDictionary at: #updatedDate)
1✔
490
                                                              / 1000);
1✔
491
                                     created_at: (DateAndTime fromUnixTime:
1✔
492
                                                              (pullRequestDictionary at: #createdDate)
1✔
493
                                                              / 1000);
1✔
494
                                     author: author.
1✔
495

1✔
496
        "STATE"
1✔
497
        state := pullRequestDictionary at: #state.
1✔
498
        state = 'OPEN' ifTrue: [ glpheMergeRequest state: 'opened' ].
1✔
499
        state = 'MERGED' ifTrue: [
1✔
500
                glpheMergeRequest state: 'merged'.
1✔
501
                glpheMergeRequest merged_at: (DateAndTime fromUnixTime:
1✔
502
                                 (pullRequestDictionary at: #closedDate) / 1000) ].
1✔
503

1✔
504
        state = 'DECLINED' ifTrue: [
1✔
505
                glpheMergeRequest state: 'closed'.
1✔
506
                glpheMergeRequest closed_at: (DateAndTime fromUnixTime:
1✔
507
                                 (pullRequestDictionary at: #closedDate) / 1000) ].
1✔
508

1✔
509
        ^ glpheMergeRequest
1✔
510
]
1✔
511

512
{ #category : #parsing }
513
BitBucketModelImporter >> parseRepoIntoGLHProject: repositoryDictionary [
1✔
514

1✔
515
        | project group glhProject |
1✔
516
        project := repositoryDictionary at: #project.
1✔
517

1✔
518
        group := (self glhModel allWithType: GLHGroup)
1✔
519
                         detect: [ :glhGroup | glhGroup id = (project at: #key) ]
1✔
520
                         ifFound: [ :glhGroup | glhGroup ]
1✔
521
                         ifNone: [
1✔
522
                                 | newGroup |
1✔
523
                                 newGroup := self parseProjectIntoGLHGroup: project.
1✔
524
                                 glhModel add: newGroup.
1✔
525
                                 newGroup ].
1✔
526

1✔
527

1✔
528
        glhProject := GLHProject new
1✔
529
                              name: (repositoryDictionary at: #name);
1✔
530
                              id: (repositoryDictionary at: #slug);
1✔
531
                                                  repository: GLHRepository new;
1✔
532
                              group: group.
1✔
533

1✔
534
        group addProject: glhProject.
1✔
535

1✔
536
        ^ glhProject
1✔
537
]
1✔
538

539
{ #category : #parsing }
540
BitBucketModelImporter >> parseUserIntoGLHUser: userDictionnary [
1✔
541

1✔
542
        ^ GLHUser new name: (userDictionnary at: #displayName);
1✔
543
                public_email: (userDictionnary at: #emailAddress);
1✔
544
                id: (userDictionnary at: #id);
1✔
545
                username: (userDictionnary at: #name).
1✔
546
]
1✔
547

548
{ #category : #accessing }
549
BitBucketModelImporter >> withInitialCommits [
×
550

×
551
        ^ withInitialCommits
×
552
]
×
553

554
{ #category : #accessing }
555
BitBucketModelImporter >> withInitialCommits: anObject [
×
556

×
557
        withInitialCommits := anObject
×
558
]
×
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