Skip to content

Commit

Permalink
add email setup for jira interfacing
Browse files Browse the repository at this point in the history
  • Loading branch information
HLAD Nicolas committed Aug 27, 2024
1 parent f00cf1b commit 73a69b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
20 changes: 18 additions & 2 deletions src/GitLabHealth-Model-Analysis/GitMetric4User.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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.
Expand Down
13 changes: 12 additions & 1 deletion src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Class {
#category : #'GitLabHealth-Model-Analysis'
}



{ #category : #'as yet unclassified' }
GitMetricExporter class >> demoPeriod [

Expand All @@ -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 [

Expand Down Expand Up @@ -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"

Expand All @@ -487,6 +496,8 @@ GitMetricExporter >> setupAnalysisForUsersWithNames: userNames [
metrics := GitMetric4User new.
metrics
glhImporter: glhImporter;
jiraImporter: jiraImporter;
withUserEmailDomain: emailDomain;
user: user.

i := 0.
Expand Down
3 changes: 2 additions & 1 deletion src/GitLabHealth-Model-Importer/GLHModelImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,8 @@ GLHModelImporter >> userCatalogue [
{ #category : #accessing }
GLHModelImporter >> userCatalogue: aGLHUserCatalogue [

userCatalogue := aGLHUserCatalogue
userCatalogue := aGLHUserCatalogue.
aGLHUserCatalogue anImporter: self.
]

{ #category : #accessing }
Expand Down

0 comments on commit 73a69b0

Please sign in to comment.