🩹 [Patch]: Optimize Connect-GitHubApp and use parallel processing of access tokens#519
Open
MariusStorhaug wants to merge 76 commits intomainfrom
Open
🩹 [Patch]: Optimize Connect-GitHubApp and use parallel processing of access tokens#519MariusStorhaug wants to merge 76 commits intomainfrom
MariusStorhaug wants to merge 76 commits intomainfrom
Conversation
…s and improve examples
- Created TEMPLATE.ps1 for Pester tests with a template structure. - Added Teams.Tests.ps1 to test GitHub Teams API functionalities including team creation, retrieval, updating, and deletion. - Introduced Users.Tests.ps1 to validate user-related API calls, including user retrieval and updates. - Implemented Variables.Tests.ps1 to manage GitHub repository variables, including setting, updating, and removing variables.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Connect-GitHubApp function to support parallel processing of GitHub App installation connections, significantly improving performance when connecting to multiple installations. The changes introduce new parameter sets for handling pipeline input and parallel execution controls.
- Added parallel processing capabilities using
ForEach-Object -Parallelwith configurable throttle limits - Introduced new parameter set for accepting installation objects from pipeline input
- Added retry logic for context creation to improve reliability
Reviewed Changes
Copilot reviewed 2 out of 17 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/functions/public/Auth/Connect-GitHubApp.ps1 | Major refactoring to support parallel processing, new parameter sets, and recursive connections to installations |
| .github/PSModule.yml | Configuration updates to skip various test components in CI workflows |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…e and improve parallel processing
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0a4ce89 to
7212939
Compare
…reation and removing unnecessary Write-Host statements in Connect-GitHubApp
…missionDefinition class
…gic for module import in Connect-GitHubApp
…GitHubPermission class with equality and hash code methods
…ion comparison logic in GitHubAppInstallation class
…d adjusting property names
…n GitHubAppContext and GitHubAppInstallationContext
…ppContext and streamline app property initialization
…rEnterpriseOrganization function
…t-GitHubAppInstallationForAuthenticatedAppAsList function
…nstallationForAuthenticatedAppByID function
…pInstallation function for clarity
…ostName parameter for URL generation
…prove error handling
…llationContext to streamline the class structure.
…itialization and allow URL override for improved flexibility.
…lude URL, enhancing object creation efficiency across multiple functions.
…include App context, improving object creation clarity in installation retrieval functions.
…lly assign App object, improving flexibility in object creation. Update GitHubUser constructor to use null coalescing for bio and ensure direct assignment for followers and following properties.
… improved parallel processing of installations. Update context handling to utilize using scope for better variable access in parallel execution.
…use the correct module name, ensuring compatibility with the latest module structure.
… module context, improving module management and accessibility.
… variables for improved parallel processing and module version handling.
…cted installations for improved parallel processing in Connect-GitHubApp.
…ntext parameter handling in Connect-GitHubApp for enhanced performance.
…arameters to improve clarity and maintainability in Connect-GitHubApp.
…ext parameter handling for improved clarity and performance in Connect-GitHubApp.
…or revoking installation access tokens in GitHub App. 🚀 [Add]: Create Resolve-GitHubContext filter to resolve context into GitHubContext object for improved context handling. 🚀 [Add]: Introduce Set-GitHubContext function to set and store GitHub context in the vault for API authentication. 🚀 [Update]: Enhance Disconnect-GitHubAccount function to support wildcard context resolution for improved usability. 🚀 [Add]: Add Get-GitHubToken function to retrieve GitHub tokens from environment variables as plaintext or secure string.
f1b7971 to
46f54a0
Compare
…tallations for improved parallel processing in Connect-GitHubApp.
…r improved clarity in end processing of Connect-GitHubApp.
…t for controlling parallel thread usage during disconnection.
… removal from the vault with support for single and multiple contexts.
…into parallelConnect
…ailed output for GitHub app, configuration, and installation details.
… for enhanced debugging and logging during installation context.
…nstallation to streamline test execution.
…r pipeline usage in Connect-GitHubApp function.
…unctions to support multi-string and wildcard context resolution.
…ext variable usage in Remove-GitHubContext.
…ort-Object for unique sorting and improve debug output.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 enhances the
Connect-GitHubAppfunction to support parallel and recursive creation of connections to multiple GitHub App installations, improving scalability and performance. It also updates the documentation and parameter handling to reflect these new capabilities. The changes are grouped below by theme:Parallel Processing & Scalability Improvements:
-ThrottleLimitparameter and PowerShell's parallel execution features (ForEach-Object -Parallel). This applies to all installations, filtered targets, and piped installation objects. [1] [2]Documentation & Usability Updates:
-ThrottleLimitparameter. [1] [2] [3]Robustness Enhancements:
Configuration File Updates:
.github/PSModule.ymlto enable skipping of test results, source code, module builds, and documentation in CI workflows, aligning with the new parallel processing capabilities.Type of change
Checklist