Skip to content

Commit 877e29c

Browse files
authored
Merge pull request #19 from moosetechnology/clean-dead-code
Remove method that are only use by themselves
2 parents ff6cec9 + 6863623 commit 877e29c

File tree

2 files changed

+1
-101
lines changed

2 files changed

+1
-101
lines changed

src/GitLabHealth-Model-Importer/GLHModelImporter.class.st

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -390,51 +390,6 @@ GLHModelImporter >> importCommitsOProject: aProject since: fromDate until: toDat
390390
^ self glhModel addAll: foundCommit unless: self blockOnIdEquality
391391
]
392392

393-
{ #category : #api }
394-
GLHModelImporter >> importCommitsOf: aGLHProject withStats: aBoolean until: toDate [
395-
396-
| newlyFoundCommit page |
397-
398-
self deprecated: [ ] .
399-
400-
page := 0.
401-
newlyFoundCommit := { true }.
402-
[ newlyFoundCommit isNotEmpty ] whileTrue: [
403-
| results parsedResults existingCommits |
404-
page := page + 1.
405-
('import commit page ' , page printString) recordInfo.
406-
results := self glhApi
407-
commitsOfProject: aGLHProject id
408-
forRefName: nil
409-
since: nil
410-
until: nil
411-
path: nil
412-
author: nil
413-
all: nil
414-
with_stats: aBoolean
415-
firstParent: nil
416-
order: nil
417-
trailers: nil
418-
perPage: 100
419-
page: page.
420-
parsedResults := self parseCommitsResult: results.
421-
existingCommits := aGLHProject mooseModel allWithType: GLHCommit.
422-
423-
newlyFoundCommit := parsedResults reject: [ :commitParsed |
424-
(toDate isNil or: [
425-
commitParsed committed_date
426-
< toDate asDateAndTime ]) or: [
427-
existingCommits anySatisfy: [ :existingCommit |
428-
existingCommit id = commitParsed id ] ] ].
429-
aGLHProject mooseModel addAll: newlyFoundCommit.
430-
aGLHProject repository commits addAll: newlyFoundCommit ].
431-
432-
433-
self withCommitDiffs ifTrue: [
434-
aGLHProject repository commits do: [ :commit |
435-
self importDiffOfCommit: commit ] ]
436-
]
437-
438393
{ #category : #commit }
439394
GLHModelImporter >> importCommitsOfBranch: aGLHBranch forRefName: refName since: fromDate [
440395

@@ -601,32 +556,6 @@ GLHModelImporter >> importJobsOf: aPipeline [
601556

602557
]
603558

604-
{ #category : #commit }
605-
GLHModelImporter >> importParentCommitsOfCommit: aGLHCommit forOnly: number [
606-
607-
| parentsIds commits |
608-
commits := OrderedCollection new.
609-
number = 0 ifTrue: [
610-
^ commits
611-
add: aGLHCommit;
612-
yourself ].
613-
614-
parentsIds := aGLHCommit parent_ids.
615-
616-
commits addAll: (parentsIds collect: [ :id |
617-
self
618-
importCommitOfProject: aGLHCommit repository project
619-
withId: id.
620-
(self selectEntityType: GLHCommit overAttribut: #id equalTo: id)
621-
first ]).
622-
623-
624-
^ commits , (commits collect: [ :parentCommit |
625-
self
626-
importParentCommitsOfCommit: parentCommit
627-
forOnly: number - 1 ]) flatten
628-
]
629-
630559
{ #category : #commit }
631560
GLHModelImporter >> importParentCommitsOfCommit: aGLHCommit since: aDate [
632561

@@ -920,28 +849,6 @@ GLHModelImporter >> parseCommitsResult: result [
920849
^ reader nextAs: #ArrayOfCommit
921850
]
922851

923-
{ #category : #private }
924-
GLHModelImporter >> parseDiffResult: result [
925-
926-
| reader |
927-
self
928-
deprecated: 'Use #newParseDiffResult: instead'
929-
on: '28 June 2024'
930-
in:
931-
'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
932-
reader := NeoJSONReader on: result readStream.
933-
reader for: GLHDiff do: [ :mapping |
934-
mapping mapInstVars:
935-
#( deleted_file new_file new_path old_path renamed_file ).
936-
mapping mapInstVar: #diffString to: #diff ].
937-
938-
reader
939-
for: #ArrayOfDiffs
940-
customDo: [ :customMappting |
941-
customMappting listOfElementSchema: GLHDiff ].
942-
^ reader nextAs: #ArrayOfDiffs
943-
]
944-
945852
{ #category : #private }
946853
GLHModelImporter >> parseFileTreeResult: aResult [
947854

@@ -1053,13 +960,6 @@ GLHModelImporter >> pipelinesOf: aProjectID [
1053960
^ self parsePipelinesResult: result
1054961
]
1055962

1056-
{ #category : #'as yet unclassified' }
1057-
GLHModelImporter >> selectEntityType: aType overAttribut: aSelector equalTo: value [
1058-
1059-
^ (self glhModel allWithType: aType)
1060-
select: [ :entity | (entity perform: aSelector) = value ]
1061-
]
1062-
1063963
{ #category : #'private - api' }
1064964
GLHModelImporter >> subGroupsOf: aGroupID [
1065965

src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ GLPHModelImporter >> importDiffOfMergeRequest: aMergeRequest [
216216
diffsMergeRequestOfProject: aMergeRequest project_id
217217
withId: aMergeRequest iid.
218218

219-
diffsResult := self parseDiffResult: result.
219+
diffsResult := self newParseDiffResult: result.
220220

221221

222222
aMergeRequest diffs

0 commit comments

Comments
 (0)