Skip to content

Commit 90730f9

Browse files
authored
Merge pull request #161 from moosetechnology/fixing-api-import-json
add a default json parameter to the gitlab importer (for compatibilit…
2 parents 9ca4ad1 + 59bf51d commit 90730f9

26 files changed

+885
-850
lines changed
+44-44
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
Extension { #name : #GLHChange }
2-
3-
{ #category : #'*GitLabHealth-Model-Extension' }
4-
GLHChange class >> createFrom: aDiffLine [
5-
"Factory a Change from a loc"
6-
7-
| aChange |
8-
aChange := nil.
9-
(aDiffLine beginsWith: #'@@') ifTrue: [
10-
| infos |
11-
aChange := GLHLineOfCode newFromLoCRange: aDiffLine.
12-
13-
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
14-
infos := aDiffLine splitOn: ' ' ].
15-
^ aChange
16-
]
17-
18-
{ #category : #'*GitLabHealth-Model-Extension' }
19-
GLHChange >> name [
20-
21-
^ sourceCode
22-
]
23-
24-
{ #category : #'*GitLabHealth-Model-Extension' }
25-
GLHChange class >> newFrom: aDiffLine [
26-
"Factory a Change from a loc"
27-
28-
| aChange trimedLine code |
29-
trimedLine := aDiffLine trim.
30-
31-
aChange := (trimedLine beginsWith: #+)
32-
ifTrue: [ GLHAddition new ]
33-
ifFalse: [
34-
(aDiffLine trim beginsWith: #-)
35-
ifTrue: [ GLHDeletion new ]
36-
ifFalse: [ GLHLineOfCode new ] ].
37-
38-
code := aDiffLine.
39-
(trimedLine beginsWith: #'@@') ifTrue: [
40-
code := (trimedLine splitOn: '@@') copyWithoutFirst second ].
41-
aChange sourceCode: code.
42-
43-
^ aChange
44-
]
1+
Extension { #name : #GLHChange }
2+
3+
{ #category : #'*GitLabHealth-Model-Extension' }
4+
GLHChange class >> createFrom: aDiffLine [
5+
"Factory a Change from a loc"
6+
7+
| aChange |
8+
aChange := nil.
9+
(aDiffLine beginsWith: #'@@') ifTrue: [
10+
| infos |
11+
aChange := GLHLineOfCode newFromLoCRange: aDiffLine.
12+
13+
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
14+
infos := aDiffLine splitOn: ' ' ].
15+
^ aChange
16+
]
17+
18+
{ #category : #'*GitLabHealth-Model-Extension' }
19+
GLHChange >> name [
20+
21+
^ sourceCode
22+
]
23+
24+
{ #category : #'*GitLabHealth-Model-Extension' }
25+
GLHChange class >> newFrom: aDiffLine [
26+
"Factory a Change from a loc"
27+
28+
| aChange trimedLine code |
29+
trimedLine := aDiffLine trim.
30+
31+
aChange := (trimedLine beginsWith: #+)
32+
ifTrue: [ GLHAddition new ]
33+
ifFalse: [
34+
(aDiffLine trim beginsWith: #-)
35+
ifTrue: [ GLHDeletion new ]
36+
ifFalse: [ GLHLineOfCode new ] ].
37+
38+
code := aDiffLine.
39+
(trimedLine beginsWith: #'@@') ifTrue: [
40+
code := (trimedLine splitOn: '@@') copyWithoutFirst second ].
41+
aChange sourceCode: code.
42+
43+
^ aChange
44+
]
+53-53
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
Extension { #name : #GLHCommit }
2-
3-
{ #category : #'*GitLabHealth-Model-Extension' }
4-
GLHCommit >> computeChurnForMaxCommits: aLimit [
5-
6-
^ GitAnalyzer new
7-
fromCommit: self;
8-
maxChildCommit: aLimit;
9-
analyseChurn
10-
]
11-
12-
{ #category : #'*GitLabHealth-Model-Extension' }
13-
GLHCommit >> displayStringOn: aStream [
14-
15-
aStream
16-
<< (self short_id ifNil: [ self id first: 7 ]);
17-
<< ' ';
18-
<< self message
19-
]
20-
21-
{ #category : #'*GitLabHealth-Model-Extension' }
22-
GLHCommit >> inspectionGLHCommitChildren [
23-
24-
<inspectorPresentationOrder: 3 title: 'Commits Tree'>
25-
| canvas |
26-
canvas := RSCommit canvasCompleteHierachyFor: self.
27-
28-
^ canvas asPresenter
29-
]
30-
31-
{ #category : #'*GitLabHealth-Model-Extension' }
32-
GLHCommit >> inspectionGLHCommitFileImpacts [
33-
34-
<inspectorPresentationOrder: 3 title: 'File Impact'>
35-
| canvas |
36-
canvas := RSCommit canvasDiffImpactFor: self.
37-
38-
^ canvas asPresenter
39-
]
40-
41-
{ #category : #'*GitLabHealth-Model-Extension' }
42-
GLHCommit >> mooseNameOn: stream [
43-
message ifNotNil: [ :mess | stream nextPutAll: mess ] ifNil: [
44-
stream
45-
nextPutAll: 'Commit#';
46-
nextPutAll: (short_id ifNil: [ 'unknow id' ]) ]
47-
]
48-
49-
{ #category : #'*GitLabHealth-Model-Extension' }
50-
GLHCommit >> parent_ids [
51-
52-
^ parent_ids
53-
]
1+
Extension { #name : #GLHCommit }
2+
3+
{ #category : #'*GitLabHealth-Model-Extension' }
4+
GLHCommit >> computeChurnForMaxCommits: aLimit [
5+
6+
^ GitAnalyzer new
7+
fromCommit: self;
8+
maxChildCommit: aLimit;
9+
analyseChurn
10+
]
11+
12+
{ #category : #'*GitLabHealth-Model-Extension' }
13+
GLHCommit >> displayStringOn: aStream [
14+
15+
aStream
16+
<< (self short_id ifNil: [ self id first: 7 ]);
17+
<< ' ';
18+
<< self message
19+
]
20+
21+
{ #category : #'*GitLabHealth-Model-Extension' }
22+
GLHCommit >> inspectionGLHCommitChildren [
23+
24+
<inspectorPresentationOrder: 3 title: 'Commits Tree'>
25+
| canvas |
26+
canvas := RSCommit canvasCompleteHierachyFor: self.
27+
28+
^ canvas asPresenter
29+
]
30+
31+
{ #category : #'*GitLabHealth-Model-Extension' }
32+
GLHCommit >> inspectionGLHCommitFileImpacts [
33+
34+
<inspectorPresentationOrder: 3 title: 'File Impact'>
35+
| canvas |
36+
canvas := RSCommit canvasDiffImpactFor: self.
37+
38+
^ canvas asPresenter
39+
]
40+
41+
{ #category : #'*GitLabHealth-Model-Extension' }
42+
GLHCommit >> mooseNameOn: stream [
43+
message ifNotNil: [ :mess | stream nextPutAll: mess ] ifNil: [
44+
stream
45+
nextPutAll: 'Commit#';
46+
nextPutAll: (short_id ifNil: [ 'unknow id' ]) ]
47+
]
48+
49+
{ #category : #'*GitLabHealth-Model-Extension' }
50+
GLHCommit >> parent_ids [
51+
52+
^ parent_ids
53+
]
+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Extension { #name : #GLHDiff }
2-
3-
{ #category : #'*GitLabHealth-Model-Extension' }
4-
GLHDiff >> name [
5-
6-
<FMProperty: #name type: #String>
7-
^ new_path contractTo: 100
8-
]
1+
Extension { #name : #GLHDiff }
2+
3+
{ #category : #'*GitLabHealth-Model-Extension' }
4+
GLHDiff >> name [
5+
6+
<FMProperty: #name type: #String>
7+
^ new_path ifNotNil: [:string | string contractTo: 100]
8+
]
+20-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
Extension { #name : #GLHDiffRange }
2-
3-
{ #category : #'*GitLabHealth-Model-Extension' }
4-
GLHDiffRange >> name [
5-
6-
^ '[ OG: ' , originalLineRange , ' | NEW: ' , newLineRange , ']'
7-
]
8-
9-
{ #category : #'*GitLabHealth-Model-Extension' }
10-
GLHDiffRange class >> newFrom: aLine [
11-
12-
| range infos rangesInfo |
13-
range := GLHDiffRange new.
14-
infos := (aLine splitOn: '@@') second.
15-
rangesInfo := infos trim splitOn: ' '.
16-
range originalLineRange: rangesInfo first.
17-
range newLineRange: rangesInfo second.
18-
19-
^ range
20-
]
1+
Extension { #name : #GLHDiffRange }
2+
3+
{ #category : #'*GitLabHealth-Model-Extension' }
4+
GLHDiffRange >> name [
5+
6+
^ '[ OG: ' , originalLineRange , ' | NEW: ' , newLineRange , ']'
7+
]
8+
9+
{ #category : #'*GitLabHealth-Model-Extension' }
10+
GLHDiffRange class >> newFrom: aLine [
11+
12+
| range infos rangesInfo |
13+
range := GLHDiffRange new.
14+
infos := (aLine splitOn: '@@') second.
15+
rangesInfo := infos trim splitOn: ' '.
16+
range originalLineRange: rangesInfo first.
17+
range newLineRange: rangesInfo second.
18+
19+
^ range
20+
]
+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Extension { #name : #GLHFile }
2-
3-
{ #category : #'*GitLabHealth-Model-Extension' }
4-
GLHFile >> path [
5-
6-
^ (self directoryOwner
7-
ifNotNil: [ :owner | owner path , '/' ]
8-
ifNil: [ '' ]) , self name
9-
]
1+
Extension { #name : #GLHFile }
2+
3+
{ #category : #'*GitLabHealth-Model-Extension' }
4+
GLHFile >> path [
5+
6+
^ (self directoryOwner
7+
ifNotNil: [ :owner | owner path , '/' ]
8+
ifNil: [ '' ]) , self name
9+
]
+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Extension { #name : #GLHGroup }
2-
3-
{ #category : #'*GitLabHealth-Model-Extension' }
4-
GLHGroup >> allProjectstoScope [
5-
"return the all the projects and subprojects of this group"
6-
^ self toScope: GLHProject
7-
]
1+
Extension { #name : #GLHGroup }
2+
3+
{ #category : #'*GitLabHealth-Model-Extension' }
4+
GLHGroup >> allProjectstoScope [
5+
"return the all the projects and subprojects of this group"
6+
^ self toScope: GLHProject
7+
]
+23-23
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
Extension { #name : #GLHLineOfCode }
2-
3-
{ #category : #'*GitLabHealth-Model-Extension' }
4-
GLHLineOfCode class >> newFrom: aDiffLine [
5-
6-
| aLoC infos |
7-
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
8-
aLoC := GLHLineOfCode new.
9-
aLoC sourceCode: infos second.
10-
^ aLoC
11-
]
12-
13-
{ #category : #'*GitLabHealth-Model-Extension' }
14-
GLHLineOfCode class >> newFromLoCRange: aDiffLine [
15-
16-
| aLoC infos ranges |
17-
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
18-
ranges := infos first splitOn: ','.
19-
aLoC := GLHLineOfCode new.
20-
aLoC originalLineRange: ranges first.
21-
aLoC newLineRange: 1.
22-
aLoC lineOfCode: infos second
23-
]
1+
Extension { #name : #GLHLineOfCode }
2+
3+
{ #category : #'*GitLabHealth-Model-Extension' }
4+
GLHLineOfCode class >> newFrom: aDiffLine [
5+
6+
| aLoC infos |
7+
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
8+
aLoC := GLHLineOfCode new.
9+
aLoC sourceCode: infos second.
10+
^ aLoC
11+
]
12+
13+
{ #category : #'*GitLabHealth-Model-Extension' }
14+
GLHLineOfCode class >> newFromLoCRange: aDiffLine [
15+
16+
| aLoC infos ranges |
17+
infos := (aDiffLine splitOn: '@@') copyWithoutFirst.
18+
ranges := infos first splitOn: ','.
19+
aLoC := GLHLineOfCode new.
20+
aLoC originalLineRange: ranges first.
21+
aLoC newLineRange: 1.
22+
aLoC lineOfCode: infos second
23+
]
+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Extension { #name : #GLHProject }
2-
3-
{ #category : #'*GitLabHealth-Model-Extension' }
4-
GLHProject >> projectContributorsInspector: aBuilder [
5-
6-
<inspectorPresentationOrder: 100 title: 'Contributors'>
7-
^ SpRoassalInspectorPresenter new
8-
canvas: (GLHProjectContributorVisualization new forProject: self );
9-
yourself
10-
]
1+
Extension { #name : #GLHProject }
2+
3+
{ #category : #'*GitLabHealth-Model-Extension' }
4+
GLHProject >> projectContributorsInspector: aBuilder [
5+
6+
<inspectorPresentationOrder: 100 title: 'Contributors'>
7+
^ SpRoassalInspectorPresenter new
8+
canvas: (GLHProjectContributorVisualization new forProject: self );
9+
yourself
10+
]

0 commit comments

Comments
 (0)