Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
27d2e03
remove deprecated call
badetitou Mar 31, 2026
e970e8a
remove some deprecated call to `importCommitOfProject:withId:`
badetitou Apr 1, 2026
d7651e3
Merge pull request #260 from moosetechnology/remove-deprecation
badetitou Apr 1, 2026
ec111ea
Update src/GitLabHealth-Model-Importer/GitlabModelImporter.class.st
badetitou Apr 1, 2026
27b2dde
remove wrong method
badetitou Apr 1, 2026
817c870
some test said it can be nil
badetitou Apr 1, 2026
e4bf9ed
Merge pull request #259 from moosetechnology/remove-deprecated-call
badetitou Jun 22, 2026
c79c571
fix date read in metric class
badetitou Jun 22, 2026
5d59f6e
Move to Moose13
badetitou Jun 22, 2026
4d4f4e4
groupedByDate should use date instead of printString
badetitou Jun 22, 2026
32aff47
Merge pull request #264 from moosetechnology/upgrade-to-moose-13
badetitou Jun 22, 2026
ae814ce
Merge 32aff4724936c3d0e170d10ac2f197eec3b784be
badetitou Jun 22, 2026
fcf145c
removing asDate
badetitou Jun 22, 2026
e6a2579
fix test spec
badetitou Jun 22, 2026
32044bf
organize packages dependencies for log in ci/cd
badetitou Jun 22, 2026
4cfe77b
remove more asDate
badetitou Jun 22, 2026
7407760
ignore offset explicitly for ci and local working
badetitou Jun 22, 2026
94fb18e
fix date-metrics
badetitou Jun 22, 2026
e6bbfdb
nil commit cannot be imported. A guard should return nil since the co…
badetitou Jun 23, 2026
e4f2989
add test for transformDate: date to: aWeekOrMonthOrYear
badetitou Jun 23, 2026
7aa32f5
Merge pull request #263 from moosetechnology/date-metric
badetitou Jun 24, 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
2 changes: 1 addition & 1 deletion .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Moose64-11, Moose64-12]
smalltalk: [ Moose64-12, Moose64-13 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: Moose 11
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Moose64-11 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- run: smalltalkci -s ${{ matrix.smalltalk }}
shell: bash
timeout-minutes: 15
name: Moose 13

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Moose64-13 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.

- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}

- run: smalltalkci -s ${{ matrix.smalltalk }}
shell: bash
timeout-minutes: 15
17 changes: 2 additions & 15 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ env:

on:
pull_request:
types: [assigned, opened, synchronize, reopened]
types: [ assigned, opened, synchronize, reopened ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Moose64-11, Moose64-12]
smalltalk: [ Moose64-12, Moose64-13 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
Expand All @@ -34,16 +34,3 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# autoreneraku is not ready
# - name: Generate a token
# id: generate-token
# uses: actions/create-github-app-token@v1
# with:
# app-id: ${{ secrets.AUTO_RENERAKU_APP_ID }}
# private-key: ${{ secrets.AUTO_RENERAKU_PRIVATE_KEY }}
#- name: AutoReneraku
# uses: badetitou/AutoReneraku@v1.0.10
# if: matrix.smalltalk == 'Moose64-12'
# with:
# pat: ${{ steps.generate-token.outputs.token }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GitProject health

[![Moose 11](https://github.com/moosetechnology/GitProjectHealth/actions/workflows/ci-moose11.yml/badge.svg)](https://github.com/moosetechnology/GitProjectHealth/actions/workflows/ci-moose11.yml)
[![Moose 12](https://github.com/moosetechnology/GitProjectHealth/actions/workflows/ci-moose12.yml/badge.svg)](https://github.com/moosetechnology/GitProjectHealth/actions/workflows/ci-moose12.yml)
[![Moose 13](https://github.com/moosetechnology/GitProjectHealth/actions/workflows/ci-moose13.yml/badge.svg)](https://github.com/moosetechnology/GitProjectHealth/actions/workflows/ci-moose13.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)

Expand Down
31 changes: 15 additions & 16 deletions src/BaselineOfGitLabHealth/BaselineOfGitLabHealth.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ BaselineOfGitLabHealth >> defineJiraConnector: spec [

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

"generic"

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

"gitlab"
"model"
spec
package: 'GitLabHealth-Model';
package: 'GitLabHealth-Model-Extension'
Expand All @@ -148,34 +148,33 @@ BaselineOfGitLabHealth >> definePackages: spec [
package: 'GitLabHealth-Model-Generator';
package: 'GitLabHealth-Model-Inspector'
with: [ spec requires: #( 'GitLabHealth-Model-Visualization' ) ];
package: 'GitLabHealth-Model-Visualization';
package: 'GitLabHealth-Model-Visualization'.

"Gitlab importer"
spec
package: 'GitLabHealth-Model-Importer' with: [
spec requires:
#( 'NeoJSON' 'MoreLogger' 'GitProjectHealth-Model-Importer' ) ];
package: 'GitHubHealth-Model-Importer' with: [
spec requires:
#( 'NeoJSON' 'MoreLogger' 'GitProjectHealth-Model-Importer' ) ];
#( 'NeoJSON' 'MoreLogger' 'GitlabAPI' 'GitProjectHealth-Model-Importer' ) ];
package: 'GitLabHealth-Model-Importer-Tests' with: [
spec requires:
#( 'GitLabHealth-Model-Importer' 'GitHubHealth-Model-Importer' ) ].
spec
package: 'GitLabHealth-Model-Tests'
with: [ spec requires: #( 'GitLabHealth-Model' ) ].
spec
package: 'GitHubHealth-Model-Importer-Tests'
with: [ spec requires: #( 'GitHubHealth-Model-Importer' ) ].

"Bitbucket"
spec
package: 'BitBucketHealth-Model-Importer'
with: [ spec requires: #( 'BitbucketPharoAPI' ) ];
package: 'BitBucketHealth-Model-Importer' with: [
spec requires:
#( 'BitbucketPharoAPI' 'GitProjectHealth-Model-Importer' ) ];
package: 'BitBucketHealth-Model-Importer-Tests'
with: [ spec requires: #( 'BitBucketHealth-Model-Importer' ) ].

"github"
spec
package: 'GitHubHealth-Model-Importer'
with: [ spec requires: #( 'GithubAPI' ) ];
spec
package: 'GitHubHealth-Model-Importer' with: [
spec requires:
#( 'GithubAPI' 'NeoJSON' 'MoreLogger' 'GitProjectHealth-Model-Importer' ) ];
package: 'GitHubHealth-Model-Importer-Tests'
with: [ spec requires: #( 'GitHubHealth-Model-Importer' ) ].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,38 +67,35 @@ CommitFrequencyMetricTest >> testCalculate [
CommitFrequencyMetricTest >> testCalculate1CommitByWeek [

| glhImporter result commitFrequency |

glhImporter := GLPHImporterMock new.

glhImporter commits: {
(GLHCommit new
glhImporter commits: {
(GLHCommit new
id: 1;
repository: project1 repository;
created_at: createdAt;
additions: 7;
commitCreator: user;
deletions: 5).
(GLHCommit new
(GLHCommit new
id: 2;
repository: project1 repository;
created_at: createdAt + 7 days;
additions: 7;
commitCreator: user;
deletions: 5).
(GLHCommit new
(GLHCommit new
id: 3;
repository: project1 repository;
created_at: createdAt + 7 days ;
created_at: createdAt + 7 days;
additions: 7;
commitCreator: user;
deletions: 5).
}.

deletions: 5) }.

commitFrequency := CommitFrequencyMetric new
user: user;
glhImporter: glhImporter;
setPeriodSince: createdAt asDate until: (createdAt + (7 + 7) days) asDate ;
setPeriodSince: since until: '09-18-2024';
over: Week.

"When"
Expand Down Expand Up @@ -141,8 +138,8 @@ CommitFrequencyMetricTest >> testCalculate1CommitByWeekFromAnotherUser [
commitFrequency := CommitFrequencyMetric new
user: user;
glhImporter: glhImporter;
setPeriodSince: createdAt asDate
until: (createdAt + (7 + 7) days) asDate;
setPeriodSince: since
until: '09-18-2024';
over: Week.

"When"
Expand Down
44 changes: 24 additions & 20 deletions src/GitLabHealth-Model-Analysis-Tests/GitAnalyzerLocalTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ GitAnalyzerLocalTest >> setUp [
gitAnalyzer := GitAnalyzer new onModel: glphModel.
fromCommit := GLHCommit new.
fromCommit short_id: 'testFromCommit'.
fromCommit created_at: ('3 August 2021' asDate).
"3 august 2021"
fromCommit created_at: (Date newDay: 3 month: 8 year: 2021).
glphModel add: fromCommit.
gitAnalyzer fromCommit: fromCommit.

gitAnalyzer fromCommit: fromCommit
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentContributionsJavaComment [

| diffA diffARange addition |
Expand All @@ -46,7 +47,7 @@ GitAnalyzerLocalTest >> testAnalyseCommentContributionsJavaComment [
self assert: gitAnalyzer analyseCommentContribution equals: 1
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentContributionsJavaContinueComment [

| diffA diffARange addition |
Expand All @@ -65,7 +66,7 @@ GitAnalyzerLocalTest >> testAnalyseCommentContributionsJavaContinueComment [
self assert: gitAnalyzer analyseCommentContribution equals: 1
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentContributionsJavaStopComment [

| diffA diffARange addition |
Expand All @@ -84,7 +85,7 @@ GitAnalyzerLocalTest >> testAnalyseCommentContributionsJavaStopComment [
self assert: gitAnalyzer analyseCommentContribution equals: 1
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentContributionsMixedMultipleComments [

| diffA diffARange addition additionB additionC |
Expand All @@ -111,7 +112,7 @@ GitAnalyzerLocalTest >> testAnalyseCommentContributionsMixedMultipleComments [
self assert: gitAnalyzer analyseCommentContribution equals: 2
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentContributionsMultipleComments [

| diffA diffARange addition additionB additionC |
Expand All @@ -138,7 +139,7 @@ GitAnalyzerLocalTest >> testAnalyseCommentContributionsMultipleComments [
self assert: gitAnalyzer analyseCommentContribution equals: 3
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentContributionsPythonComment [

| diffA diffARange addition |
Expand All @@ -157,7 +158,7 @@ GitAnalyzerLocalTest >> testAnalyseCommentContributionsPythonComment [
self assert: gitAnalyzer analyseCommentContribution equals: 1
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentContributionsShouldBe0 [

| diffA diffARange addition |
Expand All @@ -176,7 +177,7 @@ GitAnalyzerLocalTest >> testAnalyseCommentContributionsShouldBe0 [
self assert: gitAnalyzer analyseCommentContribution equals: 0
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentInSomeAroundCode [

| diffA diffARange addition |
Expand All @@ -195,7 +196,7 @@ GitAnalyzerLocalTest >> testAnalyseCommentInSomeAroundCode [
self assert: gitAnalyzer analyseCommentContribution equals: 0
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testAnalyseCommentNotAnAddition [

| diffA diffARange addition |
Expand All @@ -214,32 +215,35 @@ GitAnalyzerLocalTest >> testAnalyseCommentNotAnAddition [
self assert: gitAnalyzer analyseCommentContribution equals: 0
]

{ #category : #test }
{ #category : #tests }
GitAnalyzerLocalTest >> testArrangeCommitsByDate [

| commitA2 commitA3 commitB result |
| commitA2 commitA3 commitB result threeAugust fourAugust |
threeAugust := Date newDay: 3 month: 8 year: 2021.
fourAugust := Date newDay: 4 month: 8 year: 2021.

commitA2 := GLHCommit new.
commitA2 short_id: 'testFromCommit2'.
commitA2 created_at: ('3 August 2021' asDate).
commitA2 created_at: threeAugust.
glphModel add: commitA2.

commitA3 := GLHCommit new.
commitA3 short_id: 'testFromCommit3'.
commitA3 created_at: ('3 August 2021' asDate).
commitA3 created_at: threeAugust.
glphModel add: commitA3.

commitB := GLHCommit new.
commitB short_id: 'testFromCommitB'.
commitB created_at: ('4 August 2021' asDate).
commitB created_at: fourAugust.
glphModel add: commitB.

result := gitAnalyzer arrangeCommitsByDate: {
fromCommit.
commitA2.
commitA3.
commitB }.

self assert: result size equals: 2.
self assert: (result at: '3 August 2021') size equals: 3.
self assert: (result at: '4 August 2021') size equals: 1.
self assert: (result at: threeAugust) size equals: 3.
self assert: (result at: fourAugust) size equals: 1
]
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GitAnalyzerTest >> setUp [

glhImporter
importCommitsOfProject: projects first
since: since asDate
since: since
until: nil.

gitAnalyzer := GitAnalyzer new
Expand Down Expand Up @@ -106,8 +106,8 @@ GitAnalyzerTest >> testAnalyseCommitFrequencySinceUntil [
onProject: projects first;
analyseCommitFrequencySince: from asDate until: since asDate.

self assert: (res at: from) size equals: 1.
self assert: (res at: '14 May 2024') size equals: 4
self assert: (res values at: 1) size equals: 1.
self assert: (res values at: 2) size equals: 4
]

{ #category : #tests }
Expand Down
Loading
Loading