Skip to content

Conversation

MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Sep 17, 2025

Description

This pull request enhances the Connect-GitHubApp function 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:

  • Added the ability to process multiple installations in parallel using the -ThrottleLimit parameter and PowerShell's parallel execution features (ForEach-Object -Parallel). This applies to all installations, filtered targets, and piped installation objects. [1] [2]
  • Introduced new parameter sets and updated existing ones to support pipeline input for installations, as well as parallel execution controls.

Documentation & Usability Updates:

  • Expanded the function's documentation and examples to describe parallel usage scenarios and the new -ThrottleLimit parameter. [1] [2] [3]

Robustness Enhancements:

  • Implemented retry logic when creating context objects, improving reliability in case of transient failures.

Configuration File Updates:

  • Updated .github/PSModule.yml to enable skipping of test results, source code, module builds, and documentation in CI workflows, aligning with the new parallel processing capabilities.

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

- 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.
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner September 17, 2025 15:12
@Copilot Copilot AI review requested due to automatic review settings September 17, 2025 15:12
Copy link
Contributor

@Copilot Copilot AI left a 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 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 -Parallel with 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.

…reation and removing unnecessary Write-Host statements in Connect-GitHubApp
…GitHubPermission class with equality and hash code methods
…ion comparison logic in GitHubAppInstallation class
…n GitHubAppContext and GitHubAppInstallationContext
…ppContext and streamline app property initialization
…t-GitHubAppInstallationForAuthenticatedAppAsList function
…le for property assignment; enhance GitHubAppContext to handle null permissions and app objects; improve parameter sets in Get-GitHubAppInstallation function for clarity.
…nect-GitHubApp functions for consistency; enhance verbosity handling in Connect-GitHubApp; add logging for GitHub app details in Apps.Tests.
… of GitHub context in the 'Context' log group.
…each loop with Compare-Object for improved performance and readability.
…ct for improved performance; remove redundant equality check in GitHubPermission class.
…nalities in Apps.Tests; improve logging for better visibility of app details and webhook configurations.
…on tests; improve test coverage for context properties.
…rmissionDefinition function and associated completers for improved clarity and maintainability.
…mission.NewList for consistency and improved clarity.
…s.Tests; replace deprecated methods with new implementations for improved clarity and maintainability.
- Created TEMPLATE.ps1 for standardized test structure.
- Implemented Teams.Tests.ps1 to validate GitHub Teams API functionality, including team creation, retrieval, updating, and deletion.
- Developed Users.Tests.ps1 to test user-related API calls, such as fetching user details and managing user emails.
- Established Variables.Tests.ps1 to cover GitHub variable management, including organization and repository variables.
- Ensured all tests utilize proper authentication and context management for reliable execution.
- Added logging for better visibility during test runs.
…ion IDs and improve pipeline handling; update Apps.Tests for better coverage and clarity.
…erty to organization objects and updating constructors for consistency across classes.
… context in installation objects for improved data handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

🩹 [Patch]: Optimize Connect-GitHubApp and use parallel processing of access tokens
1 participant