-
Couldn't load subscription status.
- Fork 5
🩹 [Patch]: Bump Context and Sodium to latest versions
#401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… `Get-GitHubContext` to simplify parameter usage
…n `Remove-Context` call
…HubConfig, Remove-GitHubConfig, and Set-GitHubConfig by removing redundant ID parameter
…o name is provided
…eam for better readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This patch updates dependency versions and enhances context handling by introducing a ContextVault parameter, adjusting default configuration, and adding separators in test teardown.
- Added
ContextVaultparameter to allSet-Context/Get-Contextcalls and a newContextVaultproperty in$script:GitHub. - Bumped
Contextmodule requirement to8.0.0andSodiumto2.2.0across scripts. - Changed default config
IDfrom'PSModule.GitHub'to a shorter'Module'and added visual separators in test AfterAll blocks.
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/TEMPLATE.ps1 | Added Write-Host separator after disconnect |
| tests/Secrets.Tests.ps1 | Added Write-Host separator after disconnect |
| tests/Repositories.Tests.ps1 | Added Write-Host separator after disconnect |
| tests/Releases.Tests.ps1 | Added Write-Host separator after disconnect |
| tests/Organizations.Tests.ps1 | Added Write-Host separator after disconnect |
| tests/GitHub.Tests.ps1 | Added Write-Host separator after multiple AfterAll blocks |
| tests/Environments.Tests.ps1 | Added Write-Host separator after disconnect |
| tests/Artifacts.Tests.ps1 | Added Write-Host separator after disconnect |
| src/variables/private/GitHub.ps1 | Introduced ContextVault, updated default ID |
| src/functions/public/Secrets/Set-GitHubSecret.ps1 | Removed top #Requires, added bottom #Requires for Sodium |
| src/functions/public/Config/Set-GitHubConfig.ps1 | Updated Set-Context calls to include -Vault |
| src/functions/public/Config/Remove-GitHubConfig.ps1 | Updated Set-Context calls to include -Vault |
| src/functions/public/Config/Get-GitHubConfig.ps1 | Replaced direct config return with Get-Context -Vault |
| src/functions/public/Auth/Context/Get-GitHubContext.ps1 | Updated Get-Context calls, simplified ID construction |
| src/functions/public/Auth/Connect-GitHubAccount.ps1 | Streamed verbose output via Format-* -Stream |
| src/functions/private/Config/Initialize-GitHubConfig.ps1 | Updated Get-Context/Set-Context to include -Vault |
| src/functions/private/Auth/DeviceFlow/Update-GitHubUserAccessToken.ps1 | Added -Vault to Set-Context |
| src/functions/private/Auth/Context/Set-GitHubContext.ps1 | Updated Set-Context to include -Vault, removed prefixed ID |
| src/functions/private/Auth/Context/Remove-GitHubContext.ps1 | Updated Remove-Context to include -Vault, removed prefix |
| examples/Connecting.ps1 | Bumped #Requires directive for Context module |
Comments suppressed due to low confidence (5)
src/functions/public/Secrets/Set-GitHubSecret.ps1:146
- PowerShell #Requires directives must appear before any script code to be effective. Move this directive to the top of the file, before the function definition.
#Requires -Modules @{ ModuleName = 'Sodium'; RequiredVersion = '2.2.0' }
src/variables/private/GitHub.ps1:6
- [nitpick] The default config ID 'Module' is very generic and could collide with other modules. Consider a more descriptive identifier like 'GitHubModule' or retain 'PSModule.GitHub'.
ID = 'Module'
src/functions/public/Config/Get-GitHubConfig.ps1:33
- Excluding the ID property may break consumers that expect it on the returned object. Consider retaining the ID or documenting that it is intentionally removed.
Get-Context -ID $script:GitHub.Config.ID -Vault $script:GitHub.ContextVault | Select-Object -ExcludeProperty ID
src/functions/private/Auth/Context/Remove-GitHubContext.ps1:39
- The ID passed to Remove-Context is just the context name, but stored contexts include the module namespace. Use the full ID (e.g., "$($script:GitHub.Config.ID)/$Context") to ensure the correct vault entry is removed.
Remove-Context -ID $Context -Vault $script:GitHub.ContextVault
src/functions/private/Auth/Context/Set-GitHubContext.ps1:145
- Storing contexts by name only may overwrite or collide entries if multiple modules share a vault. Prefix the ID with the module namespace (e.g., "$(
$script:GitHub.Config.ID)/$ ($contextObj['Name'])").
Set-Context -ID $($contextObj['Name']) -Context $contextObj -Vault $script:GitHub.ContextVault
…d Connect-GitHubApp for improved output formatting; correct warning message in Disconnect-GitHubAccount
…iple scripts for consistency
…ect-GitHubApp by adding -Debug and -Verbose flags
…ed readability and debugging output
…iple scripts for consistency; add -PassThru parameter to Set-Context calls for improved functionality
…ecting.ps1 for consistency
… for consistency across scripts
…-GitHubContext for improved context retrieval
…and Invoke-GitHubAPI for enhanced debugging output
… in Get-GitHubLicense for improved readability
…racters before function and filter declarations across multiple files.
… in Get-GitHubContext for improved output visibility
… improved visibility
…Set-GitHubContext and Get-GitHubContext for improved visibility
…n Set-GitHubContext for improved output visibility
…Set-GitHubContext for improved debugging visibility
…Name, Get-GitHubLicenseList, and Get-GitHubRepositoryLicense functions for cleaner code 🩹 [Patch]: Replace Write-Host with Write-Debug for context output in Get-GitHubContext for improved debugging visibility
…ByName and Get-GitHubGitignoreList functions for cleaner code
…I call and adjust output formatting in Get-GitHubRateLimit for consistency
… to allow bypassing context validation
…lidation for 'Anonymous' requests
…for 'Anonymous' context
…HubContext; enhance context handling in Resolve-GitHubContext for 'Anonymous' cases
…rove error handling and streamline checks for 'Anonymous' AuthType
…ymous' GitHubContext object with verbose logging
…racePeriodInHours, PerPage, RetryCount, RetryInterval, and JwtTimeTolerance; modify Invoke-GitHubAPI to check Context.Name for 'Anonymous'
|
Module GitHub - 0.29.3 published to the PowerShell Gallery. |
|
GitHub release for GitHub v0.29.3 has been created. |
Description
This pull request updates the GitHub module to improve context management by introducing a
ContextVaultparameter and upgrading module dependencies. The most significant changes include adding theContextVaultparameter to context-related functions, updating the required module versions, and modifying the default configuration structure. As a result of these changes, theAnonymousevaluation and default context resolution is changed.Context Management Updates
ContextVaultparameter toSet-ContextandGet-Contextcalls across multiple functions, ensuring context data is stored and retrieved from the specified vault ($script:GitHub.ContextVault).ContextVaultproperty in the$script:GitHubobject to centralize vault configuration.Dependency Updates
Contextmodule from version7.0.2to8.0.2Sodiummodule from version2.1.2to2.2.0Context resolution
Anonymousand default context resolution to theResolve-GitHubContextfunction to streamline context retrieval.Type of change
Checklist