Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jun 6, 2025

Description

This pull request includes breaking changes such as moving a public function to private, and exposing its functionality through an existing public function, Get-GitHubOrganization.

Changes to private function Get-GitHubAppInstallableOrganization:

  • Moved the file from public to private to reflect its intended usage.
  • Made the $Context parameter mandatory, removing the default value of (Get-GitHubContext).
  • Updated the output handling to return a GitHubOrganization object instead of raw API responses, improving type safety.
  • Removed a placeholder comment about skipping tests for this function.

Enhancements to Get-GitHubOrganization:

  • Added a new parameter set to support fetching organizations by enterprise slug ($Enterprise). This includes marking the $Enterprise parameter as mandatory for the new parameter set.
  • Introduced a new .EXAMPLE section in the documentation to demonstrate usage with the enterprise parameter.
  • Incorporated a new logic branch in the switch statement to handle enterprise organizations by calling the Get-GitHubAppInstallableOrganization function.

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

Copilot AI review requested due to automatic review settings June 6, 2025 11:52
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner June 6, 2025 11:52
Copy link
Contributor

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 Get-GitHubOrganization to support enterprise-scoped queries and refactors the helper Get-GitHubAppInstallableOrganization for stronger typing and mandatory context.

  • Added an -Enterprise parameter set and example to Get-GitHubOrganization
  • Updated Get-GitHubOrganization switch to call the private function for enterprise orgs
  • Refactored Get-GitHubAppInstallableOrganization to require $Context and return GitHubOrganization objects

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/functions/public/Organization/Get-GitHubOrganization.ps1 Added -Enterprise parameter, example usage, and switch branch
src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallableOrganization.ps1 Made $Context mandatory and return typed GitHubOrganization
Comments suppressed due to low confidence (3)

src/functions/public/Organization/Get-GitHubOrganization.ps1:65

  • Add a .PARAMETER Enterprise entry in the function comment block to document this new parameter in the generated help.
# The Enterprise slug to get organizations from.

src/functions/public/Organization/Get-GitHubOrganization.ps1:111

  • Add a Pester test for the -Enterprise parameter set to ensure Get-GitHubOrganization invokes the enterprise path correctly.
'EnterpriseOrganizations' {

src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallableOrganization.ps1:51

  • Add a test for Get-GitHubAppInstallableOrganization to verify that API responses are correctly wrapped in GitHubOrganization objects.
[GitHubOrganization]::new($_.Response)

@MariusStorhaug MariusStorhaug self-assigned this Jun 6, 2025
@MariusStorhaug MariusStorhaug merged commit 5eec977 into main Jun 6, 2025
10 checks passed
@MariusStorhaug MariusStorhaug deleted the installableOrg branch June 6, 2025 14:44
@github-project-automation github-project-automation bot moved this from Todo to Done in GitHub PowerShell Module Jun 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Module GitHub - 0.29.0 published to the PowerShell Gallery.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2025

GitHub release for GitHub v0.29.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.

1 participant