-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🩹 [Patch]: Add tests for Meta + GitHubAPI fixes (#195)
## Description This pull request includes several changes to improve the handling of GitHub API responses, enhance logging, and refine error messages. The most important changes involve adding detailed logging, handling different content types in API responses, and refactoring context resolution. ### Improvements to API response handling: * [`src/functions/public/API/Invoke-GitHubAPI.ps1`](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39R182-R206): Added detailed logging for API responses and handling of various content types, including JSON, plain text, and custom streams. ### Enhancements to logging: * `src/functions/public/Meta/Get-GitHubApiVersion.ps1`, `src/functions/public/Meta/Get-GitHubMeta.ps1`, `src/functions/public/Meta/Get-GitHubOctocat.ps1`, `src/functions/public/Meta/Get-GitHubRoot.ps1`, `src/functions/public/Meta/Get-GitHubZen.ps1`: Added `begin`, `process`, and `end` blocks with verbose logging for better traceability. [[1]](diffhunk://#diff-79713af1fd3e68c4553acbe86eb87773288d3018711828a0f5392f92771a01a8R26-R32) [[2]](diffhunk://#diff-79713af1fd3e68c4553acbe86eb87773288d3018711828a0f5392f92771a01a8R42-R46) [[3]](diffhunk://#diff-bd717cea01612bd72bed0f327a6962871ace61b88d24887ea3b8576c24fa3485R34-R40) [[4]](diffhunk://#diff-bd717cea01612bd72bed0f327a6962871ace61b88d24887ea3b8576c24fa3485R51-R55) [[5]](diffhunk://#diff-ed90ed77fe68bef3c2ff2f7982a20112cb30413d92e889f12a5673ca294c6955R37-R43) [[6]](diffhunk://#diff-ed90ed77fe68bef3c2ff2f7982a20112cb30413d92e889f12a5673ca294c6955R59-R63) [[7]](diffhunk://#diff-69f2760d130ff5f36917becadeef5b836cee481db5b38f464fdfdbb161949c77R25-R31) [[8]](diffhunk://#diff-69f2760d130ff5f36917becadeef5b836cee481db5b38f464fdfdbb161949c77R41-R45) [[9]](diffhunk://#diff-75c2a6ba6de9154ed68703398de86936973b6a1f02978992e53b1957926e00fbR25-R31) [[10]](diffhunk://#diff-75c2a6ba6de9154ed68703398de86936973b6a1f02978992e53b1957926e00fbR42-R46) ### Refactoring context resolution: * [`src/functions/private/Auth/Context/Resolve-GitHubContext.ps1`](diffhunk://#diff-096a5462baf72d04ba840145e46b05d4651afb1cce7c439631f4442c239f63e1L35-R35): Refactored context resolution by removing verbose logging of the context and initializing GitHub configuration. [[1]](diffhunk://#diff-096a5462baf72d04ba840145e46b05d4651afb1cce7c439631f4442c239f63e1L35-R35) [[2]](diffhunk://#diff-096a5462baf72d04ba840145e46b05d4651afb1cce7c439631f4442c239f63e1L47-R46) [[3]](diffhunk://#diff-096a5462baf72d04ba840145e46b05d4651afb1cce7c439631f4442c239f63e1L62-L64) ### Additional changes: * [`src/functions/private/Config/Initialize-GitHubConfig.ps1`](diffhunk://#diff-0bd6f61981cdae153b550552b394da11c794e8ad8ae819fbb7bb702022a02e5dL32-R49): Updated verbose messages and logic for initializing GitHub configuration. * [`tests/GitHub.Tests.ps1`](diffhunk://#diff-0b1d9ba345a583adce874126c13d6edd3f789416bb9c4db5df1e18af3608554cR114-R140): Added tests for various meta commands to ensure they return non-empty responses. ## 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
- Loading branch information
1 parent
2d3e1bd
commit 5de98ee
Showing
11 changed files
with
153 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters