Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a default json parameter to the gitlab importer (for compatibilit… #161

Merged
merged 6 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
88 changes: 44 additions & 44 deletions src/GitLabHealth-Model-Extension/GLHChange.extension.st
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
Extension { #name : #GLHChange }
{ #category : #'*GitLabHealth-Model-Extension' }
GLHChange class >> createFrom: aDiffLine [
"Factory a Change from a loc"
| aChange |
aChange := nil.
(aDiffLine beginsWith: #'@@') ifTrue: [
| infos |
aChange := GLHLineOfCode newFromLoCRange: aDiffLine.
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
infos := aDiffLine splitOn: ' ' ].
^ aChange
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHChange >> name [
^ sourceCode
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHChange class >> newFrom: aDiffLine [
"Factory a Change from a loc"
| aChange trimedLine code |
trimedLine := aDiffLine trim.
aChange := (trimedLine beginsWith: #+)
ifTrue: [ GLHAddition new ]
ifFalse: [
(aDiffLine trim beginsWith: #-)
ifTrue: [ GLHDeletion new ]
ifFalse: [ GLHLineOfCode new ] ].
code := aDiffLine.
(trimedLine beginsWith: #'@@') ifTrue: [
code := (trimedLine splitOn: '@@') copyWithoutFirst second ].
aChange sourceCode: code.
^ aChange
]
Extension { #name : #GLHChange }

{ #category : #'*GitLabHealth-Model-Extension' }
GLHChange class >> createFrom: aDiffLine [
"Factory a Change from a loc"

| aChange |
aChange := nil.
(aDiffLine beginsWith: #'@@') ifTrue: [
| infos |
aChange := GLHLineOfCode newFromLoCRange: aDiffLine.

infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
infos := aDiffLine splitOn: ' ' ].
^ aChange
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHChange >> name [

^ sourceCode
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHChange class >> newFrom: aDiffLine [
"Factory a Change from a loc"

| aChange trimedLine code |
trimedLine := aDiffLine trim.

aChange := (trimedLine beginsWith: #+)
ifTrue: [ GLHAddition new ]
ifFalse: [
(aDiffLine trim beginsWith: #-)
ifTrue: [ GLHDeletion new ]
ifFalse: [ GLHLineOfCode new ] ].

code := aDiffLine.
(trimedLine beginsWith: #'@@') ifTrue: [
code := (trimedLine splitOn: '@@') copyWithoutFirst second ].
aChange sourceCode: code.

^ aChange
]
106 changes: 53 additions & 53 deletions src/GitLabHealth-Model-Extension/GLHCommit.extension.st
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
Extension { #name : #GLHCommit }
{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> computeChurnForMaxCommits: aLimit [
^ GitAnalyzer new
fromCommit: self;
maxChildCommit: aLimit;
analyseChurn
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> displayStringOn: aStream [
aStream
<< (self short_id ifNil: [ self id first: 7 ]);
<< ' ';
<< self message
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> inspectionGLHCommitChildren [
<inspectorPresentationOrder: 3 title: 'Commits Tree'>
| canvas |
canvas := RSCommit canvasCompleteHierachyFor: self.
^ canvas asPresenter
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> inspectionGLHCommitFileImpacts [
<inspectorPresentationOrder: 3 title: 'File Impact'>
| canvas |
canvas := RSCommit canvasDiffImpactFor: self.
^ canvas asPresenter
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> mooseNameOn: stream [
message ifNotNil: [ :mess | stream nextPutAll: mess ] ifNil: [
stream
nextPutAll: 'Commit#';
nextPutAll: (short_id ifNil: [ 'unknow id' ]) ]
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> parent_ids [
^ parent_ids
]
Extension { #name : #GLHCommit }

{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> computeChurnForMaxCommits: aLimit [

^ GitAnalyzer new
fromCommit: self;
maxChildCommit: aLimit;
analyseChurn
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> displayStringOn: aStream [

aStream
<< (self short_id ifNil: [ self id first: 7 ]);
<< ' ';
<< self message
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> inspectionGLHCommitChildren [

<inspectorPresentationOrder: 3 title: 'Commits Tree'>
| canvas |
canvas := RSCommit canvasCompleteHierachyFor: self.

^ canvas asPresenter
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> inspectionGLHCommitFileImpacts [

<inspectorPresentationOrder: 3 title: 'File Impact'>
| canvas |
canvas := RSCommit canvasDiffImpactFor: self.

^ canvas asPresenter
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> mooseNameOn: stream [
message ifNotNil: [ :mess | stream nextPutAll: mess ] ifNil: [
stream
nextPutAll: 'Commit#';
nextPutAll: (short_id ifNil: [ 'unknow id' ]) ]
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHCommit >> parent_ids [

^ parent_ids
]
16 changes: 8 additions & 8 deletions src/GitLabHealth-Model-Extension/GLHDiff.extension.st
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Extension { #name : #GLHDiff }
{ #category : #'*GitLabHealth-Model-Extension' }
GLHDiff >> name [
<FMProperty: #name type: #String>
^ new_path contractTo: 100
]
Extension { #name : #GLHDiff }

{ #category : #'*GitLabHealth-Model-Extension' }
GLHDiff >> name [

<FMProperty: #name type: #String>
^ new_path ifNotNil: [:string | string contractTo: 100]
]
40 changes: 20 additions & 20 deletions src/GitLabHealth-Model-Extension/GLHDiffRange.extension.st
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Extension { #name : #GLHDiffRange }
{ #category : #'*GitLabHealth-Model-Extension' }
GLHDiffRange >> name [
^ '[ OG: ' , originalLineRange , ' | NEW: ' , newLineRange , ']'
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHDiffRange class >> newFrom: aLine [
| range infos rangesInfo |
range := GLHDiffRange new.
infos := (aLine splitOn: '@@') second.
rangesInfo := infos trim splitOn: ' '.
range originalLineRange: rangesInfo first.
range newLineRange: rangesInfo second.
^ range
]
Extension { #name : #GLHDiffRange }

{ #category : #'*GitLabHealth-Model-Extension' }
GLHDiffRange >> name [

^ '[ OG: ' , originalLineRange , ' | NEW: ' , newLineRange , ']'
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHDiffRange class >> newFrom: aLine [

| range infos rangesInfo |
range := GLHDiffRange new.
infos := (aLine splitOn: '@@') second.
rangesInfo := infos trim splitOn: ' '.
range originalLineRange: rangesInfo first.
range newLineRange: rangesInfo second.

^ range
]
18 changes: 9 additions & 9 deletions src/GitLabHealth-Model-Extension/GLHFile.extension.st
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Extension { #name : #GLHFile }
{ #category : #'*GitLabHealth-Model-Extension' }
GLHFile >> path [
^ (self directoryOwner
ifNotNil: [ :owner | owner path , '/' ]
ifNil: [ '' ]) , self name
]
Extension { #name : #GLHFile }

{ #category : #'*GitLabHealth-Model-Extension' }
GLHFile >> path [

^ (self directoryOwner
ifNotNil: [ :owner | owner path , '/' ]
ifNil: [ '' ]) , self name
]
14 changes: 7 additions & 7 deletions src/GitLabHealth-Model-Extension/GLHGroup.extension.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Extension { #name : #GLHGroup }
{ #category : #'*GitLabHealth-Model-Extension' }
GLHGroup >> allProjectstoScope [
"return the all the projects and subprojects of this group"
^ self toScope: GLHProject
]
Extension { #name : #GLHGroup }

{ #category : #'*GitLabHealth-Model-Extension' }
GLHGroup >> allProjectstoScope [
"return the all the projects and subprojects of this group"
^ self toScope: GLHProject
]
46 changes: 23 additions & 23 deletions src/GitLabHealth-Model-Extension/GLHLineOfCode.extension.st
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Extension { #name : #GLHLineOfCode }
{ #category : #'*GitLabHealth-Model-Extension' }
GLHLineOfCode class >> newFrom: aDiffLine [
| aLoC infos |
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
aLoC := GLHLineOfCode new.
aLoC sourceCode: infos second.
^ aLoC
]
{ #category : #'*GitLabHealth-Model-Extension' }
GLHLineOfCode class >> newFromLoCRange: aDiffLine [
| aLoC infos ranges |
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
ranges := infos first splitOn: ','.
aLoC := GLHLineOfCode new.
aLoC originalLineRange: ranges first.
aLoC newLineRange: 1.
aLoC lineOfCode: infos second
]
Extension { #name : #GLHLineOfCode }

{ #category : #'*GitLabHealth-Model-Extension' }
GLHLineOfCode class >> newFrom: aDiffLine [

| aLoC infos |
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
aLoC := GLHLineOfCode new.
aLoC sourceCode: infos second.
^ aLoC
]

{ #category : #'*GitLabHealth-Model-Extension' }
GLHLineOfCode class >> newFromLoCRange: aDiffLine [

| aLoC infos ranges |
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
ranges := infos first splitOn: ','.
aLoC := GLHLineOfCode new.
aLoC originalLineRange: ranges first.
aLoC newLineRange: 1.
aLoC lineOfCode: infos second
]
20 changes: 10 additions & 10 deletions src/GitLabHealth-Model-Extension/GLHProject.extension.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Extension { #name : #GLHProject }
{ #category : #'*GitLabHealth-Model-Extension' }
GLHProject >> projectContributorsInspector: aBuilder [
<inspectorPresentationOrder: 100 title: 'Contributors'>
^ SpRoassalInspectorPresenter new
canvas: (GLHProjectContributorVisualization new forProject: self );
yourself
]
Extension { #name : #GLHProject }

{ #category : #'*GitLabHealth-Model-Extension' }
GLHProject >> projectContributorsInspector: aBuilder [

<inspectorPresentationOrder: 100 title: 'Contributors'>
^ SpRoassalInspectorPresenter new
canvas: (GLHProjectContributorVisualization new forProject: self );
yourself
]
Loading