Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
ee6e471
begin local importer
badetitou Aug 5, 2026
78bce6e
chain the commit
badetitou Aug 5, 2026
240cf32
can import git patch
badetitou Aug 6, 2026
b8fa838
organize tests parse diff
badetitou Aug 6, 2026
f96edfe
add String allButFirstLines utility
badetitou Aug 6, 2026
521150e
add test
badetitou Aug 6, 2026
6adc18e
refix tests
badetitou Aug 6, 2026
c1b7b05
introducing addAll:keyedBy: that check key to not readd element.
badetitou Aug 6, 2026
32b5d2a
Update GitModelImporter.class.st
badetitou Aug 6, 2026
dfec645
add local importer in baseline
badetitou Aug 6, 2026
f830c33
optimize load diff
badetitou Aug 7, 2026
362b712
can import files of branches
badetitou Aug 7, 2026
7dc4f57
link commit diff files to file if possible
badetitou Aug 7, 2026
b78c259
begin work on DOA
badetitou Aug 10, 2026
5055825
A file can be referenced by several diffs (when we have several commi…
badetitou Aug 10, 2026
2fe0843
poc finished
badetitou Aug 10, 2026
34b0b9f
handle error
badetitou Aug 11, 2026
954456f
assumption first author to modify a file is the creator of this file
badetitou Aug 11, 2026
76aeb07
fix add commits to repository at the end
badetitou Aug 12, 2026
8ab9d8c
add a withDiffRanges for not loading all sometimes;..
badetitou Aug 12, 2026
e7b300b
fix importUserByCommit
badetitou Aug 13, 2026
5ad0fe8
add tests for file import to avoid file importation duplication
badetitou Aug 18, 2026
700aae0
replicate compute truck factor
badetitou Aug 21, 2026
299f95d
add additionnal tests in baseline
badetitou Aug 21, 2026
12c4f58
Merge pull request #265 from moosetechnology/local-importer
badetitou Aug 24, 2026
86a5501
fix order diff is made between local commit to not invert add and re…
badetitou Aug 24, 2026
08b1e86
can retrieve renamed file in local git import
badetitou Aug 24, 2026
3d7ceef
add git bridge for test support
badetitou Aug 25, 2026
42fefc8
introducing test resources to test with reald git folder
badetitou Aug 26, 2026
c4d6d48
add two tests
badetitou Aug 26, 2026
55b0994
clean code
badetitou Aug 26, 2026
eb0afc4
pushing test resource
badetitou Aug 26, 2026
16113df
use git entries instead of filesystem to avoid importing useless files
badetitou Aug 26, 2026
6bab84c
update test resources
badetitou Aug 26, 2026
33cde50
we use tests with test resource that is more direct to the approach
badetitou Aug 26, 2026
688177e
fix test famix connector
badetitou Aug 27, 2026
25e8057
Merge pull request #266 from moosetechnology/fix-issue-diff
badetitou Aug 28, 2026
71f2554
fix: source file name comparison
NicolasAnquetil Aug 28, 2026
4f57ec1
Merge pull request #269 from moosetechnology/267-GPCGitToFamixConnect…
badetitou Aug 28, 2026
97138ae
refactor: automatic refactor of deprecated call
NicolasAnquetil Aug 31, 2026
b361dbf
fix: made safeguard against empty sourceAnchor more generic in GPCGit…
NicolasAnquetil Aug 31, 2026
107be74
fix: rolling back automatic deprecated rewritting as it does not comp…
NicolasAnquetil Aug 31, 2026
94d74f7
Merge pull request #271 from moosetechnology/fix/empty-anchor-in-fami…
badetitou Aug 31, 2026
a93c667
use loadAllBranches instead of a wrongly saying loadAllBranchesSinceU…
badetitou Aug 31, 2026
006ef94
implementing a working version of load branches since until
badetitou Aug 31, 2026
1a9b16a
use committed date that is more accurate to last update of commit as …
badetitou Aug 31, 2026
5fd27af
Merge pull request #273 from moosetechnology/load-all-branches
badetitou Aug 31, 2026
a1c423f
fix: fix #274
NicolasAnquetil Sep 1, 2026
aa27910
remove useless comment
badetitou Sep 1, 2026
1faefae
fix: Corrected import of github projects, the status of the pipeline …
NicolasAnquetil Sep 1, 2026
c25fa04
remove deprecated method
badetitou Sep 1, 2026
8f9bfd1
clean deprecated methods
badetitou Sep 1, 2026
7080147
Merge pull request #278 from moosetechnology/274-Broken-Group-quality…
badetitou Sep 1, 2026
9dab92c
Add MIT License file
badetitou Sep 3, 2026
21c483d
Merge pull request #281 from moosetechnology/badetitou-patch-1
badetitou Sep 3, 2026
faa6561
explore all branches and avoid re-exploring commits already explored …
badetitou Sep 3, 2026
cae228f
don't mess with branch name as pharo do
badetitou Sep 4, 2026
29294aa
Merge pull request #279 from moosetechnology/276-Group-Qualitytab-in-…
badetitou Sep 4, 2026
569f3a6
need to chain commit early to enable diff parsing
badetitou Sep 4, 2026
f587eaf
only compute diff once (even in multibranch cases)
badetitou Sep 4, 2026
bb5c942
add tests
badetitou Sep 4, 2026
fe24813
update test resource
badetitou Sep 4, 2026
b1b6fa1
testSameHeadCommitForTwoBranches is a bug
badetitou Sep 4, 2026
d8cbebe
update resource
badetitou Sep 4, 2026
5bd1dd0
remove halt
badetitou Sep 4, 2026
17e69df
fix duplicated commit when importing
badetitou Sep 4, 2026
d26fd7c
Merge pull request #282 from moosetechnology/local-multi-branch
badetitou Sep 4, 2026
ae09a9b
update mock since it has been deprecated
badetitou Sep 7, 2026
34fb351
Merge pull request #280 from moosetechnology/load-all-branches
badetitou Sep 7, 2026
7b08a3a
Start infrastructure mixed model importer
badetitou Sep 7, 2026
a9ca388
clone automatically the repo
badetitou Sep 8, 2026
02f12a9
work on tags, diffs, notes, import commit selection
badetitou Sep 9, 2026
b789a13
we will need to update the metamodel
badetitou Sep 9, 2026
8859aaa
a commit can have several tags
badetitou Sep 9, 2026
38c294f
remove deprecated stuff that no one use anymore
badetitou Sep 9, 2026
ee9ada4
kill random failing test
badetitou Sep 9, 2026
4f92918
fix importBranchesOfRepository: to work even with not checkouting all…
badetitou Sep 9, 2026
0687001
better retrieve name of remote branches
badetitou Sep 10, 2026
c737c8b
add helper method to explore branches of commit
badetitou Sep 11, 2026
8cf19f3
wrong add method call to collection
badetitou Sep 11, 2026
2be49b5
do not import already imported information
badetitou Sep 29, 2026
164554a
add test for local importer (and rename test class)
badetitou Sep 29, 2026
910f678
fix test
badetitou Sep 29, 2026
100f367
Merge pull request #285 from moosetechnology/mixed-importer
badetitou Sep 29, 2026
3ee416f
add mixed importer in the baseline
badetitou Oct 1, 2026
1670e8a
Merge pull request #287 from moosetechnology/mixed-importer
badetitou Oct 1, 2026
c2a0cb6
LICENCE
badetitou Oct 1, 2026
c6ececa
Merge pull request #288 from moosetechnology/licence
badetitou Oct 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Moosetechnology

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Binary file added res/testResource.zip
Binary file not shown.
44 changes: 35 additions & 9 deletions src/BaselineOfGitLabHealth/BaselineOfGitLabHealth.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ BaselineOfGitLabHealth >> defineDependencies: spec [

spec
baseline: 'GitlabAPI'
with: [
spec repository: 'github://Evref-BL/Gitlab-Pharo-API:main' ].

spec
with: [ spec repository: 'github://Evref-BL/Gitlab-Pharo-API:main' ].

spec
baseline: 'GithubAPI'
with: [
spec repository: 'github://Evref-BL/github-Pharo-API:main' ].
with: [ spec repository: 'github://Evref-BL/github-Pharo-API:main' ].

spec
baseline: 'BitbucketPharoAPI'
with: [
spec repository: 'github://Evref-BL/Bitbucket-Pharo-API:main' ]
spec repository: 'github://Evref-BL/Bitbucket-Pharo-API:main' ].
spec
baseline: 'GitBridge'
with: [ spec repository: 'github://jecisc/GitBridge:v1.0.2/src' ]
]

{ #category : #baselines }
Expand Down Expand Up @@ -102,7 +103,10 @@ BaselineOfGitLabHealth >> defineGroups: spec [
'GitLabHealth-Visualization' 'GitLabProjectHealth-Model-Importer'
'GitProjectHealth-Model-Importer-Tests'
'BitBucketHealth-Model-Importer'
'BitBucketHealth-Model-Importer-Tests' ).
'BitBucketHealth-Model-Importer-Tests'
'GitProjectHealth-Model-LocalImporter'
'GitProjectHealth-Model-LocalImporter-Tests'
'GitProjectHealth-Model-MixedImporter' ).
spec group: 'default' with: #( 'Core' )
]

Expand All @@ -129,15 +133,22 @@ BaselineOfGitLabHealth >> defineJiraConnector: spec [

{ #category : #baselines }
BaselineOfGitLabHealth >> definePackages: spec [

"generic"

spec
package: 'GitProjectHealth-Model-Importer'
with: [ spec requires: #( 'GitLabHealth-Model' ) ].
spec
package: 'GitProjectHealth-Model-Importer-Tests'
with: [ spec requires: #( 'GitProjectHealth-Model-Importer' ) ].

"test utility"
spec
package: 'GitProjectHealth-Bridge'
with: [ spec requires: #( 'GitBridge' ) ].



"model"
spec
package: 'GitLabHealth-Model';
Expand Down Expand Up @@ -178,6 +189,21 @@ BaselineOfGitLabHealth >> definePackages: spec [
package: 'GitHubHealth-Model-Importer-Tests'
with: [ spec requires: #( 'GitHubHealth-Model-Importer' ) ].

"local"
spec package: 'GitProjectHealth-Model-LocalImporter' with: [
spec requires:
#( 'GitProjectHealth-Model-Importer'
'GitLabHealth-Model-Extension' ) ].
"mixed"
spec
package: 'GitProjectHealth-Model-MixedImporter'
with: [ spec requires: #( 'GitProjectHealth-Model-Importer' ) ].



spec package: 'GitProjectHealth-Model-LocalImporter-Tests' with: [
spec requires: #( 'GitProjectHealth-Model-LocalImporter'
'GitProjectHealth-Bridge' ) ].

"model extension"
spec
Expand Down
15 changes: 0 additions & 15 deletions src/BitBucketHealth-Model-Importer/BitBucketModelImporter.class.st
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
Class {
#name : #BitBucketModelImporter,
#superclass : #GitModelImporter,
#instVars : [
'withInitialCommits'
],
#category : #'BitBucketHealth-Model-Importer'
}

Expand Down Expand Up @@ -754,15 +751,3 @@ BitBucketModelImporter >> parseUserIntoGLHUser: userDictionnary [
id: (userDictionnary at: #id);
username: (userDictionnary at: #name)
]

{ #category : #accessing }
BitBucketModelImporter >> withInitialCommits [

^ withInitialCommits
]

{ #category : #accessing }
BitBucketModelImporter >> withInitialCommits: anObject [

withInitialCommits := anObject
]
34 changes: 26 additions & 8 deletions src/GitHubHealth-Model-Importer/GithubModelImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ GithubModelImporter >> completeImportedProject: aGLHProject [
aGLHProject repository: GLHRepository new.
self glhModel add: aGLHProject repository.

self importPipelinesOfProject: aGLHProject.
self importBranchesOf: aGLHProject.
self importAllPipelinesOfProject: aGLHProject.
self importBranchesOfProject: aGLHProject.
self withCommitsSince ifNotNil: [ :withCommitSince | "If not nil, it means we have to import commit"
| commits |
commits := self importCommitsOfProject: aGLHProject.
Expand Down Expand Up @@ -271,7 +271,6 @@ GithubModelImporter >> configureReaderForPipeline: reader [
reader
for: GLHPipeline
do: [ :mapping | "mapping mapInstVar: #status to: #conclusion."

(mapping mapInstVar: #created_at) valueSchema: DateAndTime.
(mapping mapInstVar: #updated_at) valueSchema: DateAndTime.

Expand All @@ -286,8 +285,7 @@ GithubModelImporter >> configureReaderForPipeline: reader [
mapProperty: #conclusion
getter: [ :object | #ignore ]
setter: [ :object :value |
(object status isNil and: [ value isNotNil ]) ifTrue: [
object status: value ] ].
value ifNotNil: [ object status: value ] ].

mapping
mapProperty: #run_started_at
Expand Down Expand Up @@ -343,6 +341,20 @@ GithubModelImporter >> ensureGroupNamed: aGroupName [
ifNone: [ self glhModel newGroupNamed: aGroupName ]
]

{ #category : #'import - pipelines' }
GithubModelImporter >> importAllPipelinesOfProject: project [

"add the pipeline (actions runs) in the project"

| pipelinesResult ghApiPipelineOverview |
pipelinesResult := self repoApi actions
getLatestForRepo: project name
ofOwner: project group name.
ghApiPipelineOverview := self parsePipelinesResult: pipelinesResult.
ghApiPipelineOverview workflow_runs do: [ :pipeline |
project addPipeline: pipeline ]
]

{ #category : #'import - branches' }
GithubModelImporter >> importBranchesOf: aGLHProject [
"add the pipeline (actions runs) in the project"
Expand Down Expand Up @@ -379,7 +391,7 @@ GithubModelImporter >> importBranchesOf: aGLHProject [
^ branches
]

{ #category : #'import - repositories' }
{ #category : #'import - branches' }
GithubModelImporter >> importBranchesOfProject: aGLHProject [
"add the pipeline (actions runs) in the project"

Expand Down Expand Up @@ -817,15 +829,21 @@ GithubModelImporter >> importPipelinesOfMergeRequest: aGLHMergeRequest [

{ #category : #'import - pipelines' }
GithubModelImporter >> importPipelinesOfProject: project [

"add the pipeline (actions runs) in the project"

| pipelinesResult ghApiPipelineOverview |
self
deprecated:
'Use importAllPipelinesOfProject: instead of current one'
on: '1 September 2026'
in:
'Pharo-12.0.0+SNAPSHOT.build.1571.sha.cf5fcd22e66957962c97dffc58b0393b7f368147 (64 Bit)'.

pipelinesResult := self repoApi actions
getLatestForRepo: project name
ofOwner: project group name.
ghApiPipelineOverview := self parsePipelinesResult: pipelinesResult.
ghApiPipelineOverview workflow_runs do: [ :pipeline |
ghApiPipelineOverview workflow_runs do: [ :pipeline |
project addPipeline: pipeline ]
]

Expand Down
11 changes: 9 additions & 2 deletions src/GitLabHealth-Model-Analysis-Tests/GLPHImporterMock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ GLPHImporterMock >> glhModel: anObject [
]

{ #category : #'import - repositories' }
GLPHImporterMock >> importBranchesOf: aGLHProject [
^ aGLHProject repository branches .
GLPHImporterMock >> importBranchesOf: aGLHProject [

self deprecated: #'It has been deprecated'
]

{ #category : #'import - repositories' }
GLPHImporterMock >> importBranchesOfProject: aGLHProject [

^ aGLHProject repository branches
]

{ #category : #'import - commits' }
Expand Down
33 changes: 18 additions & 15 deletions src/GitLabHealth-Model-Analysis-Tests/GitAnalyzerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,19 @@ GitAnalyzerTest >> testAnalyseAmandment [
mondayCommit -> tuesdayCommit -> wednesdayCommit
"
wednesdayCommit := glhImporter
importCommitOfProject: projects first
withId:
'f298ec312f81032b611a890f993d98096ab3bbc1'.
importCommit:
'f298ec312f81032b611a890f993d98096ab3bbc1'
ofProject: projects first.

mondayCommit := glhImporter
importCommitOfProject: projects first
withId: '8a6f665118e6fcfa468d7cce1a7e944ba65812ab'.
importCommit:
'8a6f665118e6fcfa468d7cce1a7e944ba65812ab'
ofProject: projects first.

tuesdayCommit := glhImporter
importCommitOfProject: projects first
withId: '2c7308c727560dd425ef78f9a95ca7650d164bed'.
importCommit:
'2c7308c727560dd425ef78f9a95ca7650d164bed'
ofProject: projects first.

myCommits := {
mondayCommit.
Expand Down Expand Up @@ -135,18 +137,19 @@ GitAnalyzerTest >> testChurnMetric [

"commit chain: mondayCommit -> tuesdayCommit -> wednesdayCommit "
wednesdayCommit := glhImporter
importCommitOfProject: projects first
withId:
'f298ec312f81032b611a890f993d98096ab3bbc1'.
importCommit:
'f298ec312f81032b611a890f993d98096ab3bbc1'
ofProject: projects first.

mondayCommit := glhImporter
importCommitOfProject: projects first
withId: '8a6f665118e6fcfa468d7cce1a7e944ba65812ab'.
importCommit:
'8a6f665118e6fcfa468d7cce1a7e944ba65812ab'
ofProject: projects first.

tuesdayCommit := glhImporter
importCommitOfProject: projects first
withId: '2c7308c727560dd425ef78f9a95ca7650d164bed'.

importCommit:
'2c7308c727560dd425ef78f9a95ca7650d164bed'
ofProject: projects first.

myCommits := {
mondayCommit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,5 @@ ActiveBranchesProjectMetric >> description [
{ #category : #loading }
ActiveBranchesProjectMetric >> load [

^ projectBranches := self
loadBranchesSince: (period at: #since)
until: (period at: #until)
^ projectBranches := self loadAllBranches
]
26 changes: 26 additions & 0 deletions src/GitLabHealth-Model-Analysis/GLHFile.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Extension { #name : #GLHFile }

{ #category : #'*GitLabHealth-Model-Analysis' }
GLHFile >> degreeOfAuthorship [

^ GLPDegreeOfAuthorshipAnalyzer new
glhFile: self;
compute
]

{ #category : #'*GitLabHealth-Model-Analysis' }
GLHFile >> degreeOfAuthorshipAuthors [
"the most restrictive computation"

^ GLPDegreeOfAuthorshipAnalyzer new
glhFile: self;
computeFileAuthors
]

{ #category : #'*GitLabHealth-Model-Analysis' }
GLHFile >> mainAuthor [

^ (GLPDegreeOfAuthorshipAnalyzer new
glhFile: self;
compute)
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"
Given a `GLHFile` I provide the normalized DOA values with their user.
I also provide an utility that filters the one considered as real author based on k = 0.75

(value comes from the [A Novel Approach for Estimating Truck Factors](https://arxiv.org/pdf/1604.06766) research paper)
"
Class {
#name : #GLPDegreeOfAuthorshipAnalyzer,
#superclass : #Object,
#instVars : [
'glhFile',
'rawResults',
'normalizedResults'
],
#category : #'GitLabHealth-Model-Analysis-TruckFactor'
}

{ #category : #accessing }
GLPDegreeOfAuthorshipAnalyzer >> authorshipThreshold [

^ 0.75
]

{ #category : #accessing }
GLPDegreeOfAuthorshipAnalyzer >> baseKnowledge [

^ 3.293
]

{ #category : #accessing }
GLPDegreeOfAuthorshipAnalyzer >> compute [

| authors |
authors := self glhFile diffs
collect: [ :diff | diff commit commitCreator ]
as: Set.
rawResults := (self glhFile mooseModel allWithType: GLHUser)
collect: [ :author |
author -> (GLPUserDegreeOfAuthorshipAnalyzer new
glhFile: self glhFile;
glhUser: author;
compute) ]
as: Dictionary.
normalizedResults := AIMinMaxNormalizer new normalize: rawResults.
^ normalizedResults
]

{ #category : #accessing }
GLPDegreeOfAuthorshipAnalyzer >> computeFileAuthors [
"we consider a developer as an author of a file if its resulting normalized DOA is greater than a threshold k and its absolute DOA is not lower than a value m."

^ self compute associationsSelect: [ :assoc |
assoc value >= self authorshipThreshold and: [
(rawResults at: assoc key) >= self baseKnowledge ] ]
]

{ #category : #accessing }
GLPDegreeOfAuthorshipAnalyzer >> glhFile [

^ glhFile
]

{ #category : #accessing }
GLPDegreeOfAuthorshipAnalyzer >> glhFile: anObject [

glhFile := anObject
]
Loading
Loading