Skip to content

Comments

🚀 [Feature]: Custom properties now included in repository queries by default#561

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-customproperties-to-graphql
Open

🚀 [Feature]: Custom properties now included in repository queries by default#561
Copilot wants to merge 5 commits intomainfrom
copilot/add-customproperties-to-graphql

Conversation

Copy link
Contributor

Copilot AI commented Feb 22, 2026

Repository queries by name and by owner now return CustomProperties by default — no additional parameters needed. Fork listings now also return typed [GitHubRepository] objects instead of raw API responses, making them consistent with other repository commands.

New: Custom properties included in by-name and by-owner queries

Get-GitHubRepository now returns CustomProperties when querying by name or listing by owner, without needing -AdditionalProperty 'CustomProperties'.

# Both of these now include CustomProperties in the output:
Get-GitHubRepository -Owner 'myorg' -Name 'myrepo'
Get-GitHubRepository -Owner 'myorg'

Previously, these required an explicit parameter:

# Before: required -AdditionalProperty to get CustomProperties
Get-GitHubRepository -Owner 'myorg' -Name 'myrepo' -AdditionalProperty 'CustomProperties'

Changed: Fork listings return typed repository objects

Get-GitHubRepositoryFork now returns [GitHubRepository] objects instead of raw PSCustomObject responses. This means fork listings include all typed properties (including CustomProperties), consistent with other repository commands.

$forks = Get-GitHubRepositoryFork -Owner 'octocat' -Name 'Hello-World'
$forks[0].GetType().Name  # GitHubRepository (was PSCustomObject)

Technical Details

  • Added 'CustomProperties' to the default $Property array in two private GraphQL functions: Get-GitHubRepositoryByName and Get-GitHubRepositoryListByOwner. This causes the GraphQL query to include the repositoryCustomPropertyValues(first: 100) { nodes { propertyName value } } sub-query by default.
  • Get-GitHubMyRepositories and Get-GitHubMyRepositoryByName were initially updated but reverted — these authenticated-user queries do not need the change.
  • Updated Get-GitHubRepositoryFork to cast each response item via [GitHubRepository]::new($repo) and added [OutputType([GitHubRepository])], matching the pattern used by Get-GitHubRepositoryListByTeam.
  • No changes to the GitHubRepository class — it already supports both REST (custom_properties) and GraphQL (repositoryCustomPropertyValues.nodes) formats in its constructors.

…ryFork casting

Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CustomProperties to GraphQL output for Get-GitHubRepository Add CustomProperties to default property lists for all Get-GitHubRepository code paths Feb 22, 2026
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title Add CustomProperties to default property lists for all Get-GitHubRepository code paths 🚀 [Minor]: Custom properties now included in all repository queries by default Feb 22, 2026
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🚀 [Minor]: Custom properties now included in all repository queries by default 🚀 [Feature]: Custom properties now included in all repository queries by default Feb 22, 2026
…es and Get-GitHubMyRepositoryByName functions
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🚀 [Feature]: Custom properties now included in all repository queries by default 🚀 [Feature]: Custom properties now included in repository queries by default Feb 22, 2026
@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as ready for review February 22, 2026 20:09
Copilot AI review requested due to automatic review settings February 22, 2026 20:09
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 pull request enhances repository queries to include custom properties by default and standardizes the output format of fork listings. The changes make the CustomProperties field available without requiring explicit parameters for commonly-used repository query paths, and ensure fork listings return strongly-typed [GitHubRepository] objects instead of raw API responses.

Changes:

  • Added CustomProperties to the default property list in Get-GitHubRepositoryByName and Get-GitHubRepositoryListByOwner, enabling custom property data to be included automatically in GraphQL queries for repositories by name and by owner
  • Updated Get-GitHubRepositoryFork to cast response objects to [GitHubRepository] type and added [OutputType([GitHubRepository])] attribute, making fork listings consistent with other repository query commands

Reviewed changes

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

File Description
src/functions/public/Repositories/Repositories/Get-GitHubRepositoryFork.ps1 Added [OutputType([GitHubRepository])] attribute and changed output from raw $_.Response to foreach ($repo in $_.Response) { [GitHubRepository]::new($repo) } to return strongly-typed repository objects
src/functions/private/Repositories/Get-GitHubRepositoryListByOwner.ps1 Added 'CustomProperties' to the default $Property array, enabling custom properties to be included by default when listing repositories by owner
src/functions/private/Repositories/Get-GitHubRepositoryByName.ps1 Added 'CustomProperties' to the default $Property array (with required trailing comma on previous item), enabling custom properties to be included by default when getting a repository by name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Add CustomProperties to default GraphQL property lists for all Get-GitHubRepository paths

2 participants