Skip to content

Commit

Permalink
Merge pull request #118 from moosetechnology/fix-id-was-sent-to-nil
Browse files Browse the repository at this point in the history
fix: #id was sent to nil in importCreatorOfCommit:
  • Loading branch information
badetitou authored Jan 30, 2025
2 parents 1246665 + a3bbc7a commit 44f69e0
Show file tree
Hide file tree
Showing 31 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/GitLabHealth-Model-Analysis/AnalysisReport.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Class {
'over',
'metrics'
],
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #initialization }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #ClosedMergeRequestMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #ClosedTicketsMetric,
#superclass : #UserJiraMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CodeAdditionByMRMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CodeAdditionByTicketMetric,
#superclass : #UserJiraMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CodeAdditionMetric,
#superclass : #UserCommitsMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
2 changes: 1 addition & 1 deletion src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#instVars : [
'maxCommitWindow'
],
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CodeDeletionByMRMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CodeDeletionByTicketMetric,
#superclass : #UserJiraMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CodeDeletionMetric,
#superclass : #UserCommitsMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CommentContributionMetric,
#superclass : #UserCommitsMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CommitFrequencyMetric,
#superclass : #UserCommitsMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #CommitsNumberByJiraTicketsMetric,
#superclass : #UserJiraMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #ContributedProjectMetric,
#superclass : #UserCommitsMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#instVars : [
'maxCommitWindow'
],
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
2 changes: 1 addition & 1 deletion src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Class {
'users',
'anImporter'
],
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #import }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Class {
'user',
'names'
],
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #initialization }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #GLHUserCatalogueV2,
#superclass : #GLHUserCatalogue,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #import }
Expand Down
2 changes: 1 addition & 1 deletion src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Class {
'onProject',
'maxChildCommits'
],
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #analyze }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #JiraTimeMRTimeDifferenceMetric,
#superclass : #UserJiraMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #MergeRequestDurationMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #OpenedMergeRequestMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #PendingMergeRequestMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#instVars : [
'projectName'
],
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #accessing }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #ReviewedByUserMergeRequestMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #SelfMergedUnderAMinuteMergeRequestMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #TimeBetweenCommitMetric,
#superclass : #UserCommitsMetric,
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #calculating }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Class {
'username',
'email'
],
#category : 'GitLabHealth-Model-Analysis'
#category : #'GitLabHealth-Model-Analysis'
}

{ #category : #accessing }
Expand Down
2 changes: 1 addition & 1 deletion src/GitLabHealth-Model-Importer/GLHApiFile.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Class {
'name',
'type'
],
#category : 'GitLabHealth-Model-Importer'
#category : #'GitLabHealth-Model-Importer'
}

{ #category : #accessing }
Expand Down
12 changes: 5 additions & 7 deletions src/GitLabHealth-Model-Importer/GLHModelImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -424,20 +424,18 @@ GLHModelImporter >> importCommitsOfProject: aProject since: fromDate until: toDa
{ #category : #'import -projects' }
GLHModelImporter >> importContributedProjectsOfUser: aGLHUser [

| remaningProjects params results projects |
| remaningProjects params results projects projectsIds |
params := {
(#order_by -> 'last_activity_at').
(#simple -> 'true') } asDictionary.
results := self repoApi projects
contributedProjectsOfUser: aGLHUser id
withParams: params.

projects := (results collect: [ :projectsJson |
self parseArrayOfProject: projectsJson ]) flattened.
projects := self glhModel
addAll: projects
unless: self blockOnIdEquality.

projectsIds := (results collect: [ :projectsJson |
(NeoJSONReader fromString: projectsJson) collect: [:projectJson | projectJson at: #id ] ]) flattened.

projects := self importProjects: projectsIds.
remaningProjects := self importProjects:
((projects collect: #id) difference:
((self userCatalogue atId: aGLHUser id) at:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ GLPHModelImporter >> importProject: aProjectID [
| result projectResult |
('Import project with id: ' , aProjectID printString) recordInfo.

(glhModel allWithType: GLHProject)
detect: [ :project | project id = aProjectID ]
ifOne: [ :project | ^ project ].

result := self repoApi projects get: aProjectID.
projectResult := self parseProjectResult: result.

Expand Down

0 comments on commit 44f69e0

Please sign in to comment.