You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🩹 [Patch]: Source all defaults for Context via Config (#285)
## Description
This pull request introduces several enhancements to the GitHub
PowerShell module, focusing on default configuration values, context
handling, and testing improvements. Default values have been added for
GitHub API and HTTP protocol versions, updating context handling to use
these default values, and enhancing the test suite to verify the new
configurations.
### Enhancements to default configuration values
*
[`src/classes/public/Config/GitHubConfig.ps1`](diffhunk://#diff-b30ece1b52dbf4e2436f25c9d00b18f0420696da62094aa2b6eb7cfa765aeac9R20-R28):
Added default values for `ApiVersion`, `HttpVersion`, and `PerPage`
parameters.
*
[`src/variables/private/GitHub.ps1`](diffhunk://#diff-d48c42727c113c1d1872da6b9e8446dbed357a87545ec0f78de395c9a2553086R17-R19):
Set default values for `ApiVersion`, `HttpVersion`, and `PerPage` in the
configuration.
Updates to context handling:
*
[`src/classes/public/Context/GitHubContext.ps1`](diffhunk://#diff-a8076f3b68ae776032b69baf8cc6198b2f00f834af814088fa260d0be7b684a8R59-R61):
Included default values for `HttpVersion` and `PerPage`.
*
[`src/functions/public/API/Invoke-GitHubAPI.ps1`](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L54-R54):
Modified to utilize the context's `HttpVersion` and `ApiVersion` values.
[[1]](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L54-R54)
[[2]](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L100-R118)
*
[`src/functions/public/Auth/Connect-GitHubAccount.ps1`](diffhunk://#diff-12918e90451cdedb78571b9a67ac0313331a25175cebb606b7108b7bf06af092R165-R167):
Updated to set context properties `HttpVersion`, `PerPage`, and
`ApiVersion` from the configuration.
[[1]](diffhunk://#diff-12918e90451cdedb78571b9a67ac0313331a25175cebb606b7108b7bf06af092R165-R167)
[[2]](diffhunk://#diff-12918e90451cdedb78571b9a67ac0313331a25175cebb606b7108b7bf06af092R189-L194)
Enhancements to the test suite:
*
[`tests/GitHub.Tests.ps1`](diffhunk://#diff-0b1d9ba345a583adce874126c13d6edd3f789416bb9c4db5df1e18af3608554cL26-R30):
Improved tests to verify the new default configuration values and
context settings.
[[1]](diffhunk://#diff-0b1d9ba345a583adce874126c13d6edd3f789416bb9c4db5df1e18af3608554cL26-R30)
[[2]](diffhunk://#diff-0b1d9ba345a583adce874126c13d6edd3f789416bb9c4db5df1e18af3608554cR71-R82)
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [x] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [ ] 🌟 [Breaking change]
## Checklist
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
0 commit comments