diff --git a/src/GitLabHealth-Model-Analysis/GitMetric4User.class.st b/src/GitLabHealth-Model-Analysis/GitMetric4User.class.st index e9c56ea..f1c2d1f 100644 --- a/src/GitLabHealth-Model-Analysis/GitMetric4User.class.st +++ b/src/GitLabHealth-Model-Analysis/GitMetric4User.class.st @@ -9,6 +9,20 @@ Class { #category : #'GitLabHealth-Model-Analysis' } +{ #category : #'email' } +GitMetric4User >> withUserEmailDomain: aEmailDomain [ + emailDomain := aEmailDomain. +] + +{ #category : #'email' } +GitMetric4User >> userEmail [ + "overide this method to adapt on your situation" + + ^ ('' join: { + user username. + emailDomain }) asLowercase. +] + { #category : #'metrics - commits' } GitMetric4User >> averageTimeBetweenCommitSince: since until: until overA: aDateWeekMonthOrYear [ @@ -664,7 +678,9 @@ GitMetric4User >> initialize [ user := GLHUser new. itsProjects := Dictionary new. itsCommits := Dictionary new. - itsMergeRequests := Dictionary new + itsMergeRequests := Dictionary new. + + emailDomain := '@generic-domain.com' ] { #category : #accessing } @@ -697,7 +713,7 @@ GitMetric4User >> loadItsMergeRequesWithJiraIssueSince: since until: until [ loadItsMergeRequestsSince: since until: until. - email := ('' join: {user username . '@berger-levrault.com'}) asLowercase . + email := self userEmail. jiraImporter importAllCurrentAndPastIssuesOf: email. diff --git a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st index af3f68a..a7fc98d 100644 --- a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st +++ b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st @@ -17,6 +17,8 @@ Class { #category : #'GitLabHealth-Model-Analysis' } + + { #category : #'as yet unclassified' } GitMetricExporter class >> demoPeriod [ @@ -26,6 +28,13 @@ GitMetricExporter class >> demoPeriod [ addAPeriodFrom: '01 march 2024' to: '31 may 2024' ] +{ #category : #setup } +GitMetricExporter >> withEmailDomain: anEmailDomain [ + + "define the email domain of your Git user. Usefull to link them between service (i.e. Jira)" + emailDomain := anEmailDomain +] + { #category : #adding } GitMetricExporter >> addAPeriodFrom: since to: until [ @@ -470,7 +479,7 @@ GitMetricExporter >> onlyImportProjectsOfGroup: groupId [ projectCache := group toScope: GLHProject ] -{ #category : #adding } +{ #category : #setup } GitMetricExporter >> setupAnalysisForUsersWithNames: userNames [ "import all the project since a certain time" @@ -487,6 +496,8 @@ GitMetricExporter >> setupAnalysisForUsersWithNames: userNames [ metrics := GitMetric4User new. metrics glhImporter: glhImporter; + jiraImporter: jiraImporter; + withUserEmailDomain: emailDomain; user: user. i := 0. diff --git a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st index 69008a4..108b819 100644 --- a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st @@ -1155,7 +1155,8 @@ GLHModelImporter >> userCatalogue [ { #category : #accessing } GLHModelImporter >> userCatalogue: aGLHUserCatalogue [ - userCatalogue := aGLHUserCatalogue + userCatalogue := aGLHUserCatalogue. + aGLHUserCatalogue anImporter: self. ] { #category : #accessing }