Skip to content

Commit

Permalink
Merge pull request #109 from moosetechnology/fix-mergedMR-metrics
Browse files Browse the repository at this point in the history
add filter to MR when they don't have merged date
  • Loading branch information
badetitou authored Nov 20, 2024
2 parents 1b73d22 + 8ab200e commit 2f02e4e
Show file tree
Hide file tree
Showing 42 changed files with 388 additions and 395 deletions.
19 changes: 19 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Verhaeghe"
given-names: "Benoit"
orcid: "https://orcid.org/0000-0002-4588-2698"
- family-names: "Hlad"
given-names: "Nicolas"
orcid: "https://orcid.org/0000-0003-4989-2508"
- family-names: "Bauvent"
given-names: "Kilian"
- family-names: "Anquetil"
given-names: "Nicolas"
orcid: "https://orcid.org/0000-0003-1486-8399"
title: "GitProjectHealth"
version: v1.1.0
doi: 10.5281/zenodo.13886504
date-released: 2024-10-24
url: "https://github.com/moosetechnology/GitProjectHealth"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![CI Moose 11](https://github.com/moosetechnology/GitProjectHealth/actions/workflows/ci-moose11.yml/badge.svg)](https://github.com/moosetechnology/GitProjectHealth/actions/workflows/ci-moose11.yml)
[![Coverage Status](https://coveralls.io/repos/github/moosetechnology/GitProjectHealth/badge.svg?branch=main)](https://coveralls.io/github/moosetechnology/GitProjectHealth?branch=main)

[![DOI](https://zenodo.org/badge/494355126.svg)](https://doi.org/10.5281/zenodo.13886504)

This project includes a model, an importer, and some visulization to evaluate the health of a GitLab or GitHub group.

Expand Down
7 changes: 3 additions & 4 deletions ci/generatePUML.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
documentor := FamixUMLDocumentor new.
documentor
model: GLPHEModel color: Color white;
model: GLHModel color: Color white;
excludeClasses: { GLHModel. TEntityMetaLevelDependency. Object . GLHEntity . GLPHEEntity . GLPHEModel . GLPHETEntityCreator . GLHTEntityCreator . GLHGroupGroup };
model: GLHModel color: Color white;
excludeClasses: { GLHModel. TEntityMetaLevelDependency. Object . GLHEntity . GLHTEntityCreator . GLHGroupGroup };
generate.

'gitproject.puml' asFileReference writeStreamDo: [ :stream |
FamixUMLPlantUMLBackend new
outputStream: stream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A MergedMergeRequestMetricTest is a test class for testing the behavior of Merge
Class {
#name : #MergedMergeRequestMetricTest,
#superclass : #TestCase,
#category : 'GitLabHealth-Model-Analysis-Tests'
#category : #'GitLabHealth-Model-Analysis-Tests'
}

{ #category : #tests }
Expand All @@ -23,7 +23,13 @@ MergedMergeRequestMetricTest >> testCalculate [
author: user;
merge_user: user;
created_at: '09-05-2024';
merged_at: '09-05-2024')
merged_at: '09-05-2024').

(GLHMergeRequest new
author: user;
merge_user: user;
created_at: '09-02-2024';
merged_at: nil)
}.


Expand Down
19 changes: 9 additions & 10 deletions src/GitLabHealth-Model-Analysis/AnalysisReport.class.st
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
Class {
#name : 'AnalysisReport',
#superclass : 'Object',
#name : #AnalysisReport,
#superclass : #Object,
#instVars : [
'period',
'over',
'metrics'
],
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'initialization' }
{ #category : #initialization }
AnalysisReport >> initialize [

metrics := Dictionary new
]

{ #category : 'accessing' }
{ #category : #accessing }
AnalysisReport >> metrics [

^ metrics
]

{ #category : 'accessing' }
{ #category : #accessing }
AnalysisReport >> over [

^ over
]

{ #category : 'accessing' }
{ #category : #accessing }
AnalysisReport >> over: anObject [

over := anObject
]

{ #category : 'accessing' }
{ #category : #accessing }
AnalysisReport >> period [

^ period
]

{ #category : 'accessing' }
{ #category : #accessing }
AnalysisReport >> period: anObject [

period := anObject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'ClosedMergeRequestMetric',
#superclass : 'UserMergeRequestMetric',
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#name : #ClosedMergeRequestMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
ClosedMergeRequestMetric >> calculate [

| groupedByDate dateOver |
Expand All @@ -28,13 +27,13 @@ ClosedMergeRequestMetric >> calculate [
^ groupedByDate average asFloat
]

{ #category : 'accessing' }
{ #category : #accessing }
ClosedMergeRequestMetric >> description [

^ 'number of closed merge requests'
]

{ #category : 'accessing' }
{ #category : #accessing }
ClosedMergeRequestMetric >> name [

^ 'closedMergeRequest'
Expand Down
13 changes: 6 additions & 7 deletions src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'ClosedTicketsMetric',
#superclass : 'UserJiraMetric',
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#name : #ClosedTicketsMetric,
#superclass : #UserJiraMetric,
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
ClosedTicketsMetric >> calculate [

| groupedByDate dateOver |
Expand All @@ -24,13 +23,13 @@ ClosedTicketsMetric >> calculate [
^ groupedByDate average asFloat
]

{ #category : 'accessing' }
{ #category : #accessing }
ClosedTicketsMetric >> description [

^ 'number of closed merge request associated with a jira ticket'
]

{ #category : 'accessing' }
{ #category : #accessing }
ClosedTicketsMetric >> name [

^ 'closedTickets'
Expand Down
13 changes: 6 additions & 7 deletions src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'CodeAdditionByMRMetric',
#superclass : 'UserMergeRequestMetric',
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#name : #CodeAdditionByMRMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
CodeAdditionByMRMetric >> calculate [

| groupedByDate dateOver |
Expand All @@ -30,13 +29,13 @@ CodeAdditionByMRMetric >> calculate [
^ groupedByDate average asFloat
]

{ #category : 'accessing' }
{ #category : #accessing }
CodeAdditionByMRMetric >> description [

^ 'average code addition by merge request'
]

{ #category : 'loading' }
{ #category : #loading }
CodeAdditionByMRMetric >> load [

userMergeRequests := self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'CodeAdditionByTicketMetric',
#superclass : 'UserJiraMetric',
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#name : #CodeAdditionByTicketMetric,
#superclass : #UserJiraMetric,
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
CodeAdditionByTicketMetric >> calculate [

| groupedByDate dateOver |
Expand All @@ -30,13 +29,13 @@ CodeAdditionByTicketMetric >> calculate [
^ groupedByDate average asFloat
]

{ #category : 'accessing' }
{ #category : #accessing }
CodeAdditionByTicketMetric >> description [

^ 'average code addition by merge request associated with a jira ticket'
]

{ #category : 'loading' }
{ #category : #loading }
CodeAdditionByTicketMetric >> load [

userMergeRequests := self
Expand Down
11 changes: 5 additions & 6 deletions src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'CodeAdditionMetric',
#superclass : 'UserCommitsMetric',
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#name : #CodeAdditionMetric,
#superclass : #UserCommitsMetric,
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
CodeAdditionMetric >> calculate [

| gitAnalyzer contributions groupedByDate |
Expand Down Expand Up @@ -37,7 +36,7 @@ CodeAdditionMetric >> calculate [
^ groupedByDate average asFloat
]

{ #category : 'accessing' }
{ #category : #accessing }
CodeAdditionMetric >> description [

^ 'code addition (avg)'
Expand Down
13 changes: 6 additions & 7 deletions src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
Class {
#name : 'CodeChurnMetric',
#superclass : 'UserCommitsMetric',
#name : #CodeChurnMetric,
#superclass : #UserCommitsMetric,
#instVars : [
'maxCommitWindow'
],
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
CodeChurnMetric >> calculate [

| commits res groupedByDate totalContributions gitAnalyzer |
Expand Down Expand Up @@ -66,13 +65,13 @@ CodeChurnMetric >> calculate [
^ (groupedByDate collect: [ :date | date at: #percentage ]) average
]

{ #category : 'accessing' }
{ #category : #accessing }
CodeChurnMetric >> description [

^ 'churn % (W=' , maxCommitWindow printString , ')'
]

{ #category : 'initialization' }
{ #category : #initialization }
CodeChurnMetric >> initialize [
maxCommitWindow := 3
]
13 changes: 6 additions & 7 deletions src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'CodeDeletionByMRMetric',
#superclass : 'UserMergeRequestMetric',
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#name : #CodeDeletionByMRMetric,
#superclass : #UserMergeRequestMetric,
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
CodeDeletionByMRMetric >> calculate [

| groupedByDate dateOver |
Expand All @@ -30,13 +29,13 @@ CodeDeletionByMRMetric >> calculate [
^ groupedByDate average asFloat
]

{ #category : 'accessing' }
{ #category : #accessing }
CodeDeletionByMRMetric >> description [

^ 'average code deletion by merge request'
]

{ #category : 'loading' }
{ #category : #loading }
CodeDeletionByMRMetric >> load [

userMergeRequests := self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'CodeDeletionByTicketMetric',
#superclass : 'UserJiraMetric',
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#name : #CodeDeletionByTicketMetric,
#superclass : #UserJiraMetric,
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
CodeDeletionByTicketMetric >> calculate [

| groupedByDate dateOver |
Expand All @@ -30,13 +29,13 @@ CodeDeletionByTicketMetric >> calculate [
^ groupedByDate average asFloat
]

{ #category : 'accessing' }
{ #category : #accessing }
CodeDeletionByTicketMetric >> description [

^ 'average code deletion by merge request associated with a jira ticket'
]

{ #category : 'loading' }
{ #category : #loading }
CodeDeletionByTicketMetric >> load [

userMergeRequests := self
Expand Down
11 changes: 5 additions & 6 deletions src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Class {
#name : 'CodeDeletionMetric',
#superclass : 'UserCommitsMetric',
#category : 'GitLabHealth-Model-Analysis',
#package : 'GitLabHealth-Model-Analysis'
#name : #CodeDeletionMetric,
#superclass : #UserCommitsMetric,
#category : 'GitLabHealth-Model-Analysis'
}

{ #category : 'calculating' }
{ #category : #calculating }
CodeDeletionMetric >> calculate [

| gitAnalyzer contributions groupedByDate |
Expand Down Expand Up @@ -37,7 +36,7 @@ CodeDeletionMetric >> calculate [
^ groupedByDate average asFloat
]

{ #category : 'accessing' }
{ #category : #accessing }
CodeDeletionMetric >> description [

^'code deletion (avg)'
Expand Down
Loading

0 comments on commit 2f02e4e

Please sign in to comment.