Skip to content

Fix ConvertFrom-ClearlyDefinedCoordinates to handle API object coordinates#26893

Open
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-package-type-validation
Open

Fix ConvertFrom-ClearlyDefinedCoordinates to handle API object coordinates#26893
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-package-type-validation

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

ConvertFrom-ClearlyDefinedCoordinates only accepted [string] input, but Get-ClearlyDefinedData returns the raw ClearlyDefined API response whose coordinates property is a deserialized PSCustomObject — not a string. PowerShell coerced the object to "@{type=nuget; provider=nuget; name=Markdig.Signed; revision=1.0.0}", which split by / produced no useful parts, causing Start-ClearlyDefinedHarvest to fail [ValidateSet('nuget')] on PackageType.

Changes

  • tools/clearlyDefined/src/ClearlyDefined/ClearlyDefined.psm1: Removed [string] type constraint from ConvertFrom-ClearlyDefinedCoordinates and added branch logic to handle both input forms:
    • String (e.g. from failed API calls where coordinates is stored as "nuget/nuget/-/Name/Version"): splits by / as before
    • Object (PSCustomObject from a successful API response): extracts type, provider, namespace, name, revision properties directly
# Before: only handled string input
[string] $Coordinates
$parts = $Coordinates.Split('/')

# After: handles both string and object (API response) input
$Coordinates  # untyped
if ($Coordinates -is [string]) {
    $parts = $Coordinates.Split('/')
    [PSCustomObject]@{ type = $parts[0]; ... }
} else {
    [PSCustomObject]@{ type = $Coordinates.type; name = $Coordinates.name; ... }
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… API response

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix package type validation error in harvesting process Fix ConvertFrom-ClearlyDefinedCoordinates to handle API object coordinates Feb 25, 2026
@TravisEz13 TravisEz13 added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Feb 25, 2026
@TravisEz13 TravisEz13 marked this pull request as ready for review February 27, 2026 14:43
@TravisEz13 TravisEz13 requested review from a team and jshigetomi as code owners February 27, 2026 14:43
Copilot AI review requested due to automatic review settings February 27, 2026 14:43
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 primarily fixes ConvertFrom-ClearlyDefinedCoordinates to correctly handle coordinates values returned as deserialized API objects (in addition to the existing string form), preventing downstream failures when harvesting ClearlyDefined data. It also includes several dependency/version updates across manifests and projects.

Changes:

  • Update ConvertFrom-ClearlyDefinedCoordinates to accept either a coordinate string or an API PSCustomObject and normalize both into the same output shape.
  • Update cgmanifest registrations and various project dependencies (e.g., Markdig.Signed, System.Data.SqlClient, Perfolizer, Microsoft.NET.Test.Sdk).
  • Bump .NET SDK image version in DotnetRuntimeMetadata.json.

Reviewed changes

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

Show a summary per file
File Description
tools/clearlyDefined/src/ClearlyDefined/ClearlyDefined.psm1 Accept object-form coordinates from the ClearlyDefined API and map properties directly.
tools/cgmanifest/main/cgmanifest.json Update component versions and reposition $schema.
test/xUnit/xUnit.tests.csproj Update Microsoft.NET.Test.Sdk package version.
test/tools/TestService/TestService.csproj Update System.Data.SqlClient dependency version.
test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj Update Perfolizer dependency version.
src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj Update System.Data.SqlClient dependency version.
src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj Update Markdig.Signed dependency version.
DotnetRuntimeMetadata.json Update sdkImageVersion.

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

Labels

BackPort-7.4.x-Consider BackPort-7.5.x-Consider BackPort-7.6.x-Consider CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants