-
Notifications
You must be signed in to change notification settings - Fork 4
🚀 [Feature]: Add class for GitHubApp
and GitHubAppInstallation
#406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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.
There was a problem hiding this 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
andGitHubApp
classes - Updated
Get-GitHubAppInstallation*
functions to construct and outputGitHubAppInstallation
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])]
… `Get-GitHubAppInstallationForAuthenticatedApp` functions
… to `Target` in GitHub App installation scripts
…d verbose options to connection commands
…AuthenticatedApp and streamline test cases for GitHub App connections
…display in tests to use Format-List
…ping token outputs in a single log entry
…d update related functions to return GitHubApp objects
…bContext function
…nsistency in GitHubApp class
…o use LogGroup for better logging
…gging format for installations
… output formatting in tests
…stent array handling
…on constructors for consistent array handling
…tests to ensure correct data types
- 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.
GitHubAppInstallation
to structure outputsGitHubAppInstallation
to structure outputs
GitHubAppInstallation
to structure outputsGitHubApp
and GitHubAppInstallation
Module GitHub - 0.30.0 published to the PowerShell Gallery. |
GitHub release for GitHub v0.30.0 has been created. |
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.
GitHubAppInstallation
as a class and return from*-GitHubAppInstallation
functions #405New Classes for GitHub Apps and Installations:
src/classes/public/App/GitHubApp.ps1
: Introduced theGitHubApp
class to encapsulate properties and methods for GitHub Apps, includingID
,ClientID
,Slug
,Permissions
, andEvents
. This improves type safety and enables structured handling of app data.src/classes/public/App/GitHubAppInstallation.ps1
: Added theGitHubAppInstallation
class to represent app installations, includingID
,Target
,Permissions
, andCreatedAt
. This facilitates better organization and manipulation of installation data.Updates to Function Outputs:
src/functions/private/Apps/GitHub Apps/Get-GitHubAppByName.ps1
: Changed output type from[pscustomobject]
to[GitHubApp]
and updated the response handling to instantiateGitHubApp
objects. [1] [2]src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedApp.ps1
: Updated output type to[GitHubAppInstallation[]]
and modified response processing to create instances ofGitHubAppInstallation
. [1] [2]src/functions/private/Apps/GitHub Apps/Get-GitHubEnterpriseOrganizationAppInstallation.ps1
: Updated output type to[GitHubAppInstallation]
and adjusted response handling for better type safety. [1] [2]Refinements to Parameter Handling:
src/functions/public/Apps/GitHub App/Get-GitHubApp.ps1
: Improved parameter set names for clarity, such as renaming'BySlug'
to'Get an app by slug'
. Added aliasSlug
for theName
parameter to enhance usability. [1] [2]src/functions/public/Apps/GitHub App Installations/Get-GitHubAppInstallation.ps1
: Refined parameter sets to clearly differentiate between listing installations for enterprises, organizations, and authenticated apps. [1] [2]Adjustments to Existing Classes:
src/classes/public/Owner/GitHubOwner.ps1
: Updated property mappings to handle bothslug
andlogin
forName
and added fallback forBlog
usingwebsite_url
.Context Improvements:
src/functions/private/Auth/Context/Set-GitHubContext.ps1
: Updated context object properties to use the newGitHubApp
class, ensuring consistency and type safety across app-related context data. [1] [2]Type of change
Checklist