Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 29, 2025

This pull request introduces enhancements to the GitHubAppInstallation class, updates related functions to support new features, and adds a new format configuration for displaying GitHubAppInstallation objects. The changes improve the handling of URLs, streamline object creation, and enhance the output formatting for better usability.

Enhancements to GitHubAppInstallation class:

  • Added a new $Url property to store the profile URL of the target based on its type, and updated the constructor to populate this property using html_url from the API response.
  • Modified the $Target property to include Name, Type, and Url, dynamically constructing the URL based on the HostName parameter.
  • Updated the $Url property to provide a direct link to the installation settings page using the HostName, Type, and Target.

Format configuration for GitHubAppInstallation:

  • Added a new XML-based format file to define table and list views for GitHubAppInstallation objects. The table view includes hyperlinks for ID and Target.Name when supported, and the list view includes all relevant properties such as Url, Permissions, and Events.

Updates to related functions:

  • Updated Get-GitHubEnterpriseOrganizationAppInstallation to pass the HostName parameter when creating GitHubAppInstallation objects, and defined the .OUTPUTS section to specify the output type.
  • Updated Get-GitHubOrganizationAppInstallation to define the .OUTPUTS section, specifying that the function outputs GitHubAppInstallation objects.

Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 🩹 [Patch]: Make a default format for GitHubAppInstallations 🩹 [Patch]: Add URL generation and default formatting for GitHubAppInstallations Jun 29, 2025
@Copilot Copilot AI requested a review from MariusStorhaug June 29, 2025 14:52
Copilot finished work on behalf of MariusStorhaug June 29, 2025 14:52
@MariusStorhaug MariusStorhaug marked this pull request as ready for review June 30, 2025 13:10
@Copilot Copilot AI review requested due to automatic review settings June 30, 2025 13:10
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner June 30, 2025 13:10
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 adds URL generation support for GitHubAppInstallation objects and provides default formatting views.

  • Introduces a new Url property and updates constructors in GitHubAppInstallation.ps1 to generate profile and installation URLs.
  • Updates organization and enterprise cmdlets to emit GitHubAppInstallation and pass a custom hostname.
  • Adds GitHubAppInstallation.Format.ps1xml with table and list views that hyperlink properties.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/functions/private/Apps/GitHub Apps/Get-GitHubOrganizationAppInstallation.ps1 Added .OUTPUTS comment documenting the output type.
src/functions/private/Apps/GitHub Apps/Get-GitHubEnterpriseOrganizationAppInstallation.ps1 Added .OUTPUTS and updated the loop to iterate over response data and include hostname in constructor.
src/formats/GitHubAppInstallation.Format.ps1xml Created table and list views for GitHubAppInstallation, including hyperlink formatting.
src/classes/public/App/GitHubAppInstallation.ps1 Added Url property and updated constructors to generate URLs based on target type and hostname.
Comments suppressed due to low confidence (1)

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

  • Changed iteration target from $.Response.installations to $.Response may break if the API still returns an installations property; verify the response schema and update the loop to avoid missing items.
            foreach ($installation in $_.Response) {

@MariusStorhaug MariusStorhaug merged commit 66a92bf into main Jun 30, 2025
11 checks passed
@MariusStorhaug MariusStorhaug deleted the copilot/fix-442 branch June 30, 2025 14:03
Copy link
Contributor

Module GitHub - 0.32.3 published to the PowerShell Gallery.

Copy link
Contributor

GitHub release for GitHub v0.32.3 has been created.

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

Successfully merging this pull request may close these issues.

🩹 [Patch]: Make a default format for GitHubAppInstallations
2 participants