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

Develop #95

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5b77080
put model importer inside super class
Sep 26, 2024
56314d3
Merge pull request #78 from moosetechnology/fix/model-importer
alkalinan Oct 7, 2024
22e5196
do not compute diff when server return error
badetitou Oct 7, 2024
1b1a264
Merge pull request #79 from moosetechnology/feature/error-with-bigdif…
badetitou Oct 7, 2024
947135b
enable diff range importer for Bitbucket
Oct 7, 2024
f2eb25d
add repoAPI to abstract importer; working on usercatalogue for bitbucket
Oct 8, 2024
8e34931
changing catalogue user importation for bitbucket
Oct 8, 2024
f7b43a8
Merge pull request #80 from moosetechnology/feature/commitImportBitBu…
alkalinan Oct 8, 2024
ae211a7
renaming for consistencies; fix visu case of no commits
Oct 10, 2024
5e7ee19
fix author color in commit tree visu. renaming bitbucket api method
Oct 10, 2024
6d97827
using none deprecated method
Oct 10, 2024
31cd73f
revert user: renaming; fixing on commit diff parsing
Oct 10, 2024
7276be9
fix model importer for bitbucket commit
Oct 10, 2024
eb3f2ec
deporecate repo api
badetitou Oct 11, 2024
93c7f60
Merge pull request #82 from moosetechnology/deprecate-repoapi
badetitou Oct 11, 2024
fdc3ac5
Merge pull request #81 from moosetechnology/refactoring/rename
badetitou Oct 11, 2024
85ac28a
add commit diff import for github importer
Oct 14, 2024
c6f44c1
add diff range parsing
Oct 14, 2024
74be8a8
add temp merge request importer
Oct 14, 2024
8a7e96d
fix deprecated names
Oct 15, 2024
f3f3234
fix: change userEmail to accept public_email by default
knowbased Oct 16, 2024
bb4dcf3
fix: additions are nil in commits import with importMergeRequestCommits
knowbased Oct 16, 2024
2691475
another renaming of deprecated method
Oct 16, 2024
b808647
Merge pull request #83 from moosetechnology/feature/commitdiff-github…
alkalinan Oct 16, 2024
833d56a
Merge pull request #84 from moosetechnology/fix/jira-metrics-not-work…
alkalinan Oct 16, 2024
1cf9744
feat: code addition and code deletion by merge request metric
knowbased Oct 17, 2024
b01d3f3
feat(GitMetricExporter): add code addition and deletion by mr metrics…
knowbased Oct 17, 2024
8b0a65f
add complete commit import to bitbucket methods (#86)
alkalinan Oct 17, 2024
ed0b8fb
Merge pull request #85 from moosetechnology/feat/code-contribution-by-mr
badetitou Oct 22, 2024
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
Prev Previous commit
Next Next commit
do not compute diff when server return error
+ test
  • Loading branch information
badetitou committed Oct 7, 2024
commit 22e51964e03c8c0f552bae4691d0e7003d8b44dd
12 changes: 12 additions & 0 deletions src/GitLabHealth-Model-Importer-Tests/GLHApiMock.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Class {
#name : #GLHApiMock,
#superclass : #GLHApi,
#category : #'GitLabHealth-Model-Importer-Tests'
}

{ #category : #'api - commits' }
GLHApiMock >> commitDiff: aCommitID ofProject: aProjectId unidiff: aBoolean [

aCommitID = 'createError' ifTrue: [
^ '{"message":"500 Internal Server Error"}' ]
]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Class {
'importer',
'model'
],
#category : 'GitLabHealth-Model-Importer-Tests'
#category : #'GitLabHealth-Model-Importer-Tests'
}

{ #category : #running }
Expand All @@ -18,7 +18,22 @@ GLHModelImporterLocalTest >> setUp [

importer := GLHModelImporter new.
model := GLPHEModel new.
importer glhModel: model
importer glhModel: model.
importer glhApi: GLHApiMock new
]

{ #category : #tests }
GLHModelImporterLocalTest >> testImportDiffOfCommitWithServerRaiseError [

| commit repo project |
commit := model newCommit.
commit id: 'createError'.
repo := model newRepository.
commit repository: repo.
project := model newProject.
repo project: project.
importer importDiffOfCommit: commit.
self assert: commit diffs isEmpty
]

{ #category : #tests }
Expand All @@ -31,3 +46,10 @@ GLHModelImporterLocalTest >> testImportUserAlreadyInModel [
model add: user.
self assert: (importer importUser: 12) equals: user
]

{ #category : #tests }
GLHModelImporterLocalTest >> testIsServerError [

self assert:
(importer isServerError: '{"message":"500 Internal Server Error"}')
]
6 changes: 6 additions & 0 deletions src/GitLabHealth-Model-Importer/GLHModelImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ GLHModelImporter >> importDiffOfCommit: aCommit [
commitDiff: aCommit id
ofProject: aCommit repository project id
unidiff: true.
(self isServerError: result) ifTrue: [ ^ { } ].
diffsResult := self newParseDiffResult: result.

^ aCommit diffs addAll: diffsResult unless: self blockForDiffEquality.
Expand Down Expand Up @@ -927,6 +928,11 @@ GLHModelImporter >> initialize [
currentImporter := self
]

{ #category : #api }
GLHModelImporter >> isServerError: aString [
^ aString = '{"message":"500 Internal Server Error"}'
]

{ #category : #importer }
GLHModelImporter >> loadAllProjectsFromRepositorySoftware [
"heavy import that load all the active project inside the model. Only import the project entities"
Expand Down
Loading