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

moosetechnology / GitProjectHealth / 9746111034

01 Jul 2024 02:29PM UTC coverage: 29.855% (-0.4%) from 30.222%
9746111034

push

github

badetitou
add approved metrics for mr

0 of 93 new or added lines in 4 files covered. (0.0%)

1 existing line in 1 file now uncovered.

2263 of 7580 relevant lines covered (29.85%)

0.3 hits per line

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

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

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

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

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

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

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

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

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

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

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

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

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

111
{ #category : #'as yet unclassified' }
112
GLPHApi >> diffsMergeRequestOfProject: aProjectID withId: anMRiid [
1✔
113

1✔
114
        ^ self client get:
1✔
115
                  self baseAPIUrl , '/projects/' , aProjectID printString
1✔
116
                  , '/merge_requests/' , anMRiid printString , '/diffs/'
1✔
117
]
1✔
118

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

1✔
122
        super initialize
1✔
123
]
1✔
124

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

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

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

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

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

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

×
159
        ^ self client get
×
160
]
×
161

162
{ #category : #accessing }
163
GLPHApi >> project: aProjectID [
1✔
164

1✔
165
        ^ self client get:
1✔
166
                  self baseAPIUrl , '/projects/' , aProjectID printString
1✔
167
]
1✔
168

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