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

moosetechnology / GitProjectHealth / 9549969001

17 Jun 2024 02:58PM UTC coverage: 26.896% (-2.6%) from 29.45%
9549969001

push

github

HLAD Nicolas
Merge 10a1182e1

1830 of 6804 relevant lines covered (26.9%)

0.27 hits per line

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

20.57
/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 }
133
GLPHApi >> mergeRequestsOfProject: aProjectId createdAfter: createdAfter createdBefore: createdBefore authorId: authorId authorUsername: authorUsername scope: scope orderBy: orderBy page: page [ 
×
134
                self client path:
×
135
                self baseAPIUrl , '/projects/' , aProjectId printString
×
136
                , '/merge_requests'.
×
137
                
×
138
                createdAfter ifNotNil: [ self client queryAt: #created_after put: createdAfter ].
×
139
        createdBefore ifNotNil: [ self client queryAt: #created_before put: createdBefore ].
×
140
        authorId ifNotNil: [ self client queryAt: #author_id put: authorId ].
×
141
        authorUsername ifNotNil: [ self client queryAt: #author_username put: authorUsername ].
×
142
        scope ifNotNil: [
×
143
                self client queryAt: #scope put: scope ].
×
144
        orderBy ifNotNil: [
×
145
                self client queryAt: #order_by put: orderBy ].
×
146
        page ifNotNil: [ self client queryAt: #page put: page ].
×
147

×
148
        ^ self client get
×
149
]
×
150

151
{ #category : #accessing }
152
GLPHApi >> project: aProjectID [
1✔
153

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

158
{ #category : #user }
159
GLPHApi >> usersSearchByUsername: aUserName [ 
1✔
160
        |name|
1✔
161
        
1✔
162
        name := (aUserName splitOn: ' ') collect: [:part | part urlEncoded].
1✔
163
        name := '+' join: name.
1✔
164
        
1✔
165
        ^ self client get: self baseAPIUrl , '/users?search=' , name 
1✔
166
]
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