From 92effa83d9964e64cf2a5ac6fa70247245b0591d Mon Sep 17 00:00:00 2001 From: Benoit Verhaeghe Date: Fri, 14 Jun 2024 14:33:19 +0200 Subject: [PATCH] remove unused variable --- .../GLHApi.class.st | 13 ++-- .../GLHModelImporter.class.st | 62 +++++++++---------- 2 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/GitLabHealth-Model-Importer/GLHApi.class.st b/src/GitLabHealth-Model-Importer/GLHApi.class.st index 2d1eaf9..4848b25 100644 --- a/src/GitLabHealth-Model-Importer/GLHApi.class.st +++ b/src/GitLabHealth-Model-Importer/GLHApi.class.st @@ -6,7 +6,6 @@ Class { #superclass : #Object, #instVars : [ 'baseAPIUrl', - 'privateToken', 'client' ], #category : #'GitLabHealth-Model-Importer' @@ -45,7 +44,7 @@ GLHApi >> client: anObject [ ] { #category : #'api - commits' } -GLHApi >> commit: commitSHA ofProject: aProjectId withStat: stats [ +GLHApi >> commit: commitSHA ofProject: aProjectId [ self client path: (String streamContents: [ :str | str @@ -55,15 +54,12 @@ GLHApi >> commit: commitSHA ofProject: aProjectId withStat: stats [ << '/repository/commits/'; << commitSHA asString; << '' ]). - - - stats ifNotNil: [ self client queryAt: #stats put: stats ]. ^ self client get ] { #category : #'api - commits' } -GLHApi >> commit: commitSHA ofProject: aProjectId [ +GLHApi >> commit: commitSHA ofProject: aProjectId withStat: stats [ self client path: (String streamContents: [ :str | str @@ -73,12 +69,13 @@ GLHApi >> commit: commitSHA ofProject: aProjectId [ << '/repository/commits/'; << commitSHA asString; << '' ]). + + + stats ifNotNil: [ self client queryAt: #stats put: stats ]. ^ self client get ] - - { #category : #'api - commits' } GLHApi >> commitDiff: commitSHA ofProject: aProjectId unidiff: unidiff [ diff --git a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st index 44398ef..0cb5fe5 100644 --- a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st @@ -212,6 +212,24 @@ GLHModelImporter >> glhModel: anObject [ glhModel := anObject ] +{ #category : #'private - api' } +GLHModelImporter >> importCommit: aCommitID ofProject: aGLHProject [ + + | result parsedResult | + (glhModel allWithType: GLHCommit) asOrderedCollection + detect: [ :commit | commit id = aCommitID ] + ifFound: [ :commit | ^ commit ]. + result := self glhApi + commit: aCommitID + ofProject: aGLHProject id + withStat: false. + parsedResult := self parseCommitResult: result. + self + addCommits: { parsedResult } + toRepository: aGLHProject repository. + ^ parsedResult +] + { #category : #'as yet unclassified' } GLHModelImporter >> importCommitOfProject: anProject withId: anID [ @@ -239,24 +257,6 @@ GLHModelImporter >> importCommitOfProject: anProject withId: anID [ ^ commit ] -{ #category : #'private - api' } -GLHModelImporter >> importCommit: aCommitID ofProject: aGLHProject [ - - | result parsedResult | - (glhModel allWithType: GLHCommit) asOrderedCollection - detect: [ :commit | commit id = aCommitID ] - ifFound: [ :commit | ^ commit ]. - result := self glhApi - commit: aCommitID - ofProject: aGLHProject id - withStat: false. - parsedResult := self parseCommitResult: result. - self - addCommits: { parsedResult } - toRepository: aGLHProject repository. - ^ parsedResult -] - { #category : #'private - api' } GLHModelImporter >> importCommits: aGLHProject [ "limited to the last 20 commits" @@ -529,6 +529,19 @@ GLHModelImporter >> importGroup: aGroupID [ ^ groupResult ] +{ #category : #api } +GLHModelImporter >> importJobsOf: aPipeline [ + + | result jobs | + result := self glhApi + jobsOfProject: aPipeline project id + ofPipelines: aPipeline id. + jobs := self parseJobsResult: result ofProject: aPipeline project. + jobs do: [ :job | aPipeline addJob: job ]. + self glhModel addAll: jobs + +] + { #category : #commit } GLHModelImporter >> importParentCommitsOfCommit: aGLHCommit forOnly: number [ @@ -587,19 +600,6 @@ GLHModelImporter >> importPipelinesOfProject: aGLHProject [ aGLHProject addPipeline: pipeline ] ] -{ #category : #api } -GLHModelImporter >> importJobsOf: aPipeline [ - - | result jobs | - result := self glhApi - jobsOfProject: aPipeline project id - ofPipelines: aPipeline id. - jobs := self parseJobsResult: result ofProject: aPipeline project. - jobs do: [ :job | aPipeline addJob: job ]. - self glhModel addAll: jobs - -] - { #category : #'private - api' } GLHModelImporter >> importRepository: aGLHRepository [