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

moosetechnology / GitProjectHealth / 10918907131

18 Sep 2024 08:57AM UTC coverage: 20.103% (-0.2%) from 20.328%
10918907131

push

github

web-flow
Merge pull request #61 from moosetechnology/feat-jira-time-vs-merge-request-time

feat: add jira time and merge request time difference metric

0 of 207 new or added lines in 11 files covered. (0.0%)

4 existing lines in 2 files now uncovered.

1961 of 9755 relevant lines covered (20.1%)

0.2 hits per line

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

2.45
/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 }
8
GLPHApi >> approvalsOfMergeQuest: aMergeRequestIID ofProject: aProjectId [
×
9

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

16
{ #category : #'as yet unclassified' }
NEW
17
GLPHApi >> commitsOfMergeRequest: mergeRequestIID ofProject: projectId page: page perPage: perPage [ 
×
NEW
18

×
NEW
19
        self client path:
×
NEW
20
                  self baseAPIUrl , '/projects/' , projectId printString
×
NEW
21
                  , '/merge_requests/' , mergeRequestIID printString, '/commits'.
×
NEW
22
                
×
NEW
23
                
×
NEW
24
        perPage ifNotNil: [
×
NEW
25
                self client queryAt: #per_page put: perPage ].        
×
NEW
26
        page ifNotNil: [ self client queryAt: #page put: page ].
×
NEW
27
        
×
NEW
28
        ^ self client get
×
NEW
29
]
×
30

31
{ #category : #commit }
32
GLPHApi >> commitsOfProject: anInteger forRefName: refName [
×
33

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

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

56
{ #category : #commits }
57
GLPHApi >> commitsOfProject: anInteger forRefName: refName since: since [
×
58

×
59
        self
×
60
                deprecated: 'Use #unknow instead'
×
61
                on: '12 April 2024'
×
62
                in:
×
63
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
×
64

×
65
        ^ self
×
66
                  commitsOfProject: anInteger
×
67
                  forRefName: refName
×
68
                  since: since
×
69
                  until: nil
×
70
                  path: nil
×
71
                  author: nil
×
72
                  all: nil
×
73
                  with_stats: nil
×
74
                  firstParent: nil
×
75
                  order: nil
×
76
                  trailers: nil
×
77
                  perPage: nil
×
78
                  page: nil
×
79
]
×
80

81
{ #category : #commit }
82
GLPHApi >> commitsOfProject: aGLHProject forRefName: refName until: toDate [
×
83

×
84
        | newlyFoundCommit page |
×
85
        self
×
86
                deprecated: 'Use #unknow instead'
×
87
                on: '11 April 2024'
×
88
                in:
×
89
                'Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)'.
×
90
        page := 0.
×
91
        newlyFoundCommit := { true }.
×
92
        [ newlyFoundCommit isNotEmpty ] whileTrue: [
×
93
                | results parsedResults existingCommits |
×
94
                page := page + 1.
×
95
                ('import commit page ' , page printString) recordInfo.
×
96
                results := self
×
97
                                   commitsOfProject: aGLHProject id
×
98
                                   forRefName: nil
×
99
                                   since: nil
×
100
                                   until: nil
×
101
                                   path: nil
×
102
                                   author: nil
×
103
                                   all: nil
×
104
                                   with_stats: nil
×
105
                                   firstParent: nil
×
106
                                   order: nil
×
107
                                   trailers: nil
×
108
                                   perPage: 100
×
109
                                   page: page.
×
110
                parsedResults := self parseCommitsResult: results.
×
111
                existingCommits := aGLHProject mooseModel allWithType: GLHCommit.
×
112

×
113
                newlyFoundCommit := parsedResults reject: [ :commitParsed |
×
114
                                            (toDate isNil or: [
×
115
                                                     commitParsed committed_date
×
116
                                                     < toDate asDateAndTime ]) or: [
×
117
                                                    existingCommits anySatisfy: [ :existingCommit |
×
118
                                                            existingCommit id = commitParsed id ] ] ].
×
119
                aGLHProject mooseModel addAll: newlyFoundCommit.
×
120
                aGLHProject repository commits addAll: newlyFoundCommit ].
×
121
        self withCommitDiffs ifTrue: [
×
122
                aGLHProject repository commits do: [ :commit |
×
123
                        self importDiffOfCommit: commit ] ]
×
124
]
×
125

126
{ #category : #'as yet unclassified' }
127
GLPHApi >> diffsMergeRequestOfProject: aProjectID withId: anMRiid [
×
128

×
129
        ^ self client get:
×
130
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
131
                  , '/merge_requests/' , anMRiid printString , '/diffs/'
×
132
]
×
133

134
{ #category : #initialization }
135
GLPHApi >> initialize [
1✔
136

1✔
137
        super initialize
1✔
138
]
1✔
139

140
{ #category : #'as yet unclassified' }
141
GLPHApi >> mergeRequestOfProject: aProjectID [
×
142
        
×
143
        ^ self client get:
×
144
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
145
                  , '/merge_requests/'
×
146
]
×
147

148
{ #category : #'as yet unclassified' }
149
GLPHApi >> mergeRequestOfProject: aProjectID withId: anMRiid [
×
150

×
151
        ^ self client get:
×
152
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
153
                  , '/merge_requests/' , anMRiid printString
×
154
]
×
155

156
{ #category : #mergeRequest }
157
GLPHApi >> mergeRequestsOfProject: aProjectId createdAfter: createdAfter createdBefore: createdBefore authorId: authorId authorUsername: authorUsername scope: scope orderBy: orderBy page: page [
×
158

×
159
        self client path:
×
160
                self baseAPIUrl , '/projects/' , aProjectId printString
×
161
                , '/merge_requests'.
×
162

×
163
        createdAfter ifNotNil: [
×
164
                self client queryAt: #created_after put: createdAfter ].
×
165
        createdBefore ifNotNil: [
×
166
                self client queryAt: #created_before put: createdBefore ].
×
167
        authorId ifNotNil: [ self client queryAt: #author_id put: authorId ].
×
168
        authorUsername ifNotNil: [
×
169
                self client queryAt: #author_username put: authorUsername ].
×
170
        scope ifNotNil: [ self client queryAt: #scope put: scope ].
×
171
        orderBy ifNotNil: [ self client queryAt: #order_by put: orderBy ].
×
172
        page ifNotNil: [ self client queryAt: #page put: page ].
×
173

×
174
        ^ self client get
×
175
]
×
176

177
{ #category : #accessing }
178
GLPHApi >> project: aProjectID [
×
179

×
180
        ^ self client get:
×
181
                  self baseAPIUrl , '/projects/' , aProjectID printString
×
182
]
×
183

184
{ #category : #user }
185
GLPHApi >> usersSearchByUsername: aUserName [ 
×
186
        |name|
×
187
        
×
188
        name := (aUserName splitOn: ' ') collect: [:part | part urlEncoded].
×
189
        name := '+' join: name.
×
190
        
×
191
        ^ self client get: self baseAPIUrl , '/users?search=' , name 
×
192
]
×
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