|
14 | 14 | :Access Public Shared |
15 | 15 | :If 0<##.⎕NC'TatinVars.CONFIG' |
16 | 16 | r←(⎕JSON⍠('Dialect' 'JSON5')⊢##.TatinVars.CONFIG).version |
17 | | - :ElseIf 0<##.##.⎕NC'TatinVars.CONFIG' |
18 | | - r←(⎕JSON⍠('Dialect' 'JSON5')⊢##.##.TatinVars.CONFIG).version |
19 | 17 | :Else |
20 | | - ⍝ When a script was not loaded with Tatin, there will be no namespace `TatinVars`. |
21 | | - ⍝ In such cases we cannot provide a version number, so we return just ''. |
| 18 | + ⍝ When a script was not loaded with Tatin, there will be no namespace `TatinVars`. |
| 19 | + ⍝ In such cases we cannot provide a version number, so we return just ''. |
22 | 20 | r←'' |
23 | 21 | :EndIf |
24 | 22 | ∇ |
25 | 23 |
|
26 | 24 | ∇ History |
27 | 25 | :Access Public Shared |
| 26 | + ⍝ * 2.1.0 from 2025-04-21 |
| 27 | + ⍝ * Function `GetIssues` added |
| 28 | + ⍝ * Function `GetLabelStats` added |
| 29 | + ⍝ * `∆QuickView` (injected into issues) does not require an argument anymore & returns the creation date now as well |
| 30 | + ⍝ * `∆Details` (injected into issues) does not require an argument anymore |
| 31 | + ⍝ * Bug fixes |
| 32 | + ⍝ * Typo fixed in `Version` |
| 33 | + ⍝ * Empty "owner" was accepted by `⎕NEW` - makes no sense |
28 | 34 | ⍝ * 2.0.0 from 2025-04-09 |
29 | | - ⍝ * Potentially breaking: `Version` now returns a char vector temming from the package config file |
| 35 | + ⍝ * Potentially breaking: `Version` now returns a char vector stemming from the package config file |
30 | 36 | ⍝ * Packages updated |
31 | 37 | ⍝ * "Make" improved |
32 | 38 | ⍝ * 1.6.0 from 2025-01-025 |
33 | 39 | ⍝ * CommTools removed as a dependency - it was only required for tests |
34 | 40 | ⍝ * `Version` now returns the package config file setting |
35 | | - ⍝ * 1.5.0 from 2024-11-16 |
36 | | - ⍝ * `CheckForUpdate` can now handle beta versions on the client side (on GitHub, betas are not supported) |
37 | | - ⍝ * 1.4.0 from 2024-09-24 |
38 | | - ⍝ * New instance method `GetMyRateLimits` added whbich complements the older shared method `GetRateLimits` |
39 | | - ⍝ * BREAKING CHANGE |
40 | | - ⍝ The instance property `pathToConngaDLLs` has been removed and replaced by an instance field with the same name. |
41 | | - ⍝ This syntax change was necessary because some shared methods (`GetAllEndPoints`, `GetRateLimits`) called `GetJson` |
42 | | - ⍝ which relies on `pathToCongaDLLs` being defined. It affects you only when you have set `pathToCongaDLLs` as a |
43 | | - ⍝ property of an instance, because that needs changing: assign it to the field of the class instead. |
44 | | - ⍝ * `GetAllTopics` called `GetJson` with a left argument |
45 | | - ⍝ * 1.3.0 from 2024-09-23 |
46 | | - ⍝ * There was no way to specify a path for the Conga DLLs in GetJson: now there is a field `path2CongaDLLs` |
47 | | - ⍝ * Bug fixes |
48 | | - ⍝ * `GetRelease` did not process its (optional) left argument correctly, resulting in a crash. |
49 | | - ⍝ * Shared method `GetJson` relied on instance property `path2CongaDLLs`. Can now be specified as left argument |
50 | | - ⍝ * The function `GetJson` had an optional left argument `parms` that was never processed: removed. |
51 | 41 | ⍝\\ |
52 | 42 | ⍝ For information regarding older versions see <https://github.com/aplteam/GitHubAPIv3/releases> |
53 | 43 | ∇ |
|
75 | 65 | ∇ make1(owner) |
76 | 66 | :Access Public Instance |
77 | 67 | :Implements Constructor |
78 | | - _owner←owner |
| 68 | + '"Owner" must not be empty'Assert 0<≢_owner←owner~' ' |
79 | 69 | _personal_access_token←'' |
80 | 70 | _regEx←'setup_<repoName>_<version>[.\]*.[0-9]{0,6}\.exe' ⍝ After version there _might_ be a built number |
81 | 71 | A←(⊃⊃⎕CLASS ⎕THIS).##.APLTreeUtils2 |
|
179 | 169 | :EndIf |
180 | 170 | ns.⎕DF(repoName,' issue ')∘,¨(⍕¨ns.number) |
181 | 171 | ns.⎕FX⊂⎕CR'∆List' |
182 | | - ns.⎕FX⊂'r←∆Details instance' 'r←∆List' ' :If 0<≢instance' 'r(instance.GetPrincipal)←''assignees'' ''login''' 'r(instance.GetPrincipal)←''labels'' ''name''' ':EndIf' |
183 | | - ns.⎕FX⊂'r←∆QuickView instance;keyWords' 'r←∆Details instance' 'keyWords←''title'' ''number'' ''state'' ''updated_at'' ''labels'' ''assignees''' 'r←(r[;1]∊keyWords)⌿r' 'r←r[⍋keyWords⍳r[;1];]' |
| 172 | + ns.⎕FX⊂'r←∆Details;ind' '⍝ Like <List> but with greatly improved readability' 'r←∆List' 'r(⎕THIS.##.GetPrincipal)←''assignees'' ''login''' 'r(⎕THIS.##.GetPrincipal)←''labels'' ''name''' 'r[⍸r[;2]≡¨⊂⊂''null'';2]←⊂''''' ':If 0<≢ind←⍸r[;1]∊''created_at'' ''updated_at''' 'r[ind;2]←{r←⍵ ⋄ r[11]←'' '' ⋄ r}¨r[ind;2]' ':EndIf' |
| 173 | + ns.⎕FX⊂'r←∆QuickView;keyWords;ind' '⍝ Provides the most common pieces of information' 'r←∆Details' 'keyWords←''title'' ''number'' ''state'' ''created_at'' ''updated_at'' ''labels'' ''assignees''' 'r←(r[;1]∊keyWords)⌿r' 'r←r[⍋keyWords⍳r[;1];]' ':If 0<≢ind←⍸r[;1]∊''created_at'' ''updated_at''' 'r[ind;2]←{r←⍵ ⋄ r[11]←'' '' ⋄ r}¨r[ind;2]' ':EndIf' |
| 174 | + :EndIf |
| 175 | + ∇ |
| 176 | + |
| 177 | + ∇ r←GetIssues repoName;issues;labels |
| 178 | + ⍝ Get a matrix with all issues.\\ |
| 179 | + ⍝ [;1] Issue number\\ |
| 180 | + ⍝ [;2] Creation date |
| 181 | + ⍝ [;3] Title |
| 182 | + ⍝ [;4] Label(s) assigned |
| 183 | + :Access Public Instance |
| 184 | + :If 0=≢issues←GetAllIssues repoName |
| 185 | + r←0 4⍴⊂'' |
| 186 | + :Else |
| 187 | + labels←{2::'' ⋄ ⊃{⍺,',',⍵}/⍵.name}¨issues.labels |
| 188 | + r←issues.number,↑issues.(created_at title) |
| 189 | + r,←labels |
| 190 | + r[;2]←{r←↑⍵ ⋄ r[;11]←' ' ⋄ ↓r}r[;2] |
| 191 | + :EndIf |
| 192 | + ∇ |
| 193 | + |
| 194 | + ∇ r←GetLabelStats repoName;issues;labels |
| 195 | + ⍝ Get a matrix with all labels assigned to issues in [;1] and the count in [;2] |
| 196 | + :Access Public Instance |
| 197 | + :If 0=≢issues←GetAllIssues repoName |
| 198 | + r←0 2⍴⊂'' |
| 199 | + :Else |
| 200 | + labels←⊃,/{2::⊂'<no label>' ⋄ ⍵.name}¨issues.labels |
| 201 | + labels←labels{(⍵↓⍺),(⍵↑⍺)}+/'<no label>'∘≡¨labels |
| 202 | + r←{⍺(≢⍵)}⌸labels |
| 203 | + r[;1]←⊃¨r[;1] |
| 204 | + r←r[⍒r[;2];] |
184 | 205 | :EndIf |
185 | 206 | ∇ |
186 | 207 |
|
|
332 | 353 | r.Accepted←'Accept: application/vnd.github.v3+json' |
333 | 354 | r.Method←'GET' |
334 | 355 | r.Body←'' |
| 356 | + ⍝CodeCoverage:ignore⍝ |
335 | 357 | ∇ |
336 | 358 |
|
337 | 359 | ⍝ ------------------------------------------ Private stuff ---------------------------------- |
|
366 | 388 | h.CongaPath←path2CongaDLLs |
367 | 389 | :EndIf |
368 | 390 | r←h.Run |
369 | | - (r.HttpMessage,' (',(⍕r.HttpStatus),')')Assert r.HttpStatus=200 |
| 391 | + (r.HttpMessage,' (',(⍕r.HttpStatus),')')Assert r.HttpStatus≡200 |
370 | 392 | data←⎕JSON r.Data |
371 | 393 | noOfPages←GetNoOfPages r.Headers |
372 | 394 | :If 0<noOfPages |
|
375 | 397 | link←2⊃r.Headers[ind;] |
376 | 398 | h.URL←{¯1↓1↓⍵↑⍨¯1+⍵⍳';'}link |
377 | 399 | r2←h.Run |
378 | | - (r.HttpMessage,' (',(⍕r.HttpStatus),')')Assert r.HttpStatus=200 |
| 400 | + (r.HttpMessage,' (',(⍕r.HttpStatus),')')Assert r.HttpStatus≡200 |
379 | 401 | data,←⎕JSON r2.Data |
380 | 402 | :If 2<noOfPages |
381 | 403 | ⍝ Fetch all remaining pages |
382 | 404 | links←({¯2↓1↓⍵↑⍨¯1+⍵⍳';'}link)∘{⍺,⍕⍵}¨2↓⍳noOfPages |
383 | 405 | :For link :In links |
384 | 406 | h.URL←link |
385 | 407 | r2←h.Run |
386 | | - (r.HttpMessage,' (',(⍕r.HttpStatus),')')Assert r.HttpStatus=200 |
| 408 | + (r.HttpMessage,' (',(⍕r.HttpStatus),')')Assert r.HttpStatus≡200 |
387 | 409 | data,←⎕JSON r2.Data |
388 | 410 | :EndFor |
389 | 411 | :EndIf |
|
0 commit comments