• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / GitProjectHealth / 9682577336

26 Jun 2024 03:32PM UTC coverage: 29.519% (+2.6%) from 26.896%
9682577336

Pull #7

github

web-flow
Merge 0d36202b7 into dfd76b711
Pull Request #7: Optimize code and writting tests

514 of 1154 new or added lines in 11 files covered. (44.54%)

17 existing lines in 3 files now uncovered.

2177 of 7375 relevant lines covered (29.52%)

0.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.28
/src/GitLabProjectHealth-Model-Importer/GLPHApi.class.st
1
Class {
2
        #name : #GLPHApi,
3
        #superclass : #GLHApi,
4
        #category : #'GitLabProjectHealth-Model-Importer'
5
}
6

7
{ #category : #commit }
8
GLPHApi >> commitsOfProject: anInteger forRefName: refName [
×
9

×
10
        self
×
11
                deprecated: 'Use #unknow instead'
×
12
                on: '12 April 2024'
×
13
                in:
×
14
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
×
15

×
16
        ^ self
×
17
                  commitsOfProject: anInteger
×
18
                  forRefName: refName
×
19
                  since: nil
×
20
                  until: nil
×
21
                  path: nil
×
22
                  author: nil
×
23
                  all: nil
×
24
                  with_stats: nil
×
25
                  firstParent: nil
×
26
                  order: nil
×
27
                  trailers: nil
×
28
                  perPage: nil
×
29
                  page: nil
×
30
]
×
31

32
{ #category : #commits }
33
GLPHApi >> commitsOfProject: anInteger forRefName: refName since: since [
×
34

×
35
        self
×
36
                deprecated: 'Use #unknow instead'
×
37
                on: '12 April 2024'
×
38
                in:
×
39
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
×
40

×
41
        ^ self
×
42
                  commitsOfProject: anInteger
×
43
                  forRefName: refName
×
44
                  since: since
×
45
                  until: nil
×
46
                  path: nil
×
47
                  author: nil
×
48
                  all: nil
×
49
                  with_stats: nil
×
50
                  firstParent: nil
×
51
                  order: nil
×
52
                  trailers: nil
×
53
                  perPage: nil
×
54
                  page: nil
×
55
]
×
56

57
{ #category : #commit }
58
GLPHApi >> commitsOfProject: aGLHProject forRefName: refName until: toDate [
×
59

×
60
        | newlyFoundCommit page |
×
61
        self
×
62
                deprecated: 'Use #unknow instead'
×
63
                on: '11 April 2024'
×
64
                in:
×
65
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
×
66
        page := 0.
×
67
        newlyFoundCommit := { true }.
×
68
        [ newlyFoundCommit isNotEmpty ] whileTrue: [
×
69
                | results parsedResults existingCommits |
×
70
                page := page + 1.
×
71
                ('import commit page ' , page printString) recordInfo.
×
72
                results := self
×
73
                                   commitsOfProject: aGLHProject id
×
74
                                   forRefName: nil
×
75
                                   since: nil
×
76
                                   until: nil
×
77
                                   path: nil
×
78
                                   author: nil
×
79
                                   all: nil
×
80
                                   with_stats: nil
×
81
                                   firstParent: nil
×
82
                                   order: nil
×
83
                                   trailers: nil
×
84
                                   perPage: 100
×
85
                                   page: page.
×
86
                parsedResults := self parseCommitsResult: results.
×
87
                existingCommits := aGLHProject mooseModel allWithType: GLHCommit.
×
88

×
89
                newlyFoundCommit := parsedResults reject: [ :commitParsed |
×
90
                                            (toDate isNil or: [
×
91
                                                     commitParsed committed_date
×
92
                                                     < toDate asDateAndTime ]) or: [
×
93
                                                    existingCommits anySatisfy: [ :existingCommit |
×
94
                                                            existingCommit id = commitParsed id ] ] ].
×
95
                aGLHProject mooseModel addAll: newlyFoundCommit.
×
96
                aGLHProject repository commits addAll: newlyFoundCommit ].
×
97
        self withCommitDiffs ifTrue: [
×
98
                aGLHProject repository commits do: [ :commit |
×
99
                        self importDiffOfCommit: commit ] ]
×
100
]
×
101

102
{ #category : #'as yet unclassified' }
103
GLPHApi >> diffsMergeRequestOfProject: aProjectID withId: anMRiid [
1✔
104

1✔
105
        ^ self client get:
1✔
106
                  self baseAPIUrl , '/projects/' , aProjectID printString
1✔
107
                  , '/merge_requests/' , anMRiid printString , '/diffs/'
1✔
108
]
1✔
109

110
{ #category : #initialization }
111
GLPHApi >> initialize [
1✔
112

1✔
113
        super initialize
1✔
114
]
1✔
115

116
{ #category : #'as yet unclassified' }
117
GLPHApi >> mergeRequestOfProject: aProjectID [
1✔
118
        
1✔
119
        ^ self client get:
1✔
120
                  self baseAPIUrl , '/projects/' , aProjectID printString
1✔
121
                  , '/merge_requests/'
1✔
122
]
1✔
123

124
{ #category : #'as yet unclassified' }
125
GLPHApi >> mergeRequestOfProject: aProjectID withId: anMRiid [
×
126

×
127
        ^ self client get:
×
128
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
129
                  , '/merge_requests/' , anMRiid printString
×
130
]
×
131

132
{ #category : #mergeRequest }
NEW
133
GLPHApi >> mergeRequestsOfProject: aProjectId createdAfter: createdAfter createdBefore: createdBefore authorId: authorId authorUsername: authorUsername scope: scope orderBy: orderBy page: page [
×
NEW
134

×
NEW
135
        self client path:
×
136
                self baseAPIUrl , '/projects/' , aProjectId printString
×
137
                , '/merge_requests'.
×
NEW
138

×
NEW
139
        createdAfter ifNotNil: [
×
NEW
140
                self client queryAt: #created_after put: createdAfter ].
×
NEW
141
        createdBefore ifNotNil: [
×
NEW
142
                self client queryAt: #created_before put: createdBefore ].
×
143
        authorId ifNotNil: [ self client queryAt: #author_id put: authorId ].
×
NEW
144
        authorUsername ifNotNil: [
×
NEW
145
                self client queryAt: #author_username put: authorUsername ].
×
NEW
146
        scope ifNotNil: [ self client queryAt: #scope put: scope ].
×
NEW
147
        orderBy ifNotNil: [ self client queryAt: #order_by put: orderBy ].
×
148
        page ifNotNil: [ self client queryAt: #page put: page ].
×
149

×
150
        ^ self client get
×
151
]
×
152

153
{ #category : #accessing }
154
GLPHApi >> project: aProjectID [
1✔
155

1✔
156
        ^ self client get:
1✔
157
                  self baseAPIUrl , '/projects/' , aProjectID printString
1✔
158
]
1✔
159

160
{ #category : #user }
161
GLPHApi >> usersSearchByUsername: aUserName [ 
1✔
162
        |name|
1✔
163
        
1✔
164
        name := (aUserName splitOn: ' ') collect: [:part | part urlEncoded].
1✔
165
        name := '+' join: name.
1✔
166
        
1✔
167
        ^ self client get: self baseAPIUrl , '/users?search=' , name 
1✔
168
]
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc