From ae211a75c208931d386113f83475f2c37ae11903 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Thu, 10 Oct 2024 13:36:07 +0200 Subject: [PATCH 1/5] renaming for consistencies; fix visu case of no commits --- .../BitBucketApiMock.class.st | 12 +++--- .../BitBucketApi.class.st | 12 +++--- .../BitBucketModelImporter.class.st | 41 ++++++++++--------- .../UserMetric.class.st | 1 + .../GLHModelImporter.class.st | 12 +++--- ...LHCommitDistributionVisualization.class.st | 3 +- ...LHProjectContributorVisualization.class.st | 2 +- .../GLPHModelImporter.class.st | 2 +- 8 files changed, 44 insertions(+), 41 deletions(-) diff --git a/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st b/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st index 687146b..006bd3a 100644 --- a/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st +++ b/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st @@ -11,7 +11,7 @@ Class { } { #category : #'api - pull-requests' } -BitBucketApiMock >> activitiesOfPullRequest: pullRequestId inRepo: repoSlug ofProject: projectKey [ +BitBucketApiMock >> activitiesOfPullRequest: pullRequestId inRepoProjectId: repoSlug ofProjectGroupId: projectKey [ ^self pullRequestActivities ] @@ -61,13 +61,13 @@ BitBucketApiMock >> commits: anObject [ ] { #category : #'api - pull-requests' } -BitBucketApiMock >> commitsOfPullRequest: mergeRequestId ofRepo: repoSlug inProject: projectKey [ +BitBucketApiMock >> commitsOfPullRequest: mergeRequestId ofRepoProjectId: repoSlug inProjectGroupId: projectKey [ ^commits ] { #category : #'api - projects' } -BitBucketApiMock >> commitsOfRepo: repositorySlug inProject: projectKey since: since until: until [ +BitBucketApiMock >> commitsOfRepoProjectId: repositorySlug inProjectGroupId: projectKey since: since until: until [ ^ self commits select: [ :commit | | commitDate | @@ -382,7 +382,7 @@ BitBucketApiMock >> diffs: anObject [ ] { #category : #'api - commits' } -BitBucketApiMock >> diffsOfCommit: commitID inRepo: repositorySlug inProject: projectKey [ +BitBucketApiMock >> diffsOfCommit: commitID inRepoProjectId: repositorySlug inProjectGroupId: projectKey [ ^diffs ] @@ -1078,13 +1078,13 @@ BitBucketApiMock >> pullRequestActivities [ ] { #category : #'api - pull-requests' } -BitBucketApiMock >> pullRequestsOfRepo: repoSlug inProject: projectKey since: since until: until [ +BitBucketApiMock >> pullRequestsOfRepoProjectId: repoSlug inProjectGroupId: projectKey since: since until: until [ ^ mergeRequests ] { #category : #'api - projects' } -BitBucketApiMock >> repositoriesOfProject: projectKey [ +BitBucketApiMock >> repositoryProjectsOfProjectGroupId: projectKey [ | repos | repos := '[ diff --git a/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st b/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st index b6a9726..f38fbd9 100644 --- a/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st +++ b/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st @@ -13,7 +13,7 @@ Class { } { #category : #'api - pull-requests' } -BitBucketApi >> activitiesOfPullRequest: pullRequestId inRepo: repositorySlug ofProject: projectKey [ +BitBucketApi >> activitiesOfPullRequest: pullRequestId inRepoProjectId: repositorySlug ofProjectGroupId: projectKey [ ^ self allValuesOfPath: self basePath , '/projects/' , projectKey , '/repos/' @@ -91,13 +91,13 @@ BitBucketApi >> client: anObject [ ] { #category : #'api - pull-requests' } -BitBucketApi >> commitsOfPullRequest: pullRequestId ofRepo: repoSlug inProject: projectKey [ +BitBucketApi >> commitsOfPullRequest: pullRequestId ofRepoProjectId: repoSlug inProjectGroupId: projectKey [ ^ self allValuesOfPath: self basePath, '/projects/', projectKey, '/repos/', repoSlug, '/pull-requests/', pullRequestId printString, '/commits'. ] { #category : #'api - commits' } -BitBucketApi >> commitsOfRepo: repositorySlug inProject: projectKey since: since until: until [ +BitBucketApi >> commitsOfRepoProjectId: repositorySlug inProjectGroupId: projectKey since: since until: until [ "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits" | results lastDate lastCommitterTimestamp commits | @@ -134,7 +134,7 @@ BitBucketApi >> commitsOfRepo: repositorySlug inProject: projectKey since: since ] { #category : #'api - commits' } -BitBucketApi >> diffsOfCommit: commitID inRepo: repositorySlug inProject: projectKey [ +BitBucketApi >> diffsOfCommit: commitID inRepoProjectId: repositorySlug inProjectGroupId: projectKey [ | results | self prepareZnClient. @@ -195,7 +195,7 @@ BitBucketApi >> projects [ ] { #category : #'api - pull-requests' } -BitBucketApi >> pullRequestsOfRepo: repositorySlug inProject: projectKey since: since until: until [ +BitBucketApi >> pullRequestsOfRepoProjectId: repositorySlug inProjectGroupId: projectKey since: since until: until [ | pullRequests results lastCommitterTimestamp lastDate | self prepareZnClient. @@ -231,7 +231,7 @@ BitBucketApi >> pullRequestsOfRepo: repositorySlug inProject: projectKey since: ] { #category : #'api - projects' } -BitBucketApi >> repositoriesOfProject: projectKey [ +BitBucketApi >> repositoryProjectsOfProjectGroupId: projectKey [ ^self allValuesOfPath: self basePath, '/projects/', projectKey, '/repos'. ] diff --git a/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st b/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st index 82e4013..0d77b6e 100644 --- a/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st +++ b/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st @@ -58,7 +58,7 @@ BitBucketModelImporter >> completeImportedCommit: aCommit [ { #category : #convert } BitBucketModelImporter >> convertBitBucketDiffToGitDiff: response [ - | bitbucketDiff gitDiff filePath fromHash toHash sourceLine sourceSpan destinationLine destinationSpan result| + | bitbucketDiff gitDiff filePath fromHash toHash sourceLine sourceSpan destinationLine destinationSpan result filePathSource filePathDestination | fromHash := (response at: 'fromHash') ifNil: '' . toHash := (response at: 'toHash') ifNil: ''. @@ -68,13 +68,14 @@ gitDiff := ''. result := (response at: #diffs) collect: [:diff | "Extract file path, hashes" - filePath := (diff at: 'source') at: 'toString'. + filePathSource := (diff at: 'source') ifNil: '' ifNotNil: [ :source | source at: 'toString' ] . + filePathDestination := (diff at: 'destination') ifNil: '' ifNotNil: [ :destination | destination at: 'toString' ]. "Build the diff header" " gitDiff := gitDiff , 'diff --git a/', filePath, ' b/', filePath, String cr." " gitDiff := gitDiff , 'index ', fromHash, '..', toHash, ' 100644', String cr." - gitDiff := gitDiff , '--- a/', filePath, String cr. - gitDiff := gitDiff , '+++ b/', filePath, String cr. + gitDiff := gitDiff , '--- a/', filePathSource, String cr. + gitDiff := gitDiff , '+++ b/', filePathDestination, String cr. "Iterate over hunks" (diff at: 'hunks') do: [:hunk | @@ -96,7 +97,7 @@ result := (response at: #diffs) collect: [:diff | ]. ]. ]. - GLHDiff new diffString: gitDiff; new_path: filePath; old_path: 'filePath'. + GLHDiff new diffString: gitDiff; old_path: filePathSource ;new_path: filePathDestination . ]. ^ result @@ -153,8 +154,8 @@ BitBucketModelImporter >> importCommitsOfProject: aGLHProject since: since until | commits | commits := self repoApi - commitsOfRepo: aGLHProject id - inProject: aGLHProject group id + commitsOfRepoProjectId: aGLHProject id + inProjectGroupId: aGLHProject group id since: since until: until. @@ -163,8 +164,8 @@ BitBucketModelImporter >> importCommitsOfProject: aGLHProject since: since until glhCommit := self parseCommitIntoGLHCommit: commit. commitDiffs := self repoApi diffsOfCommit: glhCommit id - inRepo: aGLHProject id - inProject: aGLHProject group id. + inRepoProjectId: aGLHProject id + inProjectGroupId: aGLHProject group id. contribution := self getContributionFromDiffs: (commitDiffs at: #diffs). @@ -187,15 +188,15 @@ BitBucketModelImporter >> importContributedProjectsOfUser: aGLHUser [ "get all repos of projects" repositories := projects flatCollect: [ :project | - self repoApi repositoriesOfProject: + self repoApi repositoryProjectsOfProjectGroupId: (project at: #key) ]. "get all commits of repo" repositoriesCommits := repositories collect: [ :repository | repository -> (self repoApi - commitsOfRepo: (repository at: #slug) - inProject: + commitsOfRepoProjectId: (repository at: #slug) + inProjectGroupId: ((repository at: #project) at: #key) since: DateAndTime now - 10 days until: DateAndTime now) ]. @@ -261,8 +262,8 @@ BitBucketModelImporter >> importDiffOfCommit: aCommit [ ('Import diff of commit: ' , aCommit short_id printString) recordInfo. result := self repoApi diffsOfCommit: aCommit id - inRepo: aCommit repository project id - inProject: aCommit repository project group id. + inRepoProjectId: aCommit repository project id + inProjectGroupId: aCommit repository project group id. diffsResult := self convertBitBucketDiffToGitDiff: result. @@ -281,8 +282,8 @@ BitBucketModelImporter >> importMergeRequestCommits: mergeRequest [ | commits | commits := self repoApi commitsOfPullRequest: mergeRequest id - ofRepo: mergeRequest project id - inProject: mergeRequest project group id. + ofRepoProjectId: mergeRequest project id + inProjectGroupId: mergeRequest project group id. commits := commits collect: [ :commit | self parseCommitIntoGLHCommit: commit ]. @@ -297,8 +298,8 @@ BitBucketModelImporter >> importMergeRequests: aGLHProject since: fromDate until | pullRequests | pullRequests := self repoApi - pullRequestsOfRepo: aGLHProject id - inProject: aGLHProject group id + pullRequestsOfRepoProjectId: aGLHProject id + inProjectGroupId: aGLHProject group id since: fromDate until: toDate. @@ -325,8 +326,8 @@ BitBucketModelImporter >> importMergeResquestMerger: mergeRequest [ activities := self repoApi activitiesOfPullRequest: mergeRequest id - inRepo: mergeRequest project id - ofProject: mergeRequest project group id. + inRepoProjectId: mergeRequest project id + ofProjectGroupId: mergeRequest project group id. mergeActivity := activities detect: [ :activity | (activity at: #action) = 'MERGED' ]. diff --git a/src/GitLabHealth-Model-Analysis/UserMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMetric.class.st index c420eec..a1bf502 100644 --- a/src/GitLabHealth-Model-Analysis/UserMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMetric.class.st @@ -165,6 +165,7 @@ UserMetric >> loadUserCommitsSince: since until: until [ UserMetric >> loadUserCompleteCommitsSince: since until: until [ | commits | + 1 halt. commits := self loadUserCommitsSince: since until: until. commits do: [ :commit | glhImporter completeImportedCommit: commit ]. ^ commits diff --git a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st index 349e695..58e4ae0 100644 --- a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st @@ -532,7 +532,7 @@ GLHModelImporter >> importContributedProjectsOfUser: aGLHUser [ page := page + 1. ('import contributed project of user ' , aGLHUser name , ' page ' , page printString) recordInfo. - results := self glhApi + results := self repoApi contributedProjectsOfUserId: aGLHUser id orderBy: 'last_activity_at' simple: true @@ -580,7 +580,7 @@ GLHModelImporter >> importDiffOfCommit: aCommit [ 'Diff already importer: ' , aCommit short_id printString recordInfo. ^ aCommit diffs ]. ('Import diff of commit: ' , aCommit short_id printString) recordInfo. - result := self glhApi + result := self repoApi commitDiff: aCommit id ofProject: aCommit repository project id unidiff: true. @@ -670,7 +670,7 @@ GLHModelImporter >> importLastestCommitsOfProject: aGLHProject [ "limited to the last 50 commits" | results parsedResults | - results := self glhApi + results := self repoApi commitsOfProject: aGLHProject id forRefName: nil since: nil @@ -790,7 +790,7 @@ GLHModelImporter >> importRepository: aGLHRepository [ ('import the repository of project ' , aGLHRepository project name) recordInfo. - resultBranches := self glhApi branchesOfRepository: + resultBranches := self repoApi branchesOfRepository: aGLHRepository project id. branches := self parseBranchesResult: resultBranches. @@ -819,7 +819,7 @@ GLHModelImporter >> importUser: aUserID [ detect: [ :user | user id = aUserID ] ifFound: [ :user | ^ user ]. ('Import user: ' , aUserID printString) recordInfo. - result := self glhApi user: aUserID. + result := self repoApi user: aUserID. userResult := self parseUserResult: result. ^ self glhModel add: userResult unless: self blockOnIdEquality ] @@ -1179,7 +1179,7 @@ GLHModelImporter >> pipelinesOf: aProjectID [ | result | ('Search pipelines of: ' , aProjectID printString) recordInfo. - result := self glhApi pipelinesOfProject: aProjectID. + result := self repoApi pipelinesOfProject: aProjectID. ^ self parsePipelinesResult: result . ] diff --git a/src/GitLabHealth-Model-Visualization/GLHCommitDistributionVisualization.class.st b/src/GitLabHealth-Model-Visualization/GLHCommitDistributionVisualization.class.st index f3b72a6..61ca65e 100644 --- a/src/GitLabHealth-Model-Visualization/GLHCommitDistributionVisualization.class.st +++ b/src/GitLabHealth-Model-Visualization/GLHCommitDistributionVisualization.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'groupCommitBlock' ], - #category : 'GitLabHealth-Model-Visualization' + #category : #'GitLabHealth-Model-Visualization' } { #category : #'instance creation' } @@ -12,6 +12,7 @@ GLHCommitDistributionVisualization >> forCommits: commits [ | c lb oldestCommit horizontal commitGroups groupToCommitByDate alreadyAdded dates | c := RSCompositeChart new. + commits ifEmpty: [ ^ c canvas]. oldestCommit := commits last. dates := (oldestCommit committed_date to: Date today) dates. diff --git a/src/GitLabHealth-Model-Visualization/GLHProjectContributorVisualization.class.st b/src/GitLabHealth-Model-Visualization/GLHProjectContributorVisualization.class.st index 0f8e933..45cdfd6 100644 --- a/src/GitLabHealth-Model-Visualization/GLHProjectContributorVisualization.class.st +++ b/src/GitLabHealth-Model-Visualization/GLHProjectContributorVisualization.class.st @@ -107,7 +107,7 @@ GLHProjectContributorVisualization >> forProject: aGLHProject [ | c shapes legend | c := RSCanvas new. - shapes := ((aGLHProject toScope: GLHCommit) collect: #commitCreator) asSet collect: [:author | self createShapeForUser: author ]. + shapes := ((aGLHProject toScope: GLHCommit) collect: #commitCreator) asSet reject: #isNil thenCollect: [:author | self createShapeForUser: author ]. " shapes add: (self createShapeForProject: aGLHProject )." c addAll: shapes. diff --git a/src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st b/src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st index e076b47..2668ae8 100644 --- a/src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st +++ b/src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st @@ -367,7 +367,7 @@ GLPHModelImporter >> importProject: aProjectID [ | result projectResult | ('Import project with id: ' , aProjectID printString) recordInfo. - result := self glhApi project: aProjectID. + result := self repoApi project: aProjectID. projectResult := self parseProjectResult: result. ^ self completeImportProject: projectResult From 5e7ee1901db710b507def94cb872b9f43e54c786 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Thu, 10 Oct 2024 13:53:29 +0200 Subject: [PATCH 2/5] fix author color in commit tree visu. renaming bitbucket api method --- .../BitBucketApiMock.class.st | 26 +++++++++---------- .../BitBucketApi.class.st | 2 +- .../GHApi.class.st | 2 +- .../GHModelImporter.class.st | 2 +- .../ClosedMergeRequestMetricTest.class.st | 14 +++++----- .../ClosedTicketsMetricTest.class.st | 2 +- .../CodeAdditionByTicketMetricTest.class.st | 6 ++--- .../CodeAdditionMetricTest.class.st | 4 +-- .../CodeDeletionByTicketMetricTest.class.st | 6 ++--- .../CodeDeletionMetricTest.class.st | 4 +-- .../CommentContributionMetricTest.class.st | 4 +-- .../CommitFrequencyMetricTest.class.st | 4 +-- ...mitsNumberByJiraTicketsMetricTest.class.st | 6 ++--- .../ContributedProjectMetricTest.class.st | 4 +-- ...iraTimeMRTimeDifferenceMetricTest.class.st | 10 +++---- .../MergeRequestDurationMetricTest.class.st | 4 +-- .../MergedMergeRequestMetricTest.class.st | 14 +++++----- .../OpenedMergeRequestMetricTest.class.st | 8 +++--- .../PendingMergeRequestMetricTest.class.st | 8 +++--- ...iewedByUserMergeRequestMetricTest.class.st | 8 +++--- ...nderAMinuteMergeRequestMetricTest.class.st | 6 ++--- .../TimeBetweenCommitMetricTest.class.st | 4 +-- .../GitMetricExporter.class.st | 2 +- .../UserMetric.class.st | 12 ++++----- .../GLHUser.extension.st | 4 +-- .../GLHApi.class.st | 2 +- .../GLHModelImporter.class.st | 6 ++--- src/GitLabHealth-Model/GLHJob.class.st | 14 +++++----- .../RSCommit.class.st | 15 ++++++----- 29 files changed, 102 insertions(+), 101 deletions(-) diff --git a/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st b/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st index 006bd3a..6bceff1 100644 --- a/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st +++ b/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st @@ -1156,7 +1156,19 @@ BitBucketApiMock >> user1 [ ] { #category : #accessing } -BitBucketApiMock >> user: accountId [ +BitBucketApiMock >> userMock [ + + ^ userMock +] + +{ #category : #accessing } +BitBucketApiMock >> userMock: anObject [ + + userMock := anObject +] + +{ #category : #accessing } +BitBucketApiMock >> userWithId: accountId [ | user | user := '{ @@ -1170,18 +1182,6 @@ BitBucketApiMock >> user: accountId [ ^ user ] -{ #category : #accessing } -BitBucketApiMock >> userMock [ - - ^ userMock -] - -{ #category : #accessing } -BitBucketApiMock >> userMock: anObject [ - - userMock := anObject -] - { #category : #'api - user' } BitBucketApiMock >> usersByUsername: username [ diff --git a/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st b/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st index f38fbd9..4e81481 100644 --- a/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st +++ b/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st @@ -236,7 +236,7 @@ BitBucketApi >> repositoryProjectsOfProjectGroupId: projectKey [ ] { #category : #'api - user' } -BitBucketApi >> user: accountId [ +BitBucketApi >> userWithId: accountId [ "https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-get" self prepareZnClient. diff --git a/src/GitHubHealth-Model-Importer/GHApi.class.st b/src/GitHubHealth-Model-Importer/GHApi.class.st index 10040e8..827ce1f 100644 --- a/src/GitHubHealth-Model-Importer/GHApi.class.st +++ b/src/GitHubHealth-Model-Importer/GHApi.class.st @@ -138,7 +138,7 @@ GHApi >> reposOfOrganization: anOrganizationName perPage: itemPerPage page: page ] { #category : #'api - users' } -GHApi >> user: aUserID [ +GHApi >> userWithId: aUserID [ ^ self client get: self baseAPIUrl , '/user/' , aUserID asString ] diff --git a/src/GitHubHealth-Model-Importer/GHModelImporter.class.st b/src/GitHubHealth-Model-Importer/GHModelImporter.class.st index c6dcfc0..79c01d0 100644 --- a/src/GitHubHealth-Model-Importer/GHModelImporter.class.st +++ b/src/GitHubHealth-Model-Importer/GHModelImporter.class.st @@ -246,7 +246,7 @@ GHModelImporter >> importUser: userID [ detect: [ :user | user id = userID ] ifFound: [ :user | ^ user ]. ('Import user: ' , userID printString) recordInfo. - result := self api user: userID. + result := self api userWithId: userID. userResult := self parseUserResult: result. ^ glhModel add: userResult diff --git a/src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st index 7442a8a..b1e52b3 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st @@ -32,7 +32,7 @@ ClosedMergeRequestMetricTest >> testCalculate [ closedMergeRequestMetric := ClosedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -75,7 +75,7 @@ ClosedMergeRequestMetricTest >> testCalculate1MRinPeriod2Outside [ closedMergeRequestMetric := ClosedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '07-28-2024' until: '08-03-2024'; @@ -118,7 +118,7 @@ ClosedMergeRequestMetricTest >> testCalculate3MR [ closedMergeRequestMetric := ClosedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -171,7 +171,7 @@ ClosedMergeRequestMetricTest >> testCalculate3MRClosed2Opened [ closedMergeRequestMetric := ClosedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -224,7 +224,7 @@ ClosedMergeRequestMetricTest >> testCalculateNoClosedMR [ closedMergeRequestMetric := ClosedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -250,7 +250,7 @@ ClosedMergeRequestMetricTest >> testCalculateNoMergeRequests [ glhImporter := GLPHImporterMock new. closedMergeRequestMetric := ClosedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -288,7 +288,7 @@ ClosedMergeRequestMetricTest >> testCalculateOutSidePeriod [ closedMergeRequestMetric := ClosedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '08-01-2024' until: '08-05-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st index 9d81b52..cd3d9e3 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st @@ -28,7 +28,7 @@ ClosedTicketsMetricTest >> testCalculate [ closedTicket := ClosedTicketsMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionByTicketMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionByTicketMetricTest.class.st index 159ea3c..a9cc0e8 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionByTicketMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionByTicketMetricTest.class.st @@ -43,7 +43,7 @@ CodeAdditionByTicketMetricTest >> testCalculate [ codeAddition := CodeAdditionByTicketMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -81,7 +81,7 @@ CodeAdditionByTicketMetricTest >> testCalculateNoCommits [ codeAddition := CodeAdditionByTicketMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -113,7 +113,7 @@ CodeAdditionByTicketMetricTest >> testCalculateNoMergeRequests [ codeAddition := CodeAdditionByTicketMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionMetricTest.class.st index bcc81e7..fb550ed 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionMetricTest.class.st @@ -32,7 +32,7 @@ CodeAdditionMetricTest >> testCalculate [ codeAddition := CodeAdditionMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. @@ -58,7 +58,7 @@ CodeAdditionMetricTest >> testCalculateNoCommits [ codeAddition := CodeAdditionMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. diff --git a/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionByTicketMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionByTicketMetricTest.class.st index dfa02e3..4cdd416 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionByTicketMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionByTicketMetricTest.class.st @@ -45,7 +45,7 @@ CodeDeletionByTicketMetricTest >> testCalculate [ codeAddition := CodeAdditionByTicketMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -82,7 +82,7 @@ CodeDeletionByTicketMetricTest >> testCalculateNoCommits [ codeAddition := CodeAdditionByTicketMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -114,7 +114,7 @@ CodeDeletionByTicketMetricTest >> testCalculateNoMergeRequests [ codeAddition := CodeAdditionByTicketMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionMetricTest.class.st index 5ce44b8..2800b5e 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionMetricTest.class.st @@ -32,7 +32,7 @@ CodeDeletionMetricTest >> testCalculate [ codeDeletion := CodeDeletionMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. @@ -58,7 +58,7 @@ CodeDeletionMetricTest >> testCalculateNoCommits [ codeDeletion := CodeDeletionMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. diff --git a/src/GitLabHealth-Model-Analysis-Tests/CommentContributionMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CommentContributionMetricTest.class.st index ba88554..01420f2 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CommentContributionMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CommentContributionMetricTest.class.st @@ -29,7 +29,7 @@ CommentContributionMetricTest >> testCalculate [ commentContribution := CommentContributionMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; @@ -55,7 +55,7 @@ CommentContributionMetricTest >> testCalculateNoCommits [ commentContribution := CommentContributionMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/CommitFrequencyMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CommitFrequencyMetricTest.class.st index 7fa1f1c..b5f6b67 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CommitFrequencyMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CommitFrequencyMetricTest.class.st @@ -21,7 +21,7 @@ CommitFrequencyMetricTest >> testCalculate [ commitFrequency := CommitFrequencyMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. @@ -47,7 +47,7 @@ CommitFrequencyMetricTest >> testCalculateNoCommits [ commitFrequency := CommitFrequencyMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. diff --git a/src/GitLabHealth-Model-Analysis-Tests/CommitsNumberByJiraTicketsMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CommitsNumberByJiraTicketsMetricTest.class.st index 2bbd598..116e80a 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CommitsNumberByJiraTicketsMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CommitsNumberByJiraTicketsMetricTest.class.st @@ -37,7 +37,7 @@ CommitsNumberByJiraTicketsMetricTest >> testCalculate [ commitsNumber := CommitsNumberByJiraTicketsMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -74,7 +74,7 @@ CommitsNumberByJiraTicketsMetricTest >> testCalculateNoCommits [ commitsNumber := CommitsNumberByJiraTicketsMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -106,7 +106,7 @@ CommitsNumberByJiraTicketsMetricTest >> testCalculateNoMergeRequests [ commitsNumber := CommitsNumberByJiraTicketsMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/ContributedProjectMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/ContributedProjectMetricTest.class.st index 59a2e0c..3930d5e 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/ContributedProjectMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/ContributedProjectMetricTest.class.st @@ -35,7 +35,7 @@ ContributedProjectMetricTest >> testCalculate [ contributedProject := ContributedProjectMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; @@ -63,7 +63,7 @@ ContributedProjectMetricTest >> testCalculateNoCommits [ contributedProject := ContributedProjectMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/JiraTimeMRTimeDifferenceMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/JiraTimeMRTimeDifferenceMetricTest.class.st index 4e80cb4..12b615a 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/JiraTimeMRTimeDifferenceMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/JiraTimeMRTimeDifferenceMetricTest.class.st @@ -37,7 +37,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculate [ jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' @@ -81,7 +81,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculate2PeriodWith1EmptyPeriod [ jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' @@ -111,7 +111,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculateNoMergeRequests [ jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' @@ -153,7 +153,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculateWithNoEstimatedTime [ jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' @@ -197,7 +197,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculateWithTimeOriginalEstimateAndNo jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - user: user; + userWithId: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' diff --git a/src/GitLabHealth-Model-Analysis-Tests/MergeRequestDurationMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/MergeRequestDurationMetricTest.class.st index e3b9d4b..504af2d 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/MergeRequestDurationMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/MergeRequestDurationMetricTest.class.st @@ -30,7 +30,7 @@ MergeRequestDurationMetricTest >> testCalculate [ mergeRequestDuration := MergeRequestDurationMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -56,7 +56,7 @@ MergeRequestDurationMetricTest >> testCalculateNoMergeRequests [ glhImporter := GLPHImporterMock new. mergeRequestDuration := MergeRequestDurationMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/MergedMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/MergedMergeRequestMetricTest.class.st index 54727d3..bc2a9e4 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/MergedMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/MergedMergeRequestMetricTest.class.st @@ -28,7 +28,7 @@ MergedMergeRequestMetricTest >> testCalculate [ mergedMergeRequest := MergedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -70,7 +70,7 @@ MergedMergeRequestMetricTest >> testCalculate1MRInPeriod1Outside [ mergedMergeRequest := MergedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -109,7 +109,7 @@ MergedMergeRequestMetricTest >> testCalculate1MROpenedButNotMerged [ mergedMergeRequest := MergedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -156,7 +156,7 @@ MergedMergeRequestMetricTest >> testCalculate2MROneForEachUser [ mergedMergeRequest := MergedMergeRequestMetric new - user: user1; + userWithId: user1; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -210,7 +210,7 @@ MergedMergeRequestMetricTest >> testCalculate3MROpenButMergedByOthers [ mergedMergeRequest := MergedMergeRequestMetric new - user: user1; + userWithId: user1; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -264,7 +264,7 @@ MergedMergeRequestMetricTest >> testCalculate3MROpenByOther [ mergedMergeRequest := MergedMergeRequestMetric new - user: user1; + userWithId: user1; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -292,7 +292,7 @@ MergedMergeRequestMetricTest >> testCalculateNoMergeRequests [ mergedMergeRequest := MergedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/OpenedMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/OpenedMergeRequestMetricTest.class.st index e649384..f1a481e 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/OpenedMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/OpenedMergeRequestMetricTest.class.st @@ -31,7 +31,7 @@ OpenedMergeRequestMetricTest >> testCalculate [ openedMergeRequest := OpenedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -76,7 +76,7 @@ OpenedMergeRequestMetricTest >> testCalculate1OpenedAnd2NotOpenedByUser [ openedMergeRequest := OpenedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -103,7 +103,7 @@ OpenedMergeRequestMetricTest >> testCalculateNoMergeRequests [ openedMergeRequest := OpenedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -145,7 +145,7 @@ OpenedMergeRequestMetricTest >> testCalculateNotOpenedByUser [ openedMergeRequest := OpenedMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/PendingMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/PendingMergeRequestMetricTest.class.st index b88c72f..95e2a59 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/PendingMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/PendingMergeRequestMetricTest.class.st @@ -30,7 +30,7 @@ PendingMergeRequestMetricTest >> testCalculate [ mergedMergeRequestPending := PendingMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -70,7 +70,7 @@ PendingMergeRequestMetricTest >> testCalculate1Pending1Closed [ mergedMergeRequestPending := PendingMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -116,7 +116,7 @@ PendingMergeRequestMetricTest >> testCalculate1PendingByUser [ mergedMergeRequestPending := PendingMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -162,7 +162,7 @@ PendingMergeRequestMetricTest >> testCalculate2Pending [ mergedMergeRequestPending := PendingMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/ReviewedByUserMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/ReviewedByUserMergeRequestMetricTest.class.st index d366be3..7cadbd2 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/ReviewedByUserMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/ReviewedByUserMergeRequestMetricTest.class.st @@ -38,7 +38,7 @@ ReviewedByUserMergeRequestMetricTest >> testCalculate [ mergeRequests := ReviewedByUserMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -67,7 +67,7 @@ ReviewedByUserMergeRequestMetricTest >> testCalculateNoMergeRequests [ mergeRequests := ReviewedByUserMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -106,7 +106,7 @@ ReviewedByUserMergeRequestMetricTest >> testCalculateReviewButNotCreated [ mergedMergeRequestWithoutReview := ReviewedByUserMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -151,7 +151,7 @@ ReviewedByUserMergeRequestMetricTest >> testCalculateReviewByOther [ mergedMergeRequestWithoutReview := ReviewedByUserMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/SelfMergedUnderAMinuteMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/SelfMergedUnderAMinuteMergeRequestMetricTest.class.st index f7b0444..c7de86c 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/SelfMergedUnderAMinuteMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/SelfMergedUnderAMinuteMergeRequestMetricTest.class.st @@ -34,7 +34,7 @@ SelfMergedUnderAMinuteMergeRequestMetricTest >> testCalculate [ mergedMergeRequestWithoutReview := SelfMergedUnderAMinuteMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -79,7 +79,7 @@ SelfMergedUnderAMinuteMergeRequestMetricTest >> testCalculateMergeButNotCreated mergedMergeRequestWithoutReview := SelfMergedUnderAMinuteMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -106,7 +106,7 @@ SelfMergedUnderAMinuteMergeRequestMetricTest >> testCalculateNoMergeRequests [ mergedMergeRequestWithoutReview := SelfMergedUnderAMinuteMergeRequestMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/TimeBetweenCommitMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/TimeBetweenCommitMetricTest.class.st index 9aacf50..8e8cc2b 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/TimeBetweenCommitMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/TimeBetweenCommitMetricTest.class.st @@ -34,7 +34,7 @@ TimeBetweenCommitMetricTest >> testCalculate [ timeBetweenCommit := TimeBetweenCommitMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -61,7 +61,7 @@ TimeBetweenCommitMetricTest >> testCalculateNoCommits [ timeBetweenCommit := TimeBetweenCommitMetric new - user: user; + userWithId: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st index e0f79fc..5bac488 100644 --- a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st +++ b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st @@ -374,7 +374,7 @@ GitMetricExporter >> generateUsersAnalysesDuringPeriod: period over: aDateWeekMo setPeriodSince: (period at: #since) until: (period at: #until); over: aDateWeekMonthOrYear; - user: user; + userWithId: user; emailDomain: emailDomain. diff --git a/src/GitLabHealth-Model-Analysis/UserMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMetric.class.st index a1bf502..c1853c4 100644 --- a/src/GitLabHealth-Model-Analysis/UserMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMetric.class.st @@ -237,15 +237,15 @@ UserMetric >> name [ ^ self subclassResponsibility ] -{ #category : #accessing } -UserMetric >> user: anObject [ - - user := anObject -] - { #category : #email } UserMetric >> userEmail [ ^ ('' join: { user username. emailDomain }) asLowercase ] + +{ #category : #accessing } +UserMetric >> userWithId: anObject [ + + user := anObject +] diff --git a/src/GitLabHealth-Model-Extension/GLHUser.extension.st b/src/GitLabHealth-Model-Extension/GLHUser.extension.st index 9d6e6c2..7c9886a 100644 --- a/src/GitLabHealth-Model-Extension/GLHUser.extension.st +++ b/src/GitLabHealth-Model-Extension/GLHUser.extension.st @@ -8,7 +8,7 @@ GLHUser >> computeCommitFrequencyOver: aDateWeekMonthOrYear [ a created_at < b created_at ]. ^ GitMetric4User new - user: self; + userWithId: self; glhImporter: GLHModelImporter current; itsProjects: (self commits collect: [ :c | c repository project id -> c repository project ]) asDictionary ; @@ -21,7 +21,7 @@ GLHUser >> computeCommitFrequencyOver: aDateWeekMonthOrYear [ GLHUser >> computeCommitFrequencySince: since until: until overA: aDateWeekMonthOrYear [ ^ GitMetric4User new - user: self; + userWithId: self; glhImporter: GLHModelImporter current; itsProjects: (self commits collect: [:c | (c repository project id) -> (c repository project) ]) asDictionary; commitFrequencySince: since diff --git a/src/GitLabHealth-Model-Importer/GLHApi.class.st b/src/GitLabHealth-Model-Importer/GLHApi.class.st index ba2eb22..57b1ded 100644 --- a/src/GitLabHealth-Model-Importer/GLHApi.class.st +++ b/src/GitLabHealth-Model-Importer/GLHApi.class.st @@ -526,7 +526,7 @@ GLHApi >> treeOfRepository: aProjectID ofBranch: aBranchRef andPath: aPath [ ] { #category : #api } -GLHApi >> user: aUserID [ +GLHApi >> userWithId: aUserID [ ^ self client get: self baseAPIUrl , '/users/' , aUserID printString ] diff --git a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st index 58e4ae0..f2646f9 100644 --- a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st @@ -677,7 +677,7 @@ GLHModelImporter >> importLastestCommitsOfProject: aGLHProject [ until: nil path: nil author: nil - all: nil + all: true with_stats: true firstParent: nil order: nil @@ -819,7 +819,7 @@ GLHModelImporter >> importUser: aUserID [ detect: [ :user | user id = aUserID ] ifFound: [ :user | ^ user ]. ('Import user: ' , aUserID printString) recordInfo. - result := self repoApi user: aUserID. + result := self repoApi userWithId: aUserID. userResult := self parseUserResult: result. ^ self glhModel add: userResult unless: self blockOnIdEquality ] @@ -1084,7 +1084,7 @@ GLHModelImporter >> parseJobsResult: result ofProject: aProject [ mapProperty: #user getter: [ :object | #ignore ] setter: [ :object :value | - object user: (self importUser: (value at: #id)) ]. + object userWithId: (self importUser: (value at: #id)) ]. mapping mapProperty: #commit diff --git a/src/GitLabHealth-Model/GLHJob.class.st b/src/GitLabHealth-Model/GLHJob.class.st index e597219..17d172c 100644 --- a/src/GitLabHealth-Model/GLHJob.class.st +++ b/src/GitLabHealth-Model/GLHJob.class.st @@ -148,13 +148,6 @@ GLHJob >> user [ ^ user ] -{ #category : #accessing } -GLHJob >> user: anObject [ - - - user := anObject -] - { #category : #navigation } GLHJob >> userGroup [ @@ -162,6 +155,13 @@ GLHJob >> userGroup [ ^ MooseSpecializedGroup with: self user ] +{ #category : #accessing } +GLHJob >> userWithId: anObject [ + + + user := anObject +] + { #category : #accessing } GLHJob >> web_url [ diff --git a/src/GitLabHealth-Visualization/RSCommit.class.st b/src/GitLabHealth-Visualization/RSCommit.class.st index 5637dac..02ecfd8 100644 --- a/src/GitLabHealth-Visualization/RSCommit.class.st +++ b/src/GitLabHealth-Visualization/RSCommit.class.st @@ -79,6 +79,7 @@ RSCommit >> buildCommitCompleteHierachyCanvas [ dic := Dictionary new. + churnAnalyzer := GitAnalyzer new fromCommit: aCommit; maxChildCommit: 50. @@ -111,13 +112,13 @@ RSCommit >> buildCommitCompleteHierachyCanvas [ allCommitShps do: [ :shp | | commit | commit := shp model. - commit commitCreator = commitShape first model commitCreator - ifTrue: [ - (shp children detect: [ :c | c class = RSBox ]) border: - (RSBorder new - width: 5; - color: self defaultColor; - yourself) ] ]. + commit author_name = aCommit author_name ifTrue: [ + + (shp children detect: [ :c | c class = RSBox ]) border: + (RSBorder new + width: 5; + color: self defaultColor; + yourself) ] ]. From 6d97827b813c94e7df45604bd708da78a63aa8b0 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Thu, 10 Oct 2024 14:10:17 +0200 Subject: [PATCH 3/5] using none deprecated method --- src/GitLabHealth-Model-Analysis/UserMetric.class.st | 2 +- src/GitLabHealth-Model-Importer/GLHModelImporter.class.st | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GitLabHealth-Model-Analysis/UserMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMetric.class.st index c1853c4..ff5d9f3 100644 --- a/src/GitLabHealth-Model-Analysis/UserMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMetric.class.st @@ -165,7 +165,7 @@ UserMetric >> loadUserCommitsSince: since until: until [ UserMetric >> loadUserCompleteCommitsSince: since until: until [ | commits | - 1 halt. + commits := self loadUserCommitsSince: since until: until. commits do: [ :commit | glhImporter completeImportedCommit: commit ]. ^ commits diff --git a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st index f2646f9..8376d7a 100644 --- a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st @@ -840,7 +840,7 @@ GLHModelImporter >> importUserByUsername: anUsername [ | result userId searchResult | ('Import user with username: ' , anUsername printString) recordInfo. - result := self glhApi usersSearchByUsername: + result := self repoApi usersSearchByUsername: anUsername. searchResult := NeoJSONReader fromString: result. From 31cd73f2bcfeac999c9a11bbfbf51d380356ccdd Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Thu, 10 Oct 2024 15:56:48 +0200 Subject: [PATCH 4/5] revert user: renaming; fixing on commit diff parsing --- .../BitBucketApiMock.class.st | 26 ++--- .../BitBucketApi.class.st | 4 +- .../BitBucketModelImporter.class.st | 103 ++++++++++-------- .../GHApi.class.st | 2 +- .../GHModelImporter.class.st | 2 +- .../ClosedMergeRequestMetricTest.class.st | 14 +-- .../ClosedTicketsMetricTest.class.st | 2 +- .../CodeAdditionByTicketMetricTest.class.st | 6 +- .../CodeAdditionMetricTest.class.st | 4 +- .../CodeDeletionByTicketMetricTest.class.st | 6 +- .../CodeDeletionMetricTest.class.st | 4 +- .../CommentContributionMetricTest.class.st | 4 +- .../CommitFrequencyMetricTest.class.st | 4 +- ...mitsNumberByJiraTicketsMetricTest.class.st | 6 +- .../ContributedProjectMetricTest.class.st | 4 +- ...iraTimeMRTimeDifferenceMetricTest.class.st | 10 +- .../MergeRequestDurationMetricTest.class.st | 4 +- .../MergedMergeRequestMetricTest.class.st | 14 +-- .../OpenedMergeRequestMetricTest.class.st | 8 +- .../PendingMergeRequestMetricTest.class.st | 8 +- ...iewedByUserMergeRequestMetricTest.class.st | 8 +- ...nderAMinuteMergeRequestMetricTest.class.st | 6 +- .../TimeBetweenCommitMetricTest.class.st | 4 +- .../GitMetricExporter.class.st | 2 +- .../UserMetric.class.st | 14 +-- .../GLHUser.extension.st | 4 +- .../GLHApi.class.st | 2 +- .../GLHModelImporter.class.st | 14 ++- src/GitLabHealth-Model/GLHJob.class.st | 14 +-- .../RSCommit.class.st | 15 ++- 30 files changed, 168 insertions(+), 150 deletions(-) diff --git a/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st b/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st index 6bceff1..006bd3a 100644 --- a/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st +++ b/src/BitBucketHealth-Model-Importer-Tests/BitBucketApiMock.class.st @@ -1156,19 +1156,7 @@ BitBucketApiMock >> user1 [ ] { #category : #accessing } -BitBucketApiMock >> userMock [ - - ^ userMock -] - -{ #category : #accessing } -BitBucketApiMock >> userMock: anObject [ - - userMock := anObject -] - -{ #category : #accessing } -BitBucketApiMock >> userWithId: accountId [ +BitBucketApiMock >> user: accountId [ | user | user := '{ @@ -1182,6 +1170,18 @@ BitBucketApiMock >> userWithId: accountId [ ^ user ] +{ #category : #accessing } +BitBucketApiMock >> userMock [ + + ^ userMock +] + +{ #category : #accessing } +BitBucketApiMock >> userMock: anObject [ + + userMock := anObject +] + { #category : #'api - user' } BitBucketApiMock >> usersByUsername: username [ diff --git a/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st b/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st index 4e81481..bde9b12 100644 --- a/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st +++ b/src/BitBucketHealth-Model-Importer/BitBucketApi.class.st @@ -105,7 +105,7 @@ BitBucketApi >> commitsOfRepoProjectId: repositorySlug inProjectGroupId: project self client path: self basePath , '/projects/' , projectKey , '/repos/' , repositorySlug , '/commits'. - self client queryAt: 'merges' put: 'exclude'. + "self client queryAt: 'merges' put: 'exclude'." commits := OrderedCollection new. @@ -236,7 +236,7 @@ BitBucketApi >> repositoryProjectsOfProjectGroupId: projectKey [ ] { #category : #'api - user' } -BitBucketApi >> userWithId: accountId [ +BitBucketApi >> user: accountId [ "https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-get" self prepareZnClient. diff --git a/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st b/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st index 0d77b6e..8dad277 100644 --- a/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st +++ b/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st @@ -57,51 +57,66 @@ BitBucketModelImporter >> completeImportedCommit: aCommit [ ] { #category : #convert } -BitBucketModelImporter >> convertBitBucketDiffToGitDiff: response [ - | bitbucketDiff gitDiff filePath fromHash toHash sourceLine sourceSpan destinationLine destinationSpan result filePathSource filePathDestination | - - fromHash := (response at: 'fromHash') ifNil: '' . - toHash := (response at: 'toHash') ifNil: ''. - -gitDiff := ''. -"Iterate over each diff in 'diffs'" -result := (response at: #diffs) collect: [:diff | - - "Extract file path, hashes" - filePathSource := (diff at: 'source') ifNil: '' ifNotNil: [ :source | source at: 'toString' ] . - filePathDestination := (diff at: 'destination') ifNil: '' ifNotNil: [ :destination | destination at: 'toString' ]. - - "Build the diff header" - " gitDiff := gitDiff , 'diff --git a/', filePath, ' b/', filePath, String cr." - " gitDiff := gitDiff , 'index ', fromHash, '..', toHash, ' 100644', String cr." - gitDiff := gitDiff , '--- a/', filePathSource, String cr. - gitDiff := gitDiff , '+++ b/', filePathDestination, String cr. - - "Iterate over hunks" - (diff at: 'hunks') do: [:hunk | - sourceLine := hunk at: 'sourceLine'. - sourceSpan := hunk at: 'sourceSpan'. - destinationLine := hunk at: 'destinationLine'. - destinationSpan := hunk at: 'destinationSpan'. - - "Hunk header" - gitDiff := gitDiff , ('@@ -{1},{2} +{3},{4} @@' format: { sourceLine. sourceSpan. destinationLine. destinationSpan }), String cr. - - "Iterate over segments" - (hunk at: 'segments') do: [:segment | - (segment at: 'lines') do: [:line | - (segment at: 'type') = 'REMOVED' - ifTrue: [ gitDiff := gitDiff , '-', (line at: 'line'), String cr ]. - (segment at: 'type') = 'ADDED' - ifTrue: [ gitDiff := gitDiff , '+', (line at: 'line'), String cr ]. - ]. - ]. - ]. - GLHDiff new diffString: gitDiff; old_path: filePathSource ;new_path: filePathDestination . -]. - - ^ result +BitBucketModelImporter >> convertBitBucketDiffToGitDiff: response [ + | bitbucketDiff filePath fromHash toHash sourceLine sourceSpan destinationLine destinationSpan result filePathSource filePathDestination | + fromHash := (response at: 'fromHash') ifNil: ''. + toHash := (response at: 'toHash') ifNil: ''. + + + "Iterate over each diff in 'diffs'" + result := (response at: #diffs) collect: [ :diff | "Extract file path, hashes" + |gitDiff| + gitDiff := ''. + filePathSource := (diff at: 'source') + ifNil: '' + ifNotNil: [ :source | + source at: 'toString' ]. + filePathDestination := (diff at: 'destination') + ifNil: '' + ifNotNil: [ :destination | + destination at: 'toString' ]. + + "Build the diff header" + " gitDiff := gitDiff , 'diff --git a/', filePath, ' b/', filePath, String cr." + " gitDiff := gitDiff , 'index ', fromHash, '..', toHash, ' 100644', String cr." + gitDiff := gitDiff , '--- a/' , filePathSource , String cr. + gitDiff := gitDiff , '+++ b/' , filePathDestination + , String cr. + + "Iterate over hunks" + (diff at: 'hunks') do: [ :hunk | + sourceLine := hunk at: 'sourceLine'. + sourceSpan := hunk at: 'sourceSpan'. + destinationLine := hunk at: 'destinationLine'. + destinationSpan := hunk at: 'destinationSpan'. + + "Hunk header" + gitDiff := gitDiff + , ('@@ -{1},{2} +{3},{4} @@' format: { + sourceLine. + sourceSpan. + destinationLine. + destinationSpan }) , String cr. + + "Iterate over segments" + (hunk at: 'segments') do: [ :segment | + (segment at: 'lines') do: [ :line | + (segment at: 'type') = 'CONTEXT' ifTrue: [ + gitDiff := gitDiff , (line at: 'line') + , String cr ]. + (segment at: 'type') = 'REMOVED' ifTrue: [ + gitDiff := gitDiff , '-' , (line at: 'line') + , String cr ]. + (segment at: 'type') = 'ADDED' ifTrue: [ + gitDiff := gitDiff , '+' , (line at: 'line') + , String cr ] ] ] ]. + GLHDiff new + diffString: gitDiff; + old_path: filePathSource; + new_path: filePathDestination ]. + + ^ result ] { #category : #'private - api' } diff --git a/src/GitHubHealth-Model-Importer/GHApi.class.st b/src/GitHubHealth-Model-Importer/GHApi.class.st index 827ce1f..10040e8 100644 --- a/src/GitHubHealth-Model-Importer/GHApi.class.st +++ b/src/GitHubHealth-Model-Importer/GHApi.class.st @@ -138,7 +138,7 @@ GHApi >> reposOfOrganization: anOrganizationName perPage: itemPerPage page: page ] { #category : #'api - users' } -GHApi >> userWithId: aUserID [ +GHApi >> user: aUserID [ ^ self client get: self baseAPIUrl , '/user/' , aUserID asString ] diff --git a/src/GitHubHealth-Model-Importer/GHModelImporter.class.st b/src/GitHubHealth-Model-Importer/GHModelImporter.class.st index 79c01d0..c6dcfc0 100644 --- a/src/GitHubHealth-Model-Importer/GHModelImporter.class.st +++ b/src/GitHubHealth-Model-Importer/GHModelImporter.class.st @@ -246,7 +246,7 @@ GHModelImporter >> importUser: userID [ detect: [ :user | user id = userID ] ifFound: [ :user | ^ user ]. ('Import user: ' , userID printString) recordInfo. - result := self api userWithId: userID. + result := self api user: userID. userResult := self parseUserResult: result. ^ glhModel add: userResult diff --git a/src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st index b1e52b3..7442a8a 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st @@ -32,7 +32,7 @@ ClosedMergeRequestMetricTest >> testCalculate [ closedMergeRequestMetric := ClosedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -75,7 +75,7 @@ ClosedMergeRequestMetricTest >> testCalculate1MRinPeriod2Outside [ closedMergeRequestMetric := ClosedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '07-28-2024' until: '08-03-2024'; @@ -118,7 +118,7 @@ ClosedMergeRequestMetricTest >> testCalculate3MR [ closedMergeRequestMetric := ClosedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -171,7 +171,7 @@ ClosedMergeRequestMetricTest >> testCalculate3MRClosed2Opened [ closedMergeRequestMetric := ClosedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -224,7 +224,7 @@ ClosedMergeRequestMetricTest >> testCalculateNoClosedMR [ closedMergeRequestMetric := ClosedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -250,7 +250,7 @@ ClosedMergeRequestMetricTest >> testCalculateNoMergeRequests [ glhImporter := GLPHImporterMock new. closedMergeRequestMetric := ClosedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -288,7 +288,7 @@ ClosedMergeRequestMetricTest >> testCalculateOutSidePeriod [ closedMergeRequestMetric := ClosedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '08-01-2024' until: '08-05-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st index cd3d9e3..9d81b52 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st @@ -28,7 +28,7 @@ ClosedTicketsMetricTest >> testCalculate [ closedTicket := ClosedTicketsMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionByTicketMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionByTicketMetricTest.class.st index a9cc0e8..159ea3c 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionByTicketMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionByTicketMetricTest.class.st @@ -43,7 +43,7 @@ CodeAdditionByTicketMetricTest >> testCalculate [ codeAddition := CodeAdditionByTicketMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -81,7 +81,7 @@ CodeAdditionByTicketMetricTest >> testCalculateNoCommits [ codeAddition := CodeAdditionByTicketMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -113,7 +113,7 @@ CodeAdditionByTicketMetricTest >> testCalculateNoMergeRequests [ codeAddition := CodeAdditionByTicketMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionMetricTest.class.st index fb550ed..bcc81e7 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CodeAdditionMetricTest.class.st @@ -32,7 +32,7 @@ CodeAdditionMetricTest >> testCalculate [ codeAddition := CodeAdditionMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. @@ -58,7 +58,7 @@ CodeAdditionMetricTest >> testCalculateNoCommits [ codeAddition := CodeAdditionMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. diff --git a/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionByTicketMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionByTicketMetricTest.class.st index 4cdd416..dfa02e3 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionByTicketMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionByTicketMetricTest.class.st @@ -45,7 +45,7 @@ CodeDeletionByTicketMetricTest >> testCalculate [ codeAddition := CodeAdditionByTicketMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -82,7 +82,7 @@ CodeDeletionByTicketMetricTest >> testCalculateNoCommits [ codeAddition := CodeAdditionByTicketMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -114,7 +114,7 @@ CodeDeletionByTicketMetricTest >> testCalculateNoMergeRequests [ codeAddition := CodeAdditionByTicketMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionMetricTest.class.st index 2800b5e..5ce44b8 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CodeDeletionMetricTest.class.st @@ -32,7 +32,7 @@ CodeDeletionMetricTest >> testCalculate [ codeDeletion := CodeDeletionMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. @@ -58,7 +58,7 @@ CodeDeletionMetricTest >> testCalculateNoCommits [ codeDeletion := CodeDeletionMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. diff --git a/src/GitLabHealth-Model-Analysis-Tests/CommentContributionMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CommentContributionMetricTest.class.st index 01420f2..ba88554 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CommentContributionMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CommentContributionMetricTest.class.st @@ -29,7 +29,7 @@ CommentContributionMetricTest >> testCalculate [ commentContribution := CommentContributionMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; @@ -55,7 +55,7 @@ CommentContributionMetricTest >> testCalculateNoCommits [ commentContribution := CommentContributionMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/CommitFrequencyMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CommitFrequencyMetricTest.class.st index b5f6b67..7fa1f1c 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CommitFrequencyMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CommitFrequencyMetricTest.class.st @@ -21,7 +21,7 @@ CommitFrequencyMetricTest >> testCalculate [ commitFrequency := CommitFrequencyMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. @@ -47,7 +47,7 @@ CommitFrequencyMetricTest >> testCalculateNoCommits [ commitFrequency := CommitFrequencyMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; over: Week. diff --git a/src/GitLabHealth-Model-Analysis-Tests/CommitsNumberByJiraTicketsMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/CommitsNumberByJiraTicketsMetricTest.class.st index 116e80a..2bbd598 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/CommitsNumberByJiraTicketsMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/CommitsNumberByJiraTicketsMetricTest.class.st @@ -37,7 +37,7 @@ CommitsNumberByJiraTicketsMetricTest >> testCalculate [ commitsNumber := CommitsNumberByJiraTicketsMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -74,7 +74,7 @@ CommitsNumberByJiraTicketsMetricTest >> testCalculateNoCommits [ commitsNumber := CommitsNumberByJiraTicketsMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -106,7 +106,7 @@ CommitsNumberByJiraTicketsMetricTest >> testCalculateNoMergeRequests [ commitsNumber := CommitsNumberByJiraTicketsMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/ContributedProjectMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/ContributedProjectMetricTest.class.st index 3930d5e..59a2e0c 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/ContributedProjectMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/ContributedProjectMetricTest.class.st @@ -35,7 +35,7 @@ ContributedProjectMetricTest >> testCalculate [ contributedProject := ContributedProjectMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; @@ -63,7 +63,7 @@ ContributedProjectMetricTest >> testCalculateNoCommits [ contributedProject := ContributedProjectMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '04-09-2024' until: '04-09-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/JiraTimeMRTimeDifferenceMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/JiraTimeMRTimeDifferenceMetricTest.class.st index 12b615a..4e80cb4 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/JiraTimeMRTimeDifferenceMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/JiraTimeMRTimeDifferenceMetricTest.class.st @@ -37,7 +37,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculate [ jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' @@ -81,7 +81,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculate2PeriodWith1EmptyPeriod [ jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' @@ -111,7 +111,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculateNoMergeRequests [ jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' @@ -153,7 +153,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculateWithNoEstimatedTime [ jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' @@ -197,7 +197,7 @@ JiraTimeMRTimeDifferenceMetricTest >> testCalculateWithTimeOriginalEstimateAndNo jiraMRDifference := JiraTimeMRTimeDifferenceMetric new - userWithId: user; + user: user; glhImporter: glhImporter; jiraImporter: jiraImporter; setPeriodSince: '09-04-2024' diff --git a/src/GitLabHealth-Model-Analysis-Tests/MergeRequestDurationMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/MergeRequestDurationMetricTest.class.st index 504af2d..e3b9d4b 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/MergeRequestDurationMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/MergeRequestDurationMetricTest.class.st @@ -30,7 +30,7 @@ MergeRequestDurationMetricTest >> testCalculate [ mergeRequestDuration := MergeRequestDurationMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -56,7 +56,7 @@ MergeRequestDurationMetricTest >> testCalculateNoMergeRequests [ glhImporter := GLPHImporterMock new. mergeRequestDuration := MergeRequestDurationMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/MergedMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/MergedMergeRequestMetricTest.class.st index bc2a9e4..54727d3 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/MergedMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/MergedMergeRequestMetricTest.class.st @@ -28,7 +28,7 @@ MergedMergeRequestMetricTest >> testCalculate [ mergedMergeRequest := MergedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -70,7 +70,7 @@ MergedMergeRequestMetricTest >> testCalculate1MRInPeriod1Outside [ mergedMergeRequest := MergedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -109,7 +109,7 @@ MergedMergeRequestMetricTest >> testCalculate1MROpenedButNotMerged [ mergedMergeRequest := MergedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -156,7 +156,7 @@ MergedMergeRequestMetricTest >> testCalculate2MROneForEachUser [ mergedMergeRequest := MergedMergeRequestMetric new - userWithId: user1; + user: user1; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -210,7 +210,7 @@ MergedMergeRequestMetricTest >> testCalculate3MROpenButMergedByOthers [ mergedMergeRequest := MergedMergeRequestMetric new - userWithId: user1; + user: user1; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -264,7 +264,7 @@ MergedMergeRequestMetricTest >> testCalculate3MROpenByOther [ mergedMergeRequest := MergedMergeRequestMetric new - userWithId: user1; + user: user1; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -292,7 +292,7 @@ MergedMergeRequestMetricTest >> testCalculateNoMergeRequests [ mergedMergeRequest := MergedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/OpenedMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/OpenedMergeRequestMetricTest.class.st index f1a481e..e649384 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/OpenedMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/OpenedMergeRequestMetricTest.class.st @@ -31,7 +31,7 @@ OpenedMergeRequestMetricTest >> testCalculate [ openedMergeRequest := OpenedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -76,7 +76,7 @@ OpenedMergeRequestMetricTest >> testCalculate1OpenedAnd2NotOpenedByUser [ openedMergeRequest := OpenedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -103,7 +103,7 @@ OpenedMergeRequestMetricTest >> testCalculateNoMergeRequests [ openedMergeRequest := OpenedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -145,7 +145,7 @@ OpenedMergeRequestMetricTest >> testCalculateNotOpenedByUser [ openedMergeRequest := OpenedMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/PendingMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/PendingMergeRequestMetricTest.class.st index 95e2a59..b88c72f 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/PendingMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/PendingMergeRequestMetricTest.class.st @@ -30,7 +30,7 @@ PendingMergeRequestMetricTest >> testCalculate [ mergedMergeRequestPending := PendingMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -70,7 +70,7 @@ PendingMergeRequestMetricTest >> testCalculate1Pending1Closed [ mergedMergeRequestPending := PendingMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -116,7 +116,7 @@ PendingMergeRequestMetricTest >> testCalculate1PendingByUser [ mergedMergeRequestPending := PendingMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; @@ -162,7 +162,7 @@ PendingMergeRequestMetricTest >> testCalculate2Pending [ mergedMergeRequestPending := PendingMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-01-2024' until: '09-07-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/ReviewedByUserMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/ReviewedByUserMergeRequestMetricTest.class.st index 7cadbd2..d366be3 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/ReviewedByUserMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/ReviewedByUserMergeRequestMetricTest.class.st @@ -38,7 +38,7 @@ ReviewedByUserMergeRequestMetricTest >> testCalculate [ mergeRequests := ReviewedByUserMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -67,7 +67,7 @@ ReviewedByUserMergeRequestMetricTest >> testCalculateNoMergeRequests [ mergeRequests := ReviewedByUserMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -106,7 +106,7 @@ ReviewedByUserMergeRequestMetricTest >> testCalculateReviewButNotCreated [ mergedMergeRequestWithoutReview := ReviewedByUserMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -151,7 +151,7 @@ ReviewedByUserMergeRequestMetricTest >> testCalculateReviewByOther [ mergedMergeRequestWithoutReview := ReviewedByUserMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/SelfMergedUnderAMinuteMergeRequestMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/SelfMergedUnderAMinuteMergeRequestMetricTest.class.st index c7de86c..f7b0444 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/SelfMergedUnderAMinuteMergeRequestMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/SelfMergedUnderAMinuteMergeRequestMetricTest.class.st @@ -34,7 +34,7 @@ SelfMergedUnderAMinuteMergeRequestMetricTest >> testCalculate [ mergedMergeRequestWithoutReview := SelfMergedUnderAMinuteMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -79,7 +79,7 @@ SelfMergedUnderAMinuteMergeRequestMetricTest >> testCalculateMergeButNotCreated mergedMergeRequestWithoutReview := SelfMergedUnderAMinuteMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -106,7 +106,7 @@ SelfMergedUnderAMinuteMergeRequestMetricTest >> testCalculateNoMergeRequests [ mergedMergeRequestWithoutReview := SelfMergedUnderAMinuteMergeRequestMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis-Tests/TimeBetweenCommitMetricTest.class.st b/src/GitLabHealth-Model-Analysis-Tests/TimeBetweenCommitMetricTest.class.st index 8e8cc2b..9aacf50 100644 --- a/src/GitLabHealth-Model-Analysis-Tests/TimeBetweenCommitMetricTest.class.st +++ b/src/GitLabHealth-Model-Analysis-Tests/TimeBetweenCommitMetricTest.class.st @@ -34,7 +34,7 @@ TimeBetweenCommitMetricTest >> testCalculate [ timeBetweenCommit := TimeBetweenCommitMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; @@ -61,7 +61,7 @@ TimeBetweenCommitMetricTest >> testCalculateNoCommits [ timeBetweenCommit := TimeBetweenCommitMetric new - userWithId: user; + user: user; glhImporter: glhImporter; setPeriodSince: '09-04-2024' until: '09-04-2024'; diff --git a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st index 5bac488..e0f79fc 100644 --- a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st +++ b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st @@ -374,7 +374,7 @@ GitMetricExporter >> generateUsersAnalysesDuringPeriod: period over: aDateWeekMo setPeriodSince: (period at: #since) until: (period at: #until); over: aDateWeekMonthOrYear; - userWithId: user; + user: user; emailDomain: emailDomain. diff --git a/src/GitLabHealth-Model-Analysis/UserMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMetric.class.st index ff5d9f3..a1bf502 100644 --- a/src/GitLabHealth-Model-Analysis/UserMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMetric.class.st @@ -165,7 +165,7 @@ UserMetric >> loadUserCommitsSince: since until: until [ UserMetric >> loadUserCompleteCommitsSince: since until: until [ | commits | - + 1 halt. commits := self loadUserCommitsSince: since until: until. commits do: [ :commit | glhImporter completeImportedCommit: commit ]. ^ commits @@ -237,15 +237,15 @@ UserMetric >> name [ ^ self subclassResponsibility ] +{ #category : #accessing } +UserMetric >> user: anObject [ + + user := anObject +] + { #category : #email } UserMetric >> userEmail [ ^ ('' join: { user username. emailDomain }) asLowercase ] - -{ #category : #accessing } -UserMetric >> userWithId: anObject [ - - user := anObject -] diff --git a/src/GitLabHealth-Model-Extension/GLHUser.extension.st b/src/GitLabHealth-Model-Extension/GLHUser.extension.st index 7c9886a..9d6e6c2 100644 --- a/src/GitLabHealth-Model-Extension/GLHUser.extension.st +++ b/src/GitLabHealth-Model-Extension/GLHUser.extension.st @@ -8,7 +8,7 @@ GLHUser >> computeCommitFrequencyOver: aDateWeekMonthOrYear [ a created_at < b created_at ]. ^ GitMetric4User new - userWithId: self; + user: self; glhImporter: GLHModelImporter current; itsProjects: (self commits collect: [ :c | c repository project id -> c repository project ]) asDictionary ; @@ -21,7 +21,7 @@ GLHUser >> computeCommitFrequencyOver: aDateWeekMonthOrYear [ GLHUser >> computeCommitFrequencySince: since until: until overA: aDateWeekMonthOrYear [ ^ GitMetric4User new - userWithId: self; + user: self; glhImporter: GLHModelImporter current; itsProjects: (self commits collect: [:c | (c repository project id) -> (c repository project) ]) asDictionary; commitFrequencySince: since diff --git a/src/GitLabHealth-Model-Importer/GLHApi.class.st b/src/GitLabHealth-Model-Importer/GLHApi.class.st index 57b1ded..ba2eb22 100644 --- a/src/GitLabHealth-Model-Importer/GLHApi.class.st +++ b/src/GitLabHealth-Model-Importer/GLHApi.class.st @@ -526,7 +526,7 @@ GLHApi >> treeOfRepository: aProjectID ofBranch: aBranchRef andPath: aPath [ ] { #category : #api } -GLHApi >> userWithId: aUserID [ +GLHApi >> user: aUserID [ ^ self client get: self baseAPIUrl , '/users/' , aUserID printString ] diff --git a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st index 8376d7a..34e1d62 100644 --- a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st @@ -685,9 +685,13 @@ GLHModelImporter >> importLastestCommitsOfProject: aGLHProject [ perPage: 50 page: nil. parsedResults := self parseCommitsResult: results. - parsedResults := self glhModel addAll: parsedResults unless: self blockOnIdEquality. + parsedResults := self glhModel + addAll: parsedResults + unless: self blockOnIdEquality. - aGLHProject repository commits addAll: parsedResults unless: self blockOnIdEquality. + aGLHProject repository commits + addAll: parsedResults + unless: self blockOnIdEquality. "parsedResults do: [ :commit | commit repository: aGLHProject repository ]." @@ -819,7 +823,7 @@ GLHModelImporter >> importUser: aUserID [ detect: [ :user | user id = aUserID ] ifFound: [ :user | ^ user ]. ('Import user: ' , aUserID printString) recordInfo. - result := self repoApi userWithId: aUserID. + result := self repoApi user: aUserID. userResult := self parseUserResult: result. ^ self glhModel add: userResult unless: self blockOnIdEquality ] @@ -840,7 +844,7 @@ GLHModelImporter >> importUserByUsername: anUsername [ | result userId searchResult | ('Import user with username: ' , anUsername printString) recordInfo. - result := self repoApi usersSearchByUsername: + result := self glhApi usersSearchByUsername: anUsername. searchResult := NeoJSONReader fromString: result. @@ -1084,7 +1088,7 @@ GLHModelImporter >> parseJobsResult: result ofProject: aProject [ mapProperty: #user getter: [ :object | #ignore ] setter: [ :object :value | - object userWithId: (self importUser: (value at: #id)) ]. + object user: (self importUser: (value at: #id)) ]. mapping mapProperty: #commit diff --git a/src/GitLabHealth-Model/GLHJob.class.st b/src/GitLabHealth-Model/GLHJob.class.st index 17d172c..e597219 100644 --- a/src/GitLabHealth-Model/GLHJob.class.st +++ b/src/GitLabHealth-Model/GLHJob.class.st @@ -148,6 +148,13 @@ GLHJob >> user [ ^ user ] +{ #category : #accessing } +GLHJob >> user: anObject [ + + + user := anObject +] + { #category : #navigation } GLHJob >> userGroup [ @@ -155,13 +162,6 @@ GLHJob >> userGroup [ ^ MooseSpecializedGroup with: self user ] -{ #category : #accessing } -GLHJob >> userWithId: anObject [ - - - user := anObject -] - { #category : #accessing } GLHJob >> web_url [ diff --git a/src/GitLabHealth-Visualization/RSCommit.class.st b/src/GitLabHealth-Visualization/RSCommit.class.st index 02ecfd8..5637dac 100644 --- a/src/GitLabHealth-Visualization/RSCommit.class.st +++ b/src/GitLabHealth-Visualization/RSCommit.class.st @@ -79,7 +79,6 @@ RSCommit >> buildCommitCompleteHierachyCanvas [ dic := Dictionary new. - churnAnalyzer := GitAnalyzer new fromCommit: aCommit; maxChildCommit: 50. @@ -112,13 +111,13 @@ RSCommit >> buildCommitCompleteHierachyCanvas [ allCommitShps do: [ :shp | | commit | commit := shp model. - commit author_name = aCommit author_name ifTrue: [ - - (shp children detect: [ :c | c class = RSBox ]) border: - (RSBorder new - width: 5; - color: self defaultColor; - yourself) ] ]. + commit commitCreator = commitShape first model commitCreator + ifTrue: [ + (shp children detect: [ :c | c class = RSBox ]) border: + (RSBorder new + width: 5; + color: self defaultColor; + yourself) ] ]. From 7276be9324d5bb298995578422d344e845446b51 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Thu, 10 Oct 2024 17:54:48 +0200 Subject: [PATCH 5/5] fix model importer for bitbucket commit --- .../BitBucketModelImporter.class.st | 9 ++++----- src/GitLabHealth-Model-Analysis/UserMetric.class.st | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st b/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st index 8dad277..5d3c5d7 100644 --- a/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st +++ b/src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st @@ -188,10 +188,9 @@ BitBucketModelImporter >> importCommitsOfProject: aGLHProject since: since until glhCommit deletions: (contribution at: #deletions). glhCommit ]. - aGLHProject repository commits: commits. - self glhModel addAll: commits unless: self blockOnIdEquality. - - ^ commits + + commits := self glhModel addAll: commits unless: self blockOnIdEquality. + ^ aGLHProject repository commits addAll: commits unless: self blockOnIdEquality. ] { #category : #'import - projects' } @@ -322,7 +321,7 @@ BitBucketModelImporter >> importMergeRequests: aGLHProject since: fromDate until self parsePullRequestIntoGLPHEMergeRequest: pullRequest ]. - self glhModel addAll: pullRequests unless: self blockOnIdEquality. + pullRequests := self glhModel addAll: pullRequests unless: self blockOnIdEquality. ^ pullRequests ] diff --git a/src/GitLabHealth-Model-Analysis/UserMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMetric.class.st index a1bf502..c420eec 100644 --- a/src/GitLabHealth-Model-Analysis/UserMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMetric.class.st @@ -165,7 +165,6 @@ UserMetric >> loadUserCommitsSince: since until: until [ UserMetric >> loadUserCompleteCommitsSince: since until: until [ | commits | - 1 halt. commits := self loadUserCommitsSince: since until: until. commits do: [ :commit | glhImporter completeImportedCommit: commit ]. ^ commits