From aa279107c2bf828b8bb4c33c92854e0b8cad5e14 Mon Sep 17 00:00:00 2001 From: Benoit Verhaeghe Date: Tue, 1 Sep 2026 16:57:48 +0200 Subject: [PATCH 1/4] remove useless comment --- src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st b/src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st index 456a1864..2f9f44c0 100644 --- a/src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st @@ -873,9 +873,6 @@ GitlabModelImporter >> importCommitsFromTag: fromTag toTag: toTag [ GitlabModelImporter >> importCommitsOfBranch: aGLHBranch [ | commits | - " result := self glhApi - commitsOfProject: aGLHBranch repository project id - forRefName: aGLHBranch name." commits := self importCommitsOfBranch: aGLHBranch since: withCommitsSince. From c25fa04afe307484381c5dfb1422f32e957dad5d Mon Sep 17 00:00:00 2001 From: Benoit Verhaeghe Date: Tue, 1 Sep 2026 17:10:29 +0200 Subject: [PATCH 2/4] remove deprecated method --- .../GitAnalyzerTest.class.st | 33 ++++----- .../GitlabModelImporter.class.st | 67 ------------------- 2 files changed, 18 insertions(+), 82 deletions(-) diff --git a/src/GitLabHealth-Model-Analysis-Tests/GitAnalyzerTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/GitAnalyzerTest.class.st index 9eb51a2c..fb8e7e77 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/GitAnalyzerTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/GitAnalyzerTest.class.st @@ -60,17 +60,19 @@ GitAnalyzerTest >> testAnalyseAmandment [ mondayCommit -> tuesdayCommit -> wednesdayCommit " wednesdayCommit := glhImporter - importCommitOfProject: projects first - withId: - 'f298ec312f81032b611a890f993d98096ab3bbc1'. + importCommit: + 'f298ec312f81032b611a890f993d98096ab3bbc1' + ofProject: projects first. mondayCommit := glhImporter - importCommitOfProject: projects first - withId: '8a6f665118e6fcfa468d7cce1a7e944ba65812ab'. + importCommit: + '8a6f665118e6fcfa468d7cce1a7e944ba65812ab' + ofProject: projects first. tuesdayCommit := glhImporter - importCommitOfProject: projects first - withId: '2c7308c727560dd425ef78f9a95ca7650d164bed'. + importCommit: + '2c7308c727560dd425ef78f9a95ca7650d164bed' + ofProject: projects first. myCommits := { mondayCommit. @@ -135,18 +137,19 @@ GitAnalyzerTest >> testChurnMetric [ "commit chain: mondayCommit -> tuesdayCommit -> wednesdayCommit " wednesdayCommit := glhImporter - importCommitOfProject: projects first - withId: - 'f298ec312f81032b611a890f993d98096ab3bbc1'. + importCommit: + 'f298ec312f81032b611a890f993d98096ab3bbc1' + ofProject: projects first. mondayCommit := glhImporter - importCommitOfProject: projects first - withId: '8a6f665118e6fcfa468d7cce1a7e944ba65812ab'. + importCommit: + '8a6f665118e6fcfa468d7cce1a7e944ba65812ab' + ofProject: projects first. tuesdayCommit := glhImporter - importCommitOfProject: projects first - withId: '2c7308c727560dd425ef78f9a95ca7650d164bed'. - + importCommit: + '2c7308c727560dd425ef78f9a95ca7650d164bed' + ofProject: projects first. myCommits := { mondayCommit. diff --git a/src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st b/src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st index 2f9f44c0..da44303f 100644 --- a/src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st @@ -766,73 +766,6 @@ GitlabModelImporter >> importCommit: aCommitID ofProject: aGLHProject [ ^ parsedResult ] -{ #category : #'import - commits' } -GitlabModelImporter >> importCommitOfProject: anProject withId: anID [ - - | commit result | -self - deprecated: 'Use importCommit:ofProject: instead of current one' - on: '27 August 2025' - in: 'MSR 1.3.0 ' - transformWith: '`@rcv importCommitOfProject: `arg1 withId: `arg2' -> '`@rcv importCommit: `arg2 ofProject: `arg1'. - anID ifNil: [ ^ nil ]. - - ('looking for commit ' , anID printString , ' in project : ' - , anProject id printString) recordInfo. - - commit := (self - detectEntityType: GLHCommit - overAttribut: #id - equalTo: anID) ifNil: [ - result := self repoApi commits - get: anID - inProject: anProject id. - commit := (self parseCommitsResult: '[' , result , ']') - first. - - commit := self glhModel - add: commit - unless: self blockOnIdEquality. - commit repository: anProject repository. - - commit ]. - - self withCommitDiffs ifTrue: [ self importDiffOfCommit: commit ]. - - ^ commit -] - -{ #category : #'import - commits' } -GitlabModelImporter >> importCommits: aGLHProject [ - "limited to the last 20 commits" - - | results parsedResults params | - self - deprecated: - 'Use importLatestCommitsOfProject: instead of current one' - on: '19 September 2025' - in: - 'Pharo-12.0.0+SNAPSHOT.build.1571.sha.cf5fcd22e66957962c97dffc58b0393b7f368147 (64 Bit)'. - - params := { (#with_stats -> 'true') } asDictionary. - results := self repoApi commits - getByPage: 1 - perPage: 20 - inProject: aGLHProject id - withParams: params. - - parsedResults := self parseCommitsResult: results. - self glhModel addAll: parsedResults unless: self blockOnIdEquality. - - parsedResults do: [ :commit | - commit repository: aGLHProject repository ]. - - self withCommitDiffs ifTrue: [ - parsedResults do: [ :commit | self importDiffOfCommit: commit ] ]. - - ^ parsedResults -] - { #category : #'import - commits' } GitlabModelImporter >> importCommitsFollowing: aCommit upToDays: aNumberOfDay [ "import the 'n' commits of a project starting from an initial 'aCommit' commit. From 8f9bfd1b6188fd711bb93cbe4c5c5782c1c0de85 Mon Sep 17 00:00:00 2001 From: Benoit Verhaeghe Date: Tue, 1 Sep 2026 17:14:26 +0200 Subject: [PATCH 3/4] clean deprecated methods --- .../GithubModelImporter.class.st | 28 ++++++++++++++++--- .../ProjectMetric.class.st | 2 +- .../GitModelImporter.class.st | 6 ++++ .../TGitModelImporterTest.trait.st | 2 +- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/GitHubHealth-Model-Importer/GithubModelImporter.class.st b/src/GitHubHealth-Model-Importer/GithubModelImporter.class.st index d58bb1a5..695b457d 100644 --- a/src/GitHubHealth-Model-Importer/GithubModelImporter.class.st +++ b/src/GitHubHealth-Model-Importer/GithubModelImporter.class.st @@ -71,8 +71,8 @@ GithubModelImporter >> completeImportedProject: aGLHProject [ aGLHProject repository: GLHRepository new. self glhModel add: aGLHProject repository. - self importPipelinesOfProject: aGLHProject. - self importBranchesOf: aGLHProject. + self importAllPipelinesOfProject: aGLHProject. + self importBranchesOfProject: aGLHProject. self withCommitsSince ifNotNil: [ :withCommitSince | "If not nil, it means we have to import commit" | commits | commits := self importCommitsOfProject: aGLHProject. @@ -343,6 +343,20 @@ GithubModelImporter >> ensureGroupNamed: aGroupName [ ifNone: [ self glhModel newGroupNamed: aGroupName ] ] +{ #category : #'import - pipelines' } +GithubModelImporter >> importAllPipelinesOfProject: project [ + + "add the pipeline (actions runs) in the project" + + | pipelinesResult ghApiPipelineOverview | + pipelinesResult := self repoApi actions + getLatestForRepo: project name + ofOwner: project group name. + ghApiPipelineOverview := self parsePipelinesResult: pipelinesResult. + ghApiPipelineOverview workflow_runs do: [ :pipeline | + project addPipeline: pipeline ] +] + { #category : #'import - branches' } GithubModelImporter >> importBranchesOf: aGLHProject [ "add the pipeline (actions runs) in the project" @@ -817,15 +831,21 @@ GithubModelImporter >> importPipelinesOfMergeRequest: aGLHMergeRequest [ { #category : #'import - pipelines' } GithubModelImporter >> importPipelinesOfProject: project [ - "add the pipeline (actions runs) in the project" | pipelinesResult ghApiPipelineOverview | + self + deprecated: + 'Use importAllPipelinesOfProject: instead of current one' + on: '1 September 2026' + in: + 'Pharo-12.0.0+SNAPSHOT.build.1571.sha.cf5fcd22e66957962c97dffc58b0393b7f368147 (64 Bit)'. + pipelinesResult := self repoApi actions getLatestForRepo: project name ofOwner: project group name. ghApiPipelineOverview := self parsePipelinesResult: pipelinesResult. - ghApiPipelineOverview workflow_runs do: [ :pipeline | + ghApiPipelineOverview workflow_runs do: [ :pipeline | project addPipeline: pipeline ] ] diff --git a/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st b/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st index 3a3db039..d7367f21 100644 --- a/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st @@ -22,7 +22,7 @@ ProjectMetric class >> isAbstract [ ProjectMetric >> loadAllBranches [ | branches | - branches := glhImporter importBranchesOf: project. + branches := glhImporter importBranchesOfProject: project. branches do: [ :branch | glhImporter importRefCommitOfBranch: branch ]. ^ branches ] diff --git a/src/GitProjectHealth-Model-Importer/GitModelImporter.class.st b/src/GitProjectHealth-Model-Importer/GitModelImporter.class.st index 7e0e8478..8fd7c502 100644 --- a/src/GitProjectHealth-Model-Importer/GitModelImporter.class.st +++ b/src/GitProjectHealth-Model-Importer/GitModelImporter.class.st @@ -430,6 +430,12 @@ GitModelImporter >> glhModel: anObject [ glhModel := anObject ] +{ #category : #'import - pipelines' } +GitModelImporter >> importAllPipelinesOfProject: aGLHProject [ + self subclassResponsibility + +] + { #category : #'import - commits' } GitModelImporter >> importAndLoadLatestsCommitsOfProject: aGLHProject [ diff --git a/src/GitProjectHealth-Model-Importer/TGitModelImporterTest.trait.st b/src/GitProjectHealth-Model-Importer/TGitModelImporterTest.trait.st index 72d797a7..b3f9df23 100644 --- a/src/GitProjectHealth-Model-Importer/TGitModelImporterTest.trait.st +++ b/src/GitProjectHealth-Model-Importer/TGitModelImporterTest.trait.st @@ -237,7 +237,7 @@ TGitModelImporterTest >> defaultProject [ TGitModelImporterTest >> testImportBranchesOf [ | collection element | - collection := importer importBranchesOf: self defaultProject. + collection := importer importBranchesOfProject: self defaultProject. self assert: collection isCollection. From ae09a9bea24bf740fb8ce0c484556753696a07ec Mon Sep 17 00:00:00 2001 From: Benoit Verhaeghe Date: Mon, 7 Sep 2026 08:48:13 +0200 Subject: [PATCH 4/4] update mock since it has been deprecated --- .../GLPHImporterMock.class.st | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/GitLabHealth-Model-Analysis-Tests/GLPHImporterMock.class.st b/src/GitLabHealth-Model-Analysis-Tests/GLPHImporterMock.class.st index f89adf80..b55b18a8 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/GLPHImporterMock.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/GLPHImporterMock.class.st @@ -56,8 +56,15 @@ GLPHImporterMock >> glhModel: anObject [ ] { #category : #'import - repositories' } -GLPHImporterMock >> importBranchesOf: aGLHProject [ - ^ aGLHProject repository branches . +GLPHImporterMock >> importBranchesOf: aGLHProject [ + + self deprecated: #'It has been deprecated' +] + +{ #category : #'import - repositories' } +GLPHImporterMock >> importBranchesOfProject: aGLHProject [ + + ^ aGLHProject repository branches ] { #category : #'import - commits' }