Commit 47a0b35
🪲 [Fix]: GitHub App Installations load failure (#200)
## Description
This pull request includes several changes to improve the handling of
GitHub contexts and enhance the functionality of the
`Connect-GitHubAccount` and `Connect-GitHubApp` functions. The most
important changes include updating the type of the `Permissions`
property, adding parameterless constructors, and modifying the logic for
loading GitHub App contexts.
Enhancements to GitHub context handling:
*
[`src/classes/public/Context/GitHubContext/AppGitHubContext.ps1`](diffhunk://#diff-59869473eaaec5f3a6e02c2c8cca88b9cc96f5e9fd840a87ead0d079c2c61372L12-R19):
Changed the type of the `Permissions` property from `string[]` to
`pscustomobject` and added a parameterless constructor.
*
[`src/classes/public/Context/GitHubContext/InstallationGitHubContext.ps1`](diffhunk://#diff-c9fc34da1bb954dfdae3f8d44c516bf8605d70c07941cd7b2c708ddd739292c0L13-R13):
Changed the type of the `Permissions` property from `string[]` to
`pscustomobject` and added a parameterless constructor.
[[1]](diffhunk://#diff-c9fc34da1bb954dfdae3f8d44c516bf8605d70c07941cd7b2c708ddd739292c0L13-R13)
[[2]](diffhunk://#diff-c9fc34da1bb954dfdae3f8d44c516bf8605d70c07941cd7b2c708ddd739292c0R24-R26)
*
[`src/classes/public/Context/GitHubContext/UserGitHubContext.ps1`](diffhunk://#diff-362543d00b76fa5b7f197c241363be74af60997ed87ea9209907944a89e5f069R25-R27):
Added a parameterless constructor.
Improvements to `Connect-GitHubAccount` function:
*
[`src/functions/public/Auth/Connect-GitHubAccount.ps1`](diffhunk://#diff-12918e90451cdedb78571b9a67ac0313331a25175cebb606b7108b7bf06af092L106-R110):
Renamed parameters (`SkipAppAutoload` to `AutoloadInstallations`),
removed unused parameters (`Shallow`), and updated the logic for loading
GitHub App contexts.
[[1]](diffhunk://#diff-12918e90451cdedb78571b9a67ac0313331a25175cebb606b7108b7bf06af092L106-R110)
[[2]](diffhunk://#diff-12918e90451cdedb78571b9a67ac0313331a25175cebb606b7108b7bf06af092L184-L196)
[[3]](diffhunk://#diff-12918e90451cdedb78571b9a67ac0313331a25175cebb606b7108b7bf06af092L304-L305)
[[4]](diffhunk://#diff-12918e90451cdedb78571b9a67ac0313331a25175cebb606b7108b7bf06af092L325-R306)
Enhancements to `Connect-GitHubApp` function:
*
[`src/functions/public/Auth/Connect-GitHubApp.ps1`](diffhunk://#diff-7d1951ca779d73ee11b11db4ade6f33f8ea5fcf052324a72d2c8e83304eaa045L67-R80):
Removed the `Shallow` parameter, added context resolution and validation
in the `process` block, and updated the logic for processing
installations.
[[1]](diffhunk://#diff-7d1951ca779d73ee11b11db4ade6f33f8ea5fcf052324a72d2c8e83304eaa045L67-R80)
[[2]](diffhunk://#diff-7d1951ca779d73ee11b11db4ade6f33f8ea5fcf052324a72d2c8e83304eaa045L107-R149)
Refinements to `Set-GitHubContext` function:
*
[`src/functions/public/Auth/Context/Set-GitHubContext.ps1`](diffhunk://#diff-64c988967c6049cce19ca80e8ddaa220f26d32f8ed6f2626a18bda0b1c28ab30R45-R162):
Refactored to use a local variable for context manipulation and added
detailed logging for context information.
Coverage documentation updates:
*
[`Coverage.md`](diffhunk://#diff-dbfc2288d75ec9b5432d4012b7f852336ed6550ea8964dd6227b64b4a38d7777L8-R20):
Updated the number of available and missing functions, and adjusted the
coverage percentage.
[[1]](diffhunk://#diff-dbfc2288d75ec9b5432d4012b7f852336ed6550ea8964dd6227b64b4a38d7777L8-R20)
[[2]](diffhunk://#diff-dbfc2288d75ec9b5432d4012b7f852336ed6550ea8964dd6227b64b4a38d7777L55-L61)
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [x] 🩹 [Patch]
- [ ] 1 parent 793923f commit 47a0b35
File tree
8 files changed
+200
-170
lines changed- src
- classes/public/Context/GitHubContext
- functions/public/Auth
- Context
- tests
8 files changed
+200
-170
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 55 | | |
59 | 56 | | |
60 | | - | |
61 | | - | |
62 | 57 | | |
63 | 58 | | |
64 | 59 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 110 | + | |
117 | 111 | | |
118 | 112 | | |
119 | 113 | | |
| |||
181 | 175 | | |
182 | 176 | | |
183 | 177 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | 178 | | |
198 | 179 | | |
199 | 180 | | |
| |||
299 | 280 | | |
300 | 281 | | |
301 | 282 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 283 | + | |
| 284 | + | |
306 | 285 | | |
307 | 286 | | |
308 | 287 | | |
| |||
322 | 301 | | |
323 | 302 | | |
324 | 303 | | |
325 | | - | |
326 | | - | |
327 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
328 | 307 | | |
329 | 308 | | |
330 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 67 | + | |
72 | 68 | | |
73 | 69 | | |
74 | | - | |
75 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
76 | 74 | | |
77 | | - | |
78 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
128 | 83 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 84 | + | |
| 85 | + | |
132 | 86 | | |
133 | 87 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 88 | + | |
| 89 | + | |
137 | 90 | | |
138 | 91 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 92 | + | |
| 93 | + | |
142 | 94 | | |
143 | 95 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
151 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
152 | 144 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 145 | | |
158 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
159 | 149 | | |
0 commit comments