Skip to content

Add function to remove app installation as a GitHub App #483

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

MariusStorhaug
Copy link
Member

  • Created TEMPLATE.ps1 for structuring Pester tests with common setup.
  • Added Teams.Tests.ps1 to test GitHub Teams API functionalities including team creation, retrieval, updating, and deletion.
  • Implemented Users.Tests.ps1 to validate user-related API calls such as fetching user details and updating user information.
  • Developed Variables.Tests.ps1 to test GitHub repository and organization variable management, including setting, updating, and removing variables.

Description

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 with common setup.
- Added Teams.Tests.ps1 to test GitHub Teams API functionalities including team creation, retrieval, updating, and deletion.
- Implemented Users.Tests.ps1 to validate user-related API calls such as fetching user details and updating user information.
- Developed Variables.Tests.ps1 to test GitHub repository and organization variable management, including setting, updating, and removing variables.
@Copilot Copilot AI review requested due to automatic review settings July 19, 2025 00:31
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner July 19, 2025 00:31
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 functionality for uninstalling GitHub App installations, along with test infrastructure and configuration changes. The main focus is implementing proper cleanup mechanisms for GitHub App installations in organization contexts.

  • Implements Remove-GitHubAppInstallation private function for deleting app installations via API
  • Enhances Uninstall-GitHubApp public function with improved parameter handling and installation deletion logic
  • Adds comprehensive test coverage for app installation cleanup in organization lifecycle tests

Reviewed Changes

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

File Description
src/functions/private/Apps/GitHub Apps/Remove-GitHubAppInstallation.ps1 New private function implementing GitHub API call to delete app installations
src/functions/public/Apps/GitHub App/Uninstall-GitHubApp.ps1 Enhanced parameter set handling and added default parameter set for installation deletion
tests/Organizations.Tests.ps1 Added pre-test and post-test cleanup logic for app installations in organization tests
.github/PSModule.yml Uncommented configuration to skip various test components and documentation builds
Comments suppressed due to low confidence (1)

tests/Organizations.Tests.ps1:174

  • The test assertion should include a descriptive message to make test failures more informative. Consider adding '-Because' parameter to explain what this assertion validates.
                    $remainingInstallations | Should -BeNullOrEmpty

@MariusStorhaug MariusStorhaug changed the title Add initial test scripts for GitHub API interactions Add function to remove app installation as a GitHub App Jul 22, 2025
… enhance GitHubAppContext with TokenExpiresIn property
…d 10 minutes for 'APP' in GitHub context formatting
…eOrganization function to clarify it uninstalls from enterprise-owned organizations
…parameter handling for improved clarity and functionality
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.

1 participant