Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Apr 11, 2025

Description

This pull request introduces significant enhancements to GitHub Release capabilities, including new PowerShell classes, functions, and examples for handling releases and release assets.

Enhancements to GitHub Release capabilities

  • Added the GitHubRelease class to represent release metadata, including properties like Tag, Name, Notes, IsLatest, IsDraft, and IsPrerelease, along with constructors for initializing instances from API responses for both REST and GraphQL.
  • Introduced the GitHubReleaseAsset class to handle release asset details, such as Url, Name, State, ContentType, and Downloads.
  • Created a custom format file to define table and list views for GitHubRelease objects, improving data visualization in PowerShell.

Function changes

  • Introduced some GraphQL based functions for requesting info on Releases and Assets, as GQL has a more holistic set of properties available, i.e. IsLatest.
  • Updated all functions to output the new classes. Updated tests to verify that all functions return class based content.
  • Added a function to save (download and extract) assets, similar to Save-GitHubArtifact.

Internal Enhancements

  • Resolved an issue in Resolve-GitHubContextSetting where a PerPage value of 0 is replaced with $null to avoid invalid configurations.

Test coverage

  • Added a new test file for releases and assets. Removed the skips of tests for the functions.
  • Fixed cleanup up in tests that use repositories.

Examples

  • Added extensive PowerShell examples for managing releases, including creating, updating, and deleting releases, as well as handling release assets.

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

@MariusStorhaug MariusStorhaug self-assigned this Apr 11, 2025
@Copilot Copilot AI review requested due to automatic review settings April 11, 2025 15:39
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner April 11, 2025 15:39
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.

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

Files not reviewed (7)
  • src/formats/GitHubOwner.Format.ps1xml: Language not supported
  • src/formats/GitHubRepository.Format.ps1xml: Language not supported
  • src/functions/public/Releases/Get-GitHubRelease.ps1: Language not supported
  • src/functions/public/Releases/New-GitHubRelease.ps1: Language not supported
  • src/functions/public/Releases/New-GitHubReleaseNote.ps1: Language not supported
  • src/functions/public/Repositories/Get-GitHubRepository.ps1: Language not supported
  • src/functions/public/Repositories/New-GitHubRepository.ps1: Language not supported
Comments suppressed due to low confidence (1)

.github/PSModule.yml:13

  • The indentation in the CodeCoverage section appears inconsistent; ensure that the 'Skip: true' line aligns with 'PercentTarget: 50' for correct YAML parsing.
    Skip: true

@MariusStorhaug MariusStorhaug changed the title Fix: Fix classes and functions for Releases 🩹 [Patch]: Fix classes and functions for Releases Apr 11, 2025
…tories and Get-GitHubRepository functions for improved flexibility
…ction for improved default value assignment based on parameter sets
…ameter for overwriting existing files during download and extraction
…nction to improve clarity and handle Username and Organization parameters more effectively
… to remove unnecessary ValueFromPipelineByPropertyName for ID parameter
…repository with mandatory parameters for Owner, Repository, and Context
…ove parameter handling; add GitHubRelease and ReleaseAsset classes for structured release data.
…ted functions to track the latest release status
MariusStorhaug and others added 22 commits May 1, 2025 11:52
…eAssetByTag and Get-GitHubReleaseAssetFromLatest
- Created TEMPLATE.ps1 for test structure and setup.
- Implemented Teams.Tests.ps1 to test GitHub Teams API functionalities including team creation, retrieval, updating, and deletion.
- Added Users.Tests.ps1 to validate user-related API calls such as user retrieval and updates.
- Developed Variables.Tests.ps1 to cover GitHub variable management, including setting, updating, and removing variables across different scopes (organization, repository, environment).
- Created a template test file for GitHub authentication scenarios.
- Implemented tests for GitHub Teams management, including team creation, retrieval, updating, and deletion.
- Developed user-related tests for GitHub user management, covering user retrieval and updates.
- Added extensive variable management tests, including setting, updating, and removing GitHub variables across different scopes (organization, repository, environment).
- Ensured all tests utilize proper logging and context management for better traceability in CI/CD environments.
…ction and make Target parameter mandatory in New-GitHubRelease function
…oke-GitHubAPI and add warning for unknown content types
- Created TEMPLATE.ps1 for Pester testing framework 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 user retrieval and updates.
- Developed Variables.Tests.ps1 to test GitHub variable management across different scopes (organization, repository, environment).
- Each test script includes setup and teardown procedures to manage test context and cleanup.
@MariusStorhaug MariusStorhaug changed the title 🩹 [Patch]: Fix classes and functions for Releases 🚀 [Feature]: Align classes and functions for Releases May 2, 2025
@MariusStorhaug MariusStorhaug merged commit 2ad4676 into main May 2, 2025
10 checks passed
@MariusStorhaug MariusStorhaug deleted the releases branch May 2, 2025 11:59
@github-project-automation github-project-automation bot moved this from Todo to Done in GitHub PowerShell Module May 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2025

Module GitHub - 0.27.0 published to the PowerShell Gallery.

@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2025

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