From d3814d8baba6b4634e85baa548c32b3afc953a68 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Tue, 26 Nov 2024 14:59:06 +0100 Subject: [PATCH] change parsing of Date --- .../AnalysisReport.class.st | 2 +- .../ClosedMergeRequestMetric.class.st | 2 +- .../ClosedTicketsMetric.class.st | 2 +- .../CodeAdditionByMRMetric.class.st | 2 +- .../CodeAdditionByTicketMetric.class.st | 2 +- .../CodeAdditionMetric.class.st | 2 +- .../CodeChurnMetric.class.st | 2 +- .../CodeDeletionByMRMetric.class.st | 2 +- .../CodeDeletionByTicketMetric.class.st | 2 +- .../CodeDeletionMetric.class.st | 2 +- .../CommentContributionMetric.class.st | 2 +- .../CommitFrequencyMetric.class.st | 2 +- .../CommitsNumberByJiraTicketsMetric.class.st | 2 +- .../ContributedProjectMetric.class.st | 2 +- .../DelayUntilFirstChurnMetric.class.st | 2 +- .../GLHUserCatalogue.class.st | 2 +- .../GLHUserCatalogueItem.class.st | 2 +- .../GLHUserCatalogueV2.class.st | 2 +- .../GitAnalyzer.class.st | 2 +- .../GitMetricExporter.class.st | 6 +- .../JiraTimeMRTimeDifferenceMetric.class.st | 2 +- .../MergeRequestDurationMetric.class.st | 2 +- .../Metric.class.st | 2 +- .../OpenedMergeRequestMetric.class.st | 2 +- .../PendingMergeRequestMetric.class.st | 2 +- .../ProjectAnalysisReport.class.st | 2 +- .../ProjectMetric.class.st | 2 +- .../ReviewedByUserMergeRequestMetric.class.st | 2 +- ...gedUnderAMinuteMergeRequestMetric.class.st | 2 +- .../TimeBetweenCommitMetric.class.st | 2 +- .../UserAnalysisReport.class.st | 2 +- .../UserCommitsMetric.class.st | 2 +- .../UserJiraMetric.class.st | 2 +- .../UserMergeRequestMetric.class.st | 2 +- .../UserMetric.class.st | 2 +- .../GLHApi.class.st | 93 ++++++----- .../GLHApiFile.class.st | 15 +- .../GLHModelImporter.class.st | 147 +++++++++--------- src/GitLabHealth-Model-Importer/package.st | 2 +- .../GLPHApi.class.st | 31 ++-- .../GLPHModelImporter.class.st | 55 ++++--- .../package.st | 2 +- 42 files changed, 207 insertions(+), 212 deletions(-) diff --git a/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st index 2ec4938..210996f 100644 --- a/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st @@ -6,7 +6,7 @@ Class { 'over', 'metrics' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #initialization } diff --git a/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st index 86add80..56fd116 100644 --- a/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #ClosedMergeRequestMetric, #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st b/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st index 885f814..a368fd8 100644 --- a/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #ClosedTicketsMetric, #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st index 3e0c4b3..c6d5e94 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CodeAdditionByMRMetric, #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st index 210463e..3109cc7 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CodeAdditionByTicketMetric, #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st index 064ab99..bd0acbf 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CodeAdditionMetric, #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st index 46eaff6..a34aff2 100644 --- a/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'maxCommitWindow' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st index abb278a..9797a54 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CodeDeletionByMRMetric, #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st index 9cdf88b..66e71b0 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CodeDeletionByTicketMetric, #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st index 0d08a68..e6f465c 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CodeDeletionMetric, #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st b/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st index 149bf55..5872abd 100644 --- a/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CommentContributionMetric, #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st b/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st index 1994ead..10c7d36 100644 --- a/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CommitFrequencyMetric, #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st b/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st index 3307e5d..9114c13 100644 --- a/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #CommitsNumberByJiraTicketsMetric, #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st b/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st index 8663cad..8cc89bc 100644 --- a/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #ContributedProjectMetric, #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st b/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st index 29e14ac..f6b0f08 100644 --- a/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'maxCommitWindow' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st index 9db688e..808bbd6 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st @@ -5,7 +5,7 @@ Class { 'users', 'anImporter' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #import } diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st index 5489928..108c1d6 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st @@ -5,7 +5,7 @@ Class { 'user', 'names' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #initialization } diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st index 856c61d..7376d60 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st @@ -1,7 +1,7 @@ Class { #name : #GLHUserCatalogueV2, #superclass : #GLHUserCatalogue, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #import } diff --git a/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st b/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st index be075cb..dac8652 100644 --- a/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st +++ b/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st @@ -8,7 +8,7 @@ Class { 'onProject', 'maxChildCommits' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #analyze } diff --git a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st index 359640c..cced2c7 100644 --- a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st +++ b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st @@ -15,7 +15,7 @@ Class { 'metrics', 'analyses' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #'as yet unclassified' } @@ -322,7 +322,7 @@ GitMetricExporter >> findParticipationOfCommitAuthorNamed: username amongProject response := glhImporter repoApi commitsOfUser: username inProject: project id - since: '01 january 2023' asDateAndTime + since: '01 january 2023' asDate asDateAndTime until: Date today asDateAndTime. response := glhImporter parseCommitsResult: response. response isNotEmpty @@ -433,7 +433,7 @@ GitMetricExporter >> initialize [ entities := OrderedCollection new. "set up the minimal date from which we are looking for the commits a particular user in projects" - sinceTimeLimit := '2024-01-01' asDateAndTime. + sinceTimeLimit := '2024-01-01' asDate asDateAndTime. runningPeriods := OrderedCollection new. maxCommitWindow := 3. over := Date. diff --git a/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st b/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st index 8e2b064..6a969f3 100644 --- a/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #JiraTimeMRTimeDifferenceMetric, #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st b/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st index 8b49bc6..609b404 100644 --- a/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #MergeRequestDurationMetric, #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/Metric.class.st b/src/GitLabHealth-Model-Analysis/Metric.class.st index 0019531..b9e360f 100644 --- a/src/GitLabHealth-Model-Analysis/Metric.class.st +++ b/src/GitLabHealth-Model-Analysis/Metric.class.st @@ -7,7 +7,7 @@ Class { 'glhImporter', 'jiraImporter' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #'as yet unclassified' } diff --git a/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st index 6e349b4..2e1c4b2 100644 --- a/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #OpenedMergeRequestMetric, #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st index 946d807..185e7c5 100644 --- a/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #PendingMergeRequestMetric, #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st index a72b67c..f9990bd 100644 --- a/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'projectName' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #accessing } diff --git a/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st b/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st index c56ebef..fbb90de 100644 --- a/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st @@ -4,5 +4,5 @@ Class { #instVars : [ 'project' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } diff --git a/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st index 0ca0e40..ca408fe 100644 --- a/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #ReviewedByUserMergeRequestMetric, #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st index 5c38042..cf25445 100644 --- a/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #SelfMergedUnderAMinuteMergeRequestMetric, #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st b/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st index 8b39d2e..5af9688 100644 --- a/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #TimeBetweenCommitMetric, #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st index 1972bfa..5288793 100644 --- a/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st @@ -5,7 +5,7 @@ Class { 'username', 'email' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #accessing } diff --git a/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st b/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st index a4de30c..e891e4a 100644 --- a/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #UserCommitsMetric, #superclass : #UserMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st b/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st index e7b6c78..ba19b36 100644 --- a/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #UserJiraMetric, #superclass : #UserMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st index 76258fc..83a07b9 100644 --- a/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st @@ -1,7 +1,7 @@ Class { #name : #UserMergeRequestMetric, #superclass : #UserMetric, - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #calculating } diff --git a/src/GitLabHealth-Model-Analysis/UserMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMetric.class.st index 5ed51cd..7e5ac75 100644 --- a/src/GitLabHealth-Model-Analysis/UserMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMetric.class.st @@ -7,7 +7,7 @@ Class { 'userMergeRequests', 'emailDomain' ], - #category : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } { #category : #utils } diff --git a/src/GitLabHealth-Model-Importer/GLHApi.class.st b/src/GitLabHealth-Model-Importer/GLHApi.class.st index d5c2e0b..ba2eb22 100644 --- a/src/GitLabHealth-Model-Importer/GLHApi.class.st +++ b/src/GitLabHealth-Model-Importer/GLHApi.class.st @@ -2,8 +2,8 @@ This is the API. I do not perform any kinds of JSON transformation " Class { - #name : 'GLHApi', - #superclass : 'Object', + #name : #GLHApi, + #superclass : #Object, #instVars : [ 'baseAPIUrl', 'client' @@ -11,29 +11,28 @@ Class { #classVars : [ 'currentAPI' ], - #category : 'GitLabHealth-Model-Importer', - #package : 'GitLabHealth-Model-Importer' + #category : #'GitLabHealth-Model-Importer' } -{ #category : 'accessing' } +{ #category : #accessing } GLHApi class >> current [ ^ currentAPI ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApi >> baseAPIUrl [ ^ baseAPIUrl ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApi >> baseAPIUrl: anObject [ baseAPIUrl := anObject ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHApi >> blamesOfProject: aProjectId forFile: filePath onBranch: branchRef onStartRange: start toEndRange: end [ self client path: @@ -47,7 +46,7 @@ GLHApi >> blamesOfProject: aProjectId forFile: filePath onBranch: branchRef onSt ^ self client get ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHApi >> blamesOfProject: aProjectId forFile: filePath onStartRange: start toEndRange: end [ self client path: @@ -60,7 +59,7 @@ GLHApi >> blamesOfProject: aProjectId forFile: filePath onStartRange: start toEn ^ self client get ] -{ #category : 'api' } +{ #category : #api } GLHApi >> branchesOfRepository: aProjectID [ ^ self client get: @@ -68,19 +67,19 @@ GLHApi >> branchesOfRepository: aProjectID [ , '/repository/branches' ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApi >> client [ ^ client ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApi >> client: anObject [ client := anObject ] -{ #category : 'api - commits' } +{ #category : #'api - commits' } GLHApi >> commit: commitSHA ofProject: aProjectId [ self client path: (String streamContents: [ :str | @@ -95,7 +94,7 @@ GLHApi >> commit: commitSHA ofProject: aProjectId [ ^ self client get ] -{ #category : 'api - commits' } +{ #category : #'api - commits' } GLHApi >> commit: commitSHA ofProject: aProjectId withStat: stats [ self client path: (String streamContents: [ :str | @@ -113,7 +112,7 @@ GLHApi >> commit: commitSHA ofProject: aProjectId withStat: stats [ ^ self client get ] -{ #category : 'api - commits' } +{ #category : #'api - commits' } GLHApi >> commitDiff: commitSHA ofProject: aProjectId unidiff: unidiff [ self client path: (String streamContents: [ :str | @@ -132,7 +131,7 @@ GLHApi >> commitDiff: commitSHA ofProject: aProjectId unidiff: unidiff [ ^ self client get ] -{ #category : 'api - commits' } +{ #category : #'api - commits' } GLHApi >> commitsOfProject: aProjectId [ ^ self @@ -151,7 +150,7 @@ GLHApi >> commitsOfProject: aProjectId [ page: nil ] -{ #category : 'commits' } +{ #category : #commits } GLHApi >> commitsOfProject: anInteger forRefName: refName since: since [ ^ self commitsOfProject: anInteger @@ -169,7 +168,7 @@ GLHApi >> commitsOfProject: anInteger forRefName: refName since: since [ page: nil. ] -{ #category : 'api - commits' } +{ #category : #'api - commits' } GLHApi >> commitsOfProject: aProjectId forRefName: refName since: since until: until path: aPath author: author all: aAllBoolean with_stats: withStateBoolean firstParent: firstParent order: orderString trailers: trailers perPage: aPerPageNumber page: aPageNumber [ "https://docs.gitlab.com/ee/api/commits.html#list-repository-commits" @@ -195,7 +194,7 @@ GLHApi >> commitsOfProject: aProjectId forRefName: refName since: since until: u ^ self client get ] -{ #category : 'commits' } +{ #category : #commits } GLHApi >> commitsOfUser: aUserName inProject: anInteger [ | name | @@ -222,7 +221,7 @@ GLHApi >> commitsOfUser: aUserName inProject: anInteger [ ^ client get. " ] -{ #category : 'commits' } +{ #category : #commits } GLHApi >> commitsOfUser: aUserName inProject: anInteger since: since until: until [ | name | @@ -249,7 +248,7 @@ GLHApi >> commitsOfUser: aUserName inProject: anInteger since: since until: unti ^ client get. " ] -{ #category : 'api - repositories' } +{ #category : #'api - repositories' } GLHApi >> compareProject: aProjectID from: fromSha to: toSha fromProject: fromProjectID straight: straight unidiff: unidiff [ self client path: @@ -267,7 +266,7 @@ GLHApi >> compareProject: aProjectID from: fromSha to: toSha fromProject: fromPr ^ self client get ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHApi >> contributedProjectsOfUserId: anUserID orderBy: orderByAttribute simple: simpleBoolean sort: AscOrDesc perPage: perPageNumber page: pageIndex [ self client path: self baseAPIUrl , '/users/', anUserID printString, '/contributed_projects'. @@ -283,7 +282,7 @@ GLHApi >> contributedProjectsOfUserId: anUserID orderBy: orderByAttribute simple ^ self client get. ] -{ #category : 'api - branches' } +{ #category : #'api - branches' } GLHApi >> createBranch: newBranchName forProject: aProjectID fromBranch: refBranchName [ self client url: @@ -294,7 +293,7 @@ GLHApi >> createBranch: newBranchName forProject: aProjectID fromBranch: refBran ^ self client post ] -{ #category : 'api - branches' } +{ #category : #'api - branches' } GLHApi >> deleteBranch: branchName forProject: aProjectID [ self client url: @@ -303,7 +302,7 @@ GLHApi >> deleteBranch: branchName forProject: aProjectID [ ^ self client delete ] -{ #category : 'api - projects' } +{ #category : #'api - projects' } GLHApi >> editProject: aProjectID changeDefaultBranchTo: refBranchName [ self client url: @@ -312,7 +311,7 @@ GLHApi >> editProject: aProjectID changeDefaultBranchTo: refBranchName [ ^ self client put ] -{ #category : 'api - projects' } +{ #category : #'api - projects' } GLHApi >> editProject: aProjectID usingDictionary: aDictionaryOfNewParam [ self client url: @@ -323,7 +322,7 @@ GLHApi >> editProject: aProjectID usingDictionary: aDictionaryOfNewParam [ ^ self client put ] -{ #category : 'api - repository files' } +{ #category : #'api - repository files' } GLHApi >> getFileBlameForProject: aProjectId andFilePath: aFilePath inRef: aRef fromLine: rangeStart toLine: rangeEnd [ "filePath is converted here. So give a path such as ""path/to/file.md""" @@ -340,13 +339,13 @@ GLHApi >> getFileBlameForProject: aProjectId andFilePath: aFilePath inRef: aRef ^ self client get ] -{ #category : 'api' } +{ #category : #api } GLHApi >> group: aGroupID [ ^ self client get: self baseAPIUrl , '/groups/' , aGroupID printString ] -{ #category : 'projects' } +{ #category : #projects } GLHApi >> importProjects: first after: after [ | request query variables body response | @@ -388,7 +387,7 @@ GLHApi >> importProjects: first after: after [ ^ response contents ] -{ #category : 'initialization' } +{ #category : #initialization } GLHApi >> initialize [ self client: (ZnClient new @@ -397,7 +396,7 @@ GLHApi >> initialize [ ] -{ #category : 'api - jobs' } +{ #category : #'api - jobs' } GLHApi >> jobsOfProject: aProjectID ofPipelines: aPipelineID [ ^ self client get: @@ -405,7 +404,7 @@ GLHApi >> jobsOfProject: aProjectID ofPipelines: aPipelineID [ , '/pipelines/' , aPipelineID printString , '/jobs' ] -{ #category : 'api - groups' } +{ #category : #'api - groups' } GLHApi >> listGroupsWithTopLevelOnly: topLevelOnly page: aPageNumber [ "https://docs.gitlab.com/ee/api/groups.html#list-groups" @@ -417,29 +416,29 @@ GLHApi >> listGroupsWithTopLevelOnly: topLevelOnly page: aPageNumber [ ^ self client get ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHApi >> makeGlobal [ currentAPI := self ] -{ #category : 'api' } +{ #category : #api } GLHApi >> pipelinesOfProject: aProjectID [ ^ self client get: self baseAPIUrl , '/projects/' , aProjectID printString, '/pipelines' ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApi >> privateToken [ ^ self client request headers at: #'PRIVATE-TOKEN' ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApi >> privateToken: anObject [ self client headerAt: #'PRIVATE-TOKEN' add: anObject ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApi >> projects [ "use GraphQL" @@ -468,13 +467,13 @@ GLHApi >> projects [ ^ projectIds ] -{ #category : 'projects' } +{ #category : #projects } GLHApi >> projects: aPerPageNumber page: aPageNumber [ self projects: aPerPageNumber since: nil page: aPageNumber ] -{ #category : 'projects' } +{ #category : #projects } GLHApi >> projects: aPerPageNumber since: since page: aPageNumber [ self client path: self baseAPIUrl , '/projects/'. @@ -486,7 +485,7 @@ GLHApi >> projects: aPerPageNumber since: since page: aPageNumber [ ^ self client get ] -{ #category : 'private' } +{ #category : #private } GLHApi >> resetClient [ | token | @@ -496,14 +495,14 @@ GLHApi >> resetClient [ self client accept: ZnMimeType applicationJson ] -{ #category : 'api - groups' } +{ #category : #'api - groups' } GLHApi >> subgroupsOfGroup: aGroupID [ ^ self client get: self baseAPIUrl , '/groups/' , aGroupID printString , '/subgroups' ] -{ #category : 'api - groups' } +{ #category : #'api - groups' } GLHApi >> subgroupsOfGroup: aGroupID page: aPageNumber [ self client url: @@ -512,7 +511,7 @@ GLHApi >> subgroupsOfGroup: aGroupID page: aPageNumber [ ^ self client get ] -{ #category : 'api' } +{ #category : #api } GLHApi >> treeOfRepository: aProjectID ofBranch: aBranchRef andPath: aPath [ | result | @@ -526,19 +525,19 @@ GLHApi >> treeOfRepository: aProjectID ofBranch: aBranchRef andPath: aPath [ ^ result ] -{ #category : 'api' } +{ #category : #api } GLHApi >> user: aUserID [ ^ self client get: self baseAPIUrl , '/users/' , aUserID printString ] -{ #category : 'api' } +{ #category : #api } GLHApi >> userWithUsername: anUsername [ ^ self client get: self baseAPIUrl , '/users?username=' , anUsername ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHApi >> usersHuman: humans active: active withoutProjectBots: withoutBot perPage: perPage page: page [ self client path: self baseAPIUrl , '/users/'. @@ -552,7 +551,7 @@ GLHApi >> usersHuman: humans active: active withoutProjectBots: withoutBot perPa ^ self client get ] -{ #category : 'user' } +{ #category : #user } GLHApi >> usersPerPage: perPage page: page [ self client path: self baseAPIUrl , '/users/'. diff --git a/src/GitLabHealth-Model-Importer/GLHApiFile.class.st b/src/GitLabHealth-Model-Importer/GLHApiFile.class.st index 355c042..cd9a0a0 100644 --- a/src/GitLabHealth-Model-Importer/GLHApiFile.class.st +++ b/src/GitLabHealth-Model-Importer/GLHApiFile.class.st @@ -1,33 +1,32 @@ Class { - #name : 'GLHApiFile', - #superclass : 'Object', + #name : #GLHApiFile, + #superclass : #Object, #instVars : [ 'name', 'type' ], - #category : 'GitLabHealth-Model-Importer', - #package : 'GitLabHealth-Model-Importer' + #category : #'GitLabHealth-Model-Importer' } -{ #category : 'accessing' } +{ #category : #accessing } GLHApiFile >> name [ ^ name ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApiFile >> name: anObject [ name := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApiFile >> type [ ^ type ] -{ #category : 'accessing' } +{ #category : #accessing } GLHApiFile >> type: anObject [ type := anObject diff --git a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st index 16c2ec3..546b0a4 100644 --- a/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st +++ b/src/GitLabHealth-Model-Importer/GLHModelImporter.class.st @@ -1,16 +1,15 @@ Class { - #name : 'GLHModelImporter', - #superclass : 'GPModelImporter', + #name : #GLHModelImporter, + #superclass : #GPModelImporter, #instVars : [ 'withInitialCommits', 'withInitialMergeRequest', 'generalReader' ], - #category : 'GitLabHealth-Model-Importer', - #package : 'GitLabHealth-Model-Importer' + #category : #'GitLabHealth-Model-Importer' } -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> addCommits: commitsList toRepository: aProjectRepository [ "I take a list of GLHCommit. But some might have been parsed but are already on the model..." @@ -27,7 +26,7 @@ GLHModelImporter >> addCommits: commitsList toRepository: aProjectRepository [ ^ newlyFoundCommit ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> addGroupResultToModel: groupResult [ |group| group := self glhModel add: groupResult unless: self blockOnIdEquality. @@ -37,7 +36,7 @@ GLHModelImporter >> addGroupResultToModel: groupResult [ ^ group ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> chainsCommitsFrom: commitsCollection [ | dic | @@ -59,7 +58,7 @@ GLHModelImporter >> chainsCommitsFrom: commitsCollection [ ^ commitsCollection ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> completeImportProject: aGLHProject [ | importedProject | @@ -86,7 +85,7 @@ GLHModelImporter >> completeImportProject: aGLHProject [ ^ importedProject ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> completeImportedCommit: aCommit [ ('completing commit: ' , aCommit short_id printString) recordInfo. @@ -101,7 +100,7 @@ GLHModelImporter >> completeImportedCommit: aCommit [ ^ aCommit ] -{ #category : 'private - configure reader' } +{ #category : #'private - configure reader' } GLHModelImporter >> configureReaderForCommit: reader [ reader for: GLHCommit do: [ :mapping | @@ -133,7 +132,7 @@ GLHModelImporter >> configureReaderForCommit: reader [ ] -{ #category : 'private - configure reader' } +{ #category : #'private - configure reader' } GLHModelImporter >> configureReaderForDiffs: reader [ reader for: GLHDiff do: [ :mapping | @@ -148,7 +147,7 @@ GLHModelImporter >> configureReaderForDiffs: reader [ ^ reader ] -{ #category : 'private - configure reader' } +{ #category : #'private - configure reader' } GLHModelImporter >> configureReaderForGroup: reader [ reader for: GLHGroup do: [ :mapping | @@ -165,7 +164,7 @@ GLHModelImporter >> configureReaderForGroup: reader [ customMappting listOfElementSchema: GLHGroup ] ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> convertApiFileAsFile: aAPIFile [ aAPIFile type = 'tree' ifTrue: [ @@ -177,14 +176,14 @@ GLHModelImporter >> convertApiFileAsFile: aAPIFile [ yourself ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> detectEntityType: aType overAttribut: aSelector equalTo: value [ ^ (self glhModel allWithType: aType) detect: [ :entity | (entity perform: aSelector) = value ] ifNone: [ nil ]. ] -{ #category : 'accessing' } +{ #category : #accessing } GLHModelImporter >> glhApi [ self @@ -196,7 +195,7 @@ GLHModelImporter >> glhApi [ ^ repoApi ] -{ #category : 'accessing' } +{ #category : #accessing } GLHModelImporter >> glhApi: anObject [ self @@ -208,19 +207,19 @@ GLHModelImporter >> glhApi: anObject [ repoApi := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } GLHModelImporter >> glhModel [ ^ glhModel ] -{ #category : 'accessing' } +{ #category : #accessing } GLHModelImporter >> glhModel: anObject [ glhModel := anObject ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> importActiveHumanUsers [ | newlyFoundUser page foundUsers | @@ -250,7 +249,7 @@ GLHModelImporter >> importActiveHumanUsers [ ^ foundUsers ] -{ #category : 'api' } +{ #category : #api } GLHModelImporter >> importAllGroups [ | page foundGroups newlyFoundGroups | @@ -269,7 +268,7 @@ GLHModelImporter >> importAllGroups [ ^ foundGroups ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> importAndLoadLatestsCommitsOfProject: aGLHProject [ | commits | @@ -280,7 +279,7 @@ GLHModelImporter >> importAndLoadLatestsCommitsOfProject: aGLHProject [ ^ commits ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> importCommit: aCommitID ofProject: aGLHProject [ | result parsedResult | @@ -298,7 +297,7 @@ GLHModelImporter >> importCommit: aCommitID ofProject: aGLHProject [ ^ parsedResult ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> importCommitOfProject: anProject withId: anID [ | commit result | @@ -325,7 +324,7 @@ GLHModelImporter >> importCommitOfProject: anProject withId: anID [ ^ commit ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> importCommits: aGLHProject [ "limited to the last 20 commits" @@ -356,7 +355,7 @@ GLHModelImporter >> importCommits: aGLHProject [ ^ parsedResults. ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> importCommitsFollowing: aCommit upToDays: aNumberOfDay [ "import the 'n' commits of a project starting from an initial 'aCommit' commit. Lazy import does not import the entities inside the model" @@ -371,7 +370,7 @@ GLHModelImporter >> importCommitsFollowing: aCommit upToDays: aNumberOfDay [ until: (date + aNumberOfDay day) ] -{ #category : 'commit' } +{ #category : #commit } GLHModelImporter >> importCommitsOf: aGLHProject withStats: aBoolean until: toDate [ | newlyFoundCommit page | @@ -416,7 +415,7 @@ GLHModelImporter >> importCommitsOf: aGLHProject withStats: aBoolean until: toDa self importDiffOfCommit: commit ] ] ] -{ #category : 'commit' } +{ #category : #commit } GLHModelImporter >> importCommitsOfBranch: aGLHBranch forRefName: refName since: fromDate [ ^ self @@ -426,7 +425,7 @@ GLHModelImporter >> importCommitsOfBranch: aGLHBranch forRefName: refName since: until: nil ] -{ #category : 'commit' } +{ #category : #commit } GLHModelImporter >> importCommitsOfBranch: aGLHBranch forRefName: refName since: fromDate until: toDate [ | newlyFoundCommit page foundCommit| @@ -441,9 +440,9 @@ GLHModelImporter >> importCommitsOfBranch: aGLHBranch forRefName: refName since: commitsOfProject: aGLHBranch repository project id forRefName: aGLHBranch name since: - (fromDate ifNotNil: [ fromDate asDateAndTime asString ]) + (fromDate ifNotNil: [ fromDate asDate asDateAndTime asString ]) until: - (toDate ifNotNil: [ toDate asDateAndTime asString ]) + (toDate ifNotNil: [ toDate asDate asDateAndTime asString ]) path: nil author: nil all: nil @@ -471,7 +470,7 @@ GLHModelImporter >> importCommitsOfBranch: aGLHBranch forRefName: refName since: ^ foundCommit ] -{ #category : 'commit' } +{ #category : #commit } GLHModelImporter >> importCommitsOfBranch: aGLHBranch forRefName: refName until: toDate [ ^ self @@ -481,7 +480,7 @@ GLHModelImporter >> importCommitsOfBranch: aGLHBranch forRefName: refName until: until: toDate ] -{ #category : 'commit' } +{ #category : #commit } GLHModelImporter >> importCommitsOfProject: aProject since: fromDate until: toDate [ | newlyFoundCommit page foundCommit | @@ -496,9 +495,9 @@ GLHModelImporter >> importCommitsOfProject: aProject since: fromDate until: toDa commitsOfProject: aProject id forRefName: nil since: - (fromDate ifNotNil: [ fromDate asDateAndTime asString ]) + (fromDate ifNotNil: [ fromDate asDate asDateAndTime asString ]) until: - (toDate ifNotNil: [ toDate asDateAndTime asString ]) + (toDate ifNotNil: [ toDate asDate asDateAndTime asString ]) path: nil author: nil all: true @@ -520,7 +519,7 @@ GLHModelImporter >> importCommitsOfProject: aProject since: fromDate until: toDa ^ self glhModel addAll: foundCommit unless: self blockOnIdEquality ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> importContributedProjectsOfUser: aGLHUser [ | newlyFoundElmts page foundElmts remaningProjects | @@ -562,7 +561,7 @@ GLHModelImporter >> importContributedProjectsOfUser: aGLHUser [ ^ foundElmts ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> importCreatorOfCommit: aCommit [ aCommit commitCreator ifNil: [ @@ -572,7 +571,7 @@ GLHModelImporter >> importCreatorOfCommit: aCommit [ ^ aCommit commitCreator ] -{ #category : 'api' } +{ #category : #api } GLHModelImporter >> importDiffOfCommit: aCommit [ | result diffsResult | @@ -591,7 +590,7 @@ GLHModelImporter >> importDiffOfCommit: aCommit [ ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> importDirectoryFiles: aDirectoryFile OfBranch: aBranch [ | result files apiFiles | @@ -612,7 +611,7 @@ GLHModelImporter >> importDirectoryFiles: aDirectoryFile OfBranch: aBranch [ self importDirectoryFiles: file OfBranch: aBranch ] ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> importFilesOfBranch: aBranch [ | result files apiFiles | @@ -632,7 +631,7 @@ GLHModelImporter >> importFilesOfBranch: aBranch [ self importDirectoryFiles: file OfBranch: aBranch ] ] -{ #category : 'api' } +{ #category : #api } GLHModelImporter >> importGroup: aGroupID [ | result groupResult | @@ -653,7 +652,7 @@ GLHModelImporter >> importGroup: aGroupID [ ^ groupResult ] -{ #category : 'api' } +{ #category : #api } GLHModelImporter >> importJobsOf: aPipeline [ | result jobs | @@ -666,7 +665,7 @@ GLHModelImporter >> importJobsOf: aPipeline [ ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> importLastestCommitsOfProject: aGLHProject [ "limited to the last 50 commits" @@ -702,7 +701,7 @@ GLHModelImporter >> importLastestCommitsOfProject: aGLHProject [ ^ parsedResults ] -{ #category : 'commit' } +{ #category : #commit } GLHModelImporter >> importParentCommitsOfCommit: aGLHCommit since: aDate [ | parentsIds commits | @@ -726,7 +725,7 @@ GLHModelImporter >> importParentCommitsOfCommit: aGLHCommit since: aDate [ flatten ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> importPipelinesOfProject: aGLHProject [ (self pipelinesOf: aGLHProject id) do: [ :pipeline | @@ -734,7 +733,7 @@ GLHModelImporter >> importPipelinesOfProject: aGLHProject [ aGLHProject pipelines add: pipeline unless: self blockOnIdEquality] ] -{ #category : 'projects' } +{ #category : #projects } GLHModelImporter >> importProject: aProjectID [ | result projectResult | @@ -746,19 +745,19 @@ GLHModelImporter >> importProject: aProjectID [ ^ self completeImportProject: projectResult ] -{ #category : 'imports' } +{ #category : #imports } GLHModelImporter >> importProjects [ ^ self importProjectsSince: nil ] -{ #category : 'projects' } +{ #category : #projects } GLHModelImporter >> importProjects: aCollectionOfProjectID [ ^ aCollectionOfProjectID collect: [ :id | self importProject: id ] ] -{ #category : 'imports' } +{ #category : #imports } GLHModelImporter >> importProjectsSince: since [ "heavy import of all projects" @@ -787,7 +786,7 @@ GLHModelImporter >> importProjectsSince: since [ ^ foundProject ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> importRepository: aGLHRepository [ | resultBranches branches | @@ -816,7 +815,7 @@ GLHModelImporter >> importRepository: aGLHRepository [ self inform: aGLHRepository project name , ' has no repository' ] ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> importUser: aUserID [ | result userResult | @@ -829,7 +828,7 @@ GLHModelImporter >> importUser: aUserID [ ^ self glhModel add: userResult unless: self blockOnIdEquality ] -{ #category : 'user' } +{ #category : #user } GLHModelImporter >> importUserByUsername: anUsername [ | dicUsername resultUser | @@ -879,7 +878,7 @@ GLHModelImporter >> importUserByUsername: anUsername [ ^ resultUser ] -{ #category : 'initialization' } +{ #category : #initialization } GLHModelImporter >> initReader [ generalReader := NeoJSONReader new. @@ -888,7 +887,7 @@ GLHModelImporter >> initReader [ self configureReaderForDiffs: generalReader. ] -{ #category : 'initialization' } +{ #category : #initialization } GLHModelImporter >> initialize [ super initialize. @@ -902,12 +901,12 @@ GLHModelImporter >> initialize [ ] -{ #category : 'api' } +{ #category : #api } GLHModelImporter >> isServerError: aString [ ^ aString = '{"message":"500 Internal Server Error"}' ] -{ #category : 'importer' } +{ #category : #importer } GLHModelImporter >> loadAllProjectsFromRepositorySoftware [ "heavy import that load all the active project inside the model. Only import the project entities" |projects| @@ -915,7 +914,7 @@ GLHModelImporter >> loadAllProjectsFromRepositorySoftware [ projects := self repoApi projects. ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> newParseCommitResult: result [ generalReader on: result readStream. @@ -923,14 +922,14 @@ GLHModelImporter >> newParseCommitResult: result [ ^ generalReader nextAs: GLHCommit ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> newParseDiffResult: result [ generalReader on: result readStream. ^ generalReader nextAs: #ArrayOfDiffs ] -{ #category : 'parsing' } +{ #category : #parsing } GLHModelImporter >> parseArrayOfProject: arrayOfProjects [ | reader | @@ -949,7 +948,7 @@ GLHModelImporter >> parseArrayOfProject: arrayOfProjects [ ^ reader nextAs: #ArrayOfProjects ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseBranchesResult: result [ | reader | @@ -962,7 +961,7 @@ GLHModelImporter >> parseBranchesResult: result [ ^ reader nextAs: #ArrayOfBranch ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseCommitResult: result [ | reader | @@ -994,7 +993,7 @@ GLHModelImporter >> parseCommitResult: result [ ^ reader nextAs: GLHCommit ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseCommitsResult: result [ | reader | @@ -1030,7 +1029,7 @@ GLHModelImporter >> parseCommitsResult: result [ ^ reader nextAs: #ArrayOfCommit ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseDiffResult: result [ | reader | @@ -1052,7 +1051,7 @@ GLHModelImporter >> parseDiffResult: result [ ^ reader nextAs: #ArrayOfDiffs ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseFileTreeResult: aResult [ | reader | @@ -1065,7 +1064,7 @@ GLHModelImporter >> parseFileTreeResult: aResult [ ^ reader nextAs: #ArrayOfFile ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseGroupResult: aResult [ | reader | @@ -1082,7 +1081,7 @@ GLHModelImporter >> parseGroupResult: aResult [ ^ reader nextAs: GLHGroup ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseJobsResult: result ofProject: aProject [ | reader | @@ -1117,7 +1116,7 @@ GLHModelImporter >> parseJobsResult: result ofProject: aProject [ ^ reader nextAs: #ArrayOfGLHJob ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parsePipelinesResult: result [ | reader | @@ -1139,7 +1138,7 @@ GLHModelImporter >> parsePipelinesResult: result [ ^ reader nextAs: #ArrayOfPipelines ] -{ #category : 'parsing' } +{ #category : #parsing } GLHModelImporter >> parseProjectResult: aResult [ | reader | reader := NeoJSONReader on: aResult readStream. @@ -1150,7 +1149,7 @@ GLHModelImporter >> parseProjectResult: aResult [ ^ reader nextAs: GLHProject ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseSubGroupResult: aResult [ | reader | @@ -1159,7 +1158,7 @@ GLHModelImporter >> parseSubGroupResult: aResult [ ^ reader nextAs: #ArrayOfGroups ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseUserResult: result [ | reader | @@ -1168,7 +1167,7 @@ GLHModelImporter >> parseUserResult: result [ ^ reader nextAs: GLHUser ] -{ #category : 'private' } +{ #category : #private } GLHModelImporter >> parseUsersResult: result [ | reader | @@ -1184,7 +1183,7 @@ GLHModelImporter >> parseUsersResult: result [ ^ reader nextAs: #ArrayOfUser ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> pipelinesOf: aProjectID [ | result | @@ -1193,14 +1192,14 @@ GLHModelImporter >> pipelinesOf: aProjectID [ ^ self parsePipelinesResult: result . ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHModelImporter >> selectEntityType: aType overAttribut: aSelector equalTo: value [ ^ (self glhModel allWithType: aType) select: [ :entity | (entity perform: aSelector) = value ] ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLHModelImporter >> subGroupsOf: aGroupID [ | results parsedResult result page | @@ -1218,7 +1217,7 @@ GLHModelImporter >> subGroupsOf: aGroupID [ ^ results ] -{ #category : 'accessing' } +{ #category : #accessing } GLHModelImporter >> withInitialCommits: boolean [ withInitialCommits := boolean ] diff --git a/src/GitLabHealth-Model-Importer/package.st b/src/GitLabHealth-Model-Importer/package.st index b63772b..25caa96 100644 --- a/src/GitLabHealth-Model-Importer/package.st +++ b/src/GitLabHealth-Model-Importer/package.st @@ -1 +1 @@ -Package { #name : 'GitLabHealth-Model-Importer' } +Package { #name : #'GitLabHealth-Model-Importer' } diff --git a/src/GitLabProjectHealth-Model-Importer/GLPHApi.class.st b/src/GitLabProjectHealth-Model-Importer/GLPHApi.class.st index a5fa7bb..7dc16f1 100644 --- a/src/GitLabProjectHealth-Model-Importer/GLPHApi.class.st +++ b/src/GitLabProjectHealth-Model-Importer/GLPHApi.class.st @@ -1,11 +1,10 @@ Class { - #name : 'GLPHApi', - #superclass : 'GLHApi', - #category : 'GitLabProjectHealth-Model-Importer', - #package : 'GitLabProjectHealth-Model-Importer' + #name : #GLPHApi, + #superclass : #GLHApi, + #category : #'GitLabProjectHealth-Model-Importer' } -{ #category : 'mergeRequest' } +{ #category : #mergeRequest } GLPHApi >> approvalsOfMergeQuest: aMergeRequestIID ofProject: aProjectId [ self client path: @@ -14,7 +13,7 @@ GLPHApi >> approvalsOfMergeQuest: aMergeRequestIID ofProject: aProjectId [ ^ self client get ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLPHApi >> commitsOfMergeRequest: mergeRequestIID ofProject: projectId page: page perPage: perPage [ self client path: @@ -29,7 +28,7 @@ GLPHApi >> commitsOfMergeRequest: mergeRequestIID ofProject: projectId page: pag ^ self client get ] -{ #category : 'commit' } +{ #category : #commit } GLPHApi >> commitsOfProject: anInteger forRefName: refName [ self @@ -54,7 +53,7 @@ GLPHApi >> commitsOfProject: anInteger forRefName: refName [ page: nil ] -{ #category : 'commits' } +{ #category : #commits } GLPHApi >> commitsOfProject: anInteger forRefName: refName since: since [ self @@ -79,7 +78,7 @@ GLPHApi >> commitsOfProject: anInteger forRefName: refName since: since [ page: nil ] -{ #category : 'commit' } +{ #category : #commit } GLPHApi >> commitsOfProject: aGLHProject forRefName: refName until: toDate [ | newlyFoundCommit page | @@ -124,7 +123,7 @@ GLPHApi >> commitsOfProject: aGLHProject forRefName: refName until: toDate [ self importDiffOfCommit: commit ] ] ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLPHApi >> diffsMergeRequestOfProject: aProjectID withId: anMRiid [ ^ self client get: @@ -132,13 +131,13 @@ GLPHApi >> diffsMergeRequestOfProject: aProjectID withId: anMRiid [ , '/merge_requests/' , anMRiid printString , '/diffs/' ] -{ #category : 'initialization' } +{ #category : #initialization } GLPHApi >> initialize [ super initialize ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLPHApi >> mergeRequestOfProject: aProjectID [ ^ self client get: @@ -146,7 +145,7 @@ GLPHApi >> mergeRequestOfProject: aProjectID [ , '/merge_requests/' ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLPHApi >> mergeRequestOfProject: aProjectID withId: anMRiid [ ^ self client get: @@ -154,7 +153,7 @@ GLPHApi >> mergeRequestOfProject: aProjectID withId: anMRiid [ , '/merge_requests/' , anMRiid printString ] -{ #category : 'mergeRequest' } +{ #category : #mergeRequest } GLPHApi >> mergeRequestsOfProject: aProjectId createdAfter: createdAfter createdBefore: createdBefore authorId: authorId authorUsername: authorUsername scope: scope orderBy: orderBy page: page [ self client path: @@ -175,14 +174,14 @@ GLPHApi >> mergeRequestsOfProject: aProjectId createdAfter: createdAfter created ^ self client get ] -{ #category : 'accessing' } +{ #category : #accessing } GLPHApi >> project: aProjectID [ ^ self client get: self baseAPIUrl , '/projects/' , aProjectID printString ] -{ #category : 'user' } +{ #category : #user } GLPHApi >> usersSearchByUsername: aUserName [ |name| diff --git a/src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st b/src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st index 711fc0a..557db89 100644 --- a/src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st +++ b/src/GitLabProjectHealth-Model-Importer/GLPHModelImporter.class.st @@ -1,11 +1,10 @@ Class { - #name : 'GLPHModelImporter', - #superclass : 'GLHModelImporter', - #category : 'GitLabProjectHealth-Model-Importer', - #package : 'GitLabProjectHealth-Model-Importer' + #name : #GLPHModelImporter, + #superclass : #GLHModelImporter, + #category : #'GitLabProjectHealth-Model-Importer' } -{ #category : 'commit' } +{ #category : #commit } GLPHModelImporter >> commitsOfProject: aGLHProject forRefName: refName until: toDate [ | newlyFoundCommit page | @@ -35,7 +34,7 @@ GLPHModelImporter >> commitsOfProject: aGLHProject forRefName: refName until: to newlyFoundCommit := parsedResults reject: [ :commitParsed | (toDate isNil or: [ commitParsed committed_date - < toDate asDateAndTime ]) or: [ + < toDate asDate asDateAndTime ]) or: [ existingCommits anySatisfy: [ :existingCommit | existingCommit id = commitParsed id ] ] ]. self glhModel addAll: newlyFoundCommit unless: self blockOnIdEquality. @@ -45,7 +44,7 @@ GLPHModelImporter >> commitsOfProject: aGLHProject forRefName: refName until: to self importDiffOfCommit: commit ] ] ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLPHModelImporter >> completeImportProject: aGLHProject [ |completedProject| completedProject := super completeImportProject: aGLHProject. @@ -59,7 +58,7 @@ GLPHModelImporter >> completeImportProject: aGLHProject [ ^ completedProject ] -{ #category : 'private - configure reader' } +{ #category : #'private - configure reader' } GLPHModelImporter >> configureReaderForMergeRequest: reader [ "declare quil y a un array a mapper" @@ -108,7 +107,7 @@ GLPHModelImporter >> configureReaderForMergeRequest: reader [ string ifNil: [ nil ] ifNotNil: [ DateAndTime fromString: string ] ] ] ] -{ #category : 'import' } +{ #category : #import } GLPHModelImporter >> importCommitsOfBranch: aGLHBranch [ | commits | @@ -128,7 +127,7 @@ GLPHModelImporter >> importCommitsOfBranch: aGLHBranch [ ] ] -{ #category : 'api' } +{ #category : #api } GLPHModelImporter >> importDiffOfCommit: aCommit [ super importDiffOfCommit: aCommit. @@ -139,7 +138,7 @@ GLPHModelImporter >> importDiffOfCommit: aCommit [ ^ aCommit diffs ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLPHModelImporter >> importDiffOfMergeRequest: aMergeRequest [ | result diffsResult | @@ -168,7 +167,7 @@ GLPHModelImporter >> importDiffOfMergeRequest: aMergeRequest [ ^ aMergeRequest diffs ] -{ #category : 'import - merge request' } +{ #category : #'import - merge request' } GLPHModelImporter >> importMergeRequestCommits: aGLPHEMergeRequest [ | results page commits parseResult | @@ -197,7 +196,7 @@ GLPHModelImporter >> importMergeRequestCommits: aGLPHEMergeRequest [ ^ commits ] -{ #category : 'import' } +{ #category : #import } GLPHModelImporter >> importMergeRequestMergeCommits: aGLPHEMergeRequest [ | foundCommits | @@ -230,7 +229,7 @@ GLPHModelImporter >> importMergeRequestMergeCommits: aGLPHEMergeRequest [ ^ foundCommits ] -{ #category : 'import - merge request' } +{ #category : #'import - merge request' } GLPHModelImporter >> importMergeRequests: aGLHProject [ | results parsedResults mrs | @@ -261,7 +260,7 @@ GLPHModelImporter >> importMergeRequests: aGLHProject [ ^ mrs ] -{ #category : 'import - merge request' } +{ #category : #'import - merge request' } GLPHModelImporter >> importMergeRequests: aGLHProject since: fromDate until: toDate [ | newlyFoundMR page foundMR | @@ -277,9 +276,9 @@ GLPHModelImporter >> importMergeRequests: aGLHProject since: fromDate until: toD results := self repoApi mergeRequestsOfProject: aGLHProject id createdAfter: - (fromDate ifNotNil: [ fromDate asDateAndTime asString ]) + (fromDate ifNotNil: [ fromDate asDate asDateAndTime asString ]) createdBefore: - (toDate ifNotNil: [ toDate asDateAndTime asString ]) + (toDate ifNotNil: [ toDate asDate asDateAndTime asString ]) authorId: nil authorUsername: nil scope: 'all' @@ -306,7 +305,7 @@ GLPHModelImporter >> importMergeRequests: aGLHProject since: fromDate until: toD ^ foundMR ] -{ #category : 'import - merge request' } +{ #category : #'import - merge request' } GLPHModelImporter >> importMergeResquestApprovals: aGLPHEMergeRequest [ | results parsedResult | @@ -328,7 +327,7 @@ GLPHModelImporter >> importMergeResquestApprovals: aGLPHEMergeRequest [ ^ aGLPHEMergeRequest ] -{ #category : 'import - merge request' } +{ #category : #'import - merge request' } GLPHModelImporter >> importMergeResquestAuthor: aGLPHEMergeRequest [ | authorID | @@ -343,7 +342,7 @@ GLPHModelImporter >> importMergeResquestAuthor: aGLPHEMergeRequest [ aGLPHEMergeRequest author: (self importUser: authorID) ] -{ #category : 'import - merge request' } +{ #category : #'import - merge request' } GLPHModelImporter >> importMergeResquestMerger: aGLPHEMergeRequest [ | authorID | @@ -362,7 +361,7 @@ GLPHModelImporter >> importMergeResquestMerger: aGLPHEMergeRequest [ aGLPHEMergeRequest merge_user: (self importUser: authorID) ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLPHModelImporter >> importProject: aProjectID [ | result projectResult | @@ -374,7 +373,7 @@ GLPHModelImporter >> importProject: aProjectID [ ^ self completeImportProject: projectResult ] -{ #category : 'private - api' } +{ #category : #'private - api' } GLPHModelImporter >> importRepository: aGLHRepository [ super importRepository: aGLHRepository. @@ -384,28 +383,28 @@ GLPHModelImporter >> importRepository: aGLHRepository [ self importCommitsOfBranch: branch ] ] ] -{ #category : 'initialization' } +{ #category : #initialization } GLPHModelImporter >> initReader [ super initReader. self configureReaderForMergeRequest: generalReader ] -{ #category : 'initialization' } +{ #category : #initialization } GLPHModelImporter >> initialize [ super initialize. withCommitDiffs := true ] -{ #category : 'parsing' } +{ #category : #parsing } GLPHModelImporter >> parseMergeRequestResult: result [ generalReader on: result readStream. ^ generalReader nextAs: #ArrayOfMergeRequest ] -{ #category : 'parsing' } +{ #category : #parsing } GLPHModelImporter >> parseProjectResult: aResult [ | reader | reader := NeoJSONReader on: aResult readStream. @@ -416,7 +415,7 @@ GLPHModelImporter >> parseProjectResult: aResult [ ^ reader nextAs: GLHProject ] -{ #category : 'accessing' } +{ #category : #accessing } GLPHModelImporter >> withCommitsSince: someDays [ "substract the current date with a given number of days. Use to retrieve the commits submit in the last giving days" @@ -427,5 +426,5 @@ GLPHModelImporter >> withCommitsSince: someDays [ (someDays isKindOf: DateAndTime) ifTrue: [ withCommitsSince := someDays ] ifFalse: [ - withCommitsSince := (Date today - someDays) asDateAndTime ] + withCommitsSince := (Date today - someDays) asDate asDateAndTime ] ] diff --git a/src/GitLabProjectHealth-Model-Importer/package.st b/src/GitLabProjectHealth-Model-Importer/package.st index 3dee3f2..2420566 100644 --- a/src/GitLabProjectHealth-Model-Importer/package.st +++ b/src/GitLabProjectHealth-Model-Importer/package.st @@ -1 +1 @@ -Package { #name : 'GitLabProjectHealth-Model-Importer' } +Package { #name : #'GitLabProjectHealth-Model-Importer' }