🩹 [Patch]: Add tests for Meta + GitHubAPI fixes #195
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
: 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
: Addedbegin
,process
, andend
blocks with verbose logging for better traceability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Refactoring context resolution:
src/functions/private/Auth/Context/Resolve-GitHubContext.ps1
: Refactored context resolution by removing verbose logging of the context and initializing GitHub configuration. [1] [2] [3]Additional changes:
src/functions/private/Config/Initialize-GitHubConfig.ps1
: Updated verbose messages and logic for initializing GitHub configuration.tests/GitHub.Tests.ps1
: Added tests for various meta commands to ensure they return non-empty responses.Type of change
Checklist