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

moosetechnology / GitProjectHealth / 10880334038

16 Sep 2024 08:38AM UTC coverage: 20.325% (-0.2%) from 20.538%
10880334038

Pull #54

github

web-flow
Merge 9db8bd0be into aef27716a
Pull Request #54: Metrics fixing

20 of 234 new or added lines in 20 files covered. (8.55%)

252 existing lines in 18 files now uncovered.

1961 of 9648 relevant lines covered (20.33%)

0.2 hits per line

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

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

8
{ #category : 'mergeRequest' }
9
GLPHApi >> approvalsOfMergeQuest: aMergeRequestIID ofProject: aProjectId [
×
10

×
11
        self client path:
×
12
                self baseAPIUrl , '/projects/' , aProjectId printString
×
13
                , '/merge_requests/' , aMergeRequestIID printString , '/approvals'.
×
14
        ^ self client get
×
UNCOV
15
]
×
16

17
{ #category : 'commit' }
18
GLPHApi >> commitsOfProject: anInteger forRefName: refName [
×
19

×
20
        self
×
21
                deprecated: 'Use #unknow instead'
×
22
                on: '12 April 2024'
×
23
                in:
×
24
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
×
25

×
26
        ^ self
×
27
                  commitsOfProject: anInteger
×
28
                  forRefName: refName
×
29
                  since: nil
×
30
                  until: nil
×
31
                  path: nil
×
32
                  author: nil
×
33
                  all: nil
×
34
                  with_stats: nil
×
35
                  firstParent: nil
×
36
                  order: nil
×
37
                  trailers: nil
×
38
                  perPage: nil
×
39
                  page: nil
×
UNCOV
40
]
×
41

42
{ #category : 'commits' }
43
GLPHApi >> commitsOfProject: anInteger forRefName: refName since: since [
×
44

×
45
        self
×
46
                deprecated: 'Use #unknow instead'
×
47
                on: '12 April 2024'
×
48
                in:
×
49
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
×
50

×
51
        ^ self
×
52
                  commitsOfProject: anInteger
×
53
                  forRefName: refName
×
54
                  since: since
×
55
                  until: nil
×
56
                  path: nil
×
57
                  author: nil
×
58
                  all: nil
×
59
                  with_stats: nil
×
60
                  firstParent: nil
×
61
                  order: nil
×
62
                  trailers: nil
×
63
                  perPage: nil
×
64
                  page: nil
×
UNCOV
65
]
×
66

67
{ #category : 'commit' }
68
GLPHApi >> commitsOfProject: aGLHProject forRefName: refName until: toDate [
×
69

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

×
99
                newlyFoundCommit := parsedResults reject: [ :commitParsed |
×
100
                                            (toDate isNil or: [
×
101
                                                     commitParsed committed_date
×
102
                                                     < toDate asDateAndTime ]) or: [
×
103
                                                    existingCommits anySatisfy: [ :existingCommit |
×
104
                                                            existingCommit id = commitParsed id ] ] ].
×
105
                aGLHProject mooseModel addAll: newlyFoundCommit.
×
106
                aGLHProject repository commits addAll: newlyFoundCommit ].
×
107
        self withCommitDiffs ifTrue: [
×
108
                aGLHProject repository commits do: [ :commit |
×
109
                        self importDiffOfCommit: commit ] ]
×
UNCOV
110
]
×
111

112
{ #category : 'as yet unclassified' }
113
GLPHApi >> diffsMergeRequestOfProject: aProjectID withId: anMRiid [
×
114

×
115
        ^ self client get:
×
116
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
117
                  , '/merge_requests/' , anMRiid printString , '/diffs/'
×
UNCOV
118
]
×
119

120
{ #category : 'initialization' }
121
GLPHApi >> initialize [
1✔
122

1✔
123
        super initialize
1✔
124
]
1✔
125

126
{ #category : 'as yet unclassified' }
127
GLPHApi >> mergeRequestOfProject: aProjectID [
×
128
        
×
129
        ^ self client get:
×
130
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
131
                  , '/merge_requests/'
×
UNCOV
132
]
×
133

134
{ #category : 'as yet unclassified' }
135
GLPHApi >> mergeRequestOfProject: aProjectID withId: anMRiid [
×
136

×
137
        ^ self client get:
×
138
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
139
                  , '/merge_requests/' , anMRiid printString
×
UNCOV
140
]
×
141

142
{ #category : 'mergeRequest' }
143
GLPHApi >> mergeRequestsOfProject: aProjectId createdAfter: createdAfter createdBefore: createdBefore authorId: authorId authorUsername: authorUsername scope: scope orderBy: orderBy page: page [
×
144

×
145
        self client path:
×
146
                self baseAPIUrl , '/projects/' , aProjectId printString
×
147
                , '/merge_requests'.
×
148

×
149
        createdAfter ifNotNil: [
×
150
                self client queryAt: #created_after put: createdAfter ].
×
151
        createdBefore ifNotNil: [
×
152
                self client queryAt: #created_before put: createdBefore ].
×
153
        authorId ifNotNil: [ self client queryAt: #author_id put: authorId ].
×
154
        authorUsername ifNotNil: [
×
155
                self client queryAt: #author_username put: authorUsername ].
×
156
        scope ifNotNil: [ self client queryAt: #scope put: scope ].
×
157
        orderBy ifNotNil: [ self client queryAt: #order_by put: orderBy ].
×
158
        page ifNotNil: [ self client queryAt: #page put: page ].
×
159

×
160
        ^ self client get
×
UNCOV
161
]
×
162

163
{ #category : 'accessing' }
164
GLPHApi >> project: aProjectID [
×
165

×
166
        ^ self client get:
×
167
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
UNCOV
168
]
×
169

170
{ #category : 'user' }
171
GLPHApi >> usersSearchByUsername: aUserName [ 
×
172
        |name|
×
173
        
×
174
        name := (aUserName splitOn: ' ') collect: [:part | part urlEncoded].
×
175
        name := '+' join: name.
×
176
        
×
177
        ^ self client get: self baseAPIUrl , '/users?search=' , name 
×
UNCOV
178
]
×
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