Skip to content

Conversation

MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jun 10, 2025

Description

This pull request introduces significant enhancements to the GitHub Apps module by adding new classes, improving type safety, and refining existing functions. The changes focus on creating structured representations for GitHub Apps and their installations, updating function outputs to use these new types, and improving parameter handling for better usability and clarity.

New Classes for GitHub Apps and Installations:

  • src/classes/public/App/GitHubApp.ps1: Introduced the GitHubApp class to encapsulate properties and methods for GitHub Apps, including ID, ClientID, Slug, Permissions, and Events. This improves type safety and enables structured handling of app data.
  • src/classes/public/App/GitHubAppInstallation.ps1: Added the GitHubAppInstallation class to represent app installations, including ID, Target, Permissions, and CreatedAt. This facilitates better organization and manipulation of installation data.

Updates to Function Outputs:

Refinements to Parameter Handling:

Adjustments to Existing Classes:

Context Improvements:

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 structuring Pester tests.
- Added Teams.Tests.ps1 to test GitHub Teams API functionalities, including team creation, retrieval, updating, and deletion.
- Implemented Users.Tests.ps1 for testing user-related API calls, such as fetching user details and updating user information.
- Developed Variables.Tests.ps1 to validate GitHub variable management, including setting, updating, and removing variables for users, organizations, and repositories.
@MariusStorhaug MariusStorhaug self-assigned this Jun 10, 2025
@Copilot Copilot AI review requested due to automatic review settings June 10, 2025 13:07
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner June 10, 2025 13:07
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 introduces a new GitHubAppInstallation class to structure API outputs and updates several cmdlets to emit instances of this class.

  • Added GitHubAppInstallation and GitHubApp classes
  • Updated Get-GitHubAppInstallation* functions to construct and output GitHubAppInstallation objects
  • Adjusted GitHubOwner mapping and YAML CI skips

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/functions/public/Apps/GitHub App Installations/Get-GitHubAppInstallation.ps1 Set OutputType and updated CmdletBinding parameter set name
src/functions/private/Apps/GitHub Apps/Get-GitHubOrganizationAppInstallation.ps1 Changed output to instantiate GitHubAppInstallation objects
src/functions/private/Apps/GitHub Apps/Get-GitHubEnterpriseOrganizationAppInstallation.ps1 Updated OutputType and output mapping
src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedApp.ps1 Added OutputType and wrapped API response in GitHubAppInstallation
src/classes/public/Owner/GitHubOwner.ps1 Enhanced Name and Blog property assignments
src/classes/public/App/GitHubAppInstallation.ps1 New class defining structured installation data
src/classes/public/App/GitHubApp.ps1 New class defining basic app info
.github/PSModule.yml Skipped more build and test jobs
Comments suppressed due to low confidence (3)

src/functions/private/Apps/GitHub Apps/Get-GitHubOrganizationAppInstallation.ps1:18

  • This function emits multiple GitHubAppInstallation instances; update the OutputType to [GitHubAppInstallation[]] to reflect the array output.
[OutputType([GitHubAppInstallation])]

src/functions/private/Apps/GitHub Apps/Get-GitHubEnterpriseOrganizationAppInstallation.ps1:17

  • The .NOTES link is empty; please add the correct GitHub REST API URL for listing enterprise organization installations.
[List GitHub Apps installed on an enterprise-owned organization]()

src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedApp.ps1:20

  • This cmdlet returns multiple installations for the authenticated app; change the OutputType to [GitHubAppInstallation[]] to accurately document the array output.
[OutputType([GitHubAppInstallation])]

@PSModule PSModule deleted a comment from Copilot AI Jun 10, 2025
… `Get-GitHubAppInstallationForAuthenticatedApp` functions
… to `Target` in GitHub App installation scripts
…AuthenticatedApp and streamline test cases for GitHub App connections
…d update related functions to return GitHubApp objects
- Created TEMPLATE.ps1 for structuring Pester tests with authentication cases.
- 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 such as user retrieval and updates.
- Implemented Variables.Tests.ps1 to manage GitHub repository and organization variables, including creation, updating, and deletion of variables.
@MariusStorhaug MariusStorhaug changed the title Add class for GitHubAppInstallation to structure outputs 🚀 [Feature]: Add class for GitHubAppInstallation to structure outputs Jun 12, 2025
@MariusStorhaug MariusStorhaug changed the title 🚀 [Feature]: Add class for GitHubAppInstallation to structure outputs 🚀 [Feature]: Add class for GitHubApp and GitHubAppInstallation Jun 12, 2025
@MariusStorhaug MariusStorhaug merged commit 3367f90 into main Jun 12, 2025
10 checks passed
@MariusStorhaug MariusStorhaug deleted the fixGitHubAppInstallation branch June 12, 2025 11:31
Copy link
Contributor

Module GitHub - 0.30.0 published to the PowerShell Gallery.

Copy link
Contributor

GitHub release for GitHub v0.30.0 has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

🩹 [Patch]: Add GitHubAppInstallation as a class and return from *-GitHubAppInstallation functions
1 participant