Repository navigation
Export tool metadata after NuGet releases - #3867
Connie Yau (conniey) wants to merge 22 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
JSON recovery remains incomplete, and the historical export script has unsafe defaults and misleading success behavior.
Review effort: Balanced
Findings: 4
Open (4)
What changed in this PR
Adds post-release Azure MCP tool metadata export and historical backfill support.
Changes:
- Adds release pipeline export and artifact publication.
- Adds historical-version processing and malformed JSON recovery.
- Expands tests and documentation.
| File | Description |
|---|---|
eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.Tests/UtilityTests.cs |
Tests malformed JSON recovery. |
eng/tools/ToolMetadataExporter/src/Utility.cs |
Escapes malformed JSON control characters. |
eng/tools/ToolMetadataExporter/src/ToolMetadataExporter.csproj |
Enables user-secrets configuration. |
eng/tools/ToolMetadataExporter/src/README.md |
Removes superseded nested documentation. |
eng/tools/ToolMetadataExporter/src/Export-DownloadedVersions.ps1 |
Adds historical-version exports. |
eng/tools/ToolMetadataExporter/README.md |
Documents configuration and workflows. |
eng/scripts/Invoke-ReleaseToolMetadataExport.ps1 |
Exports metadata from signed packages. |
eng/pipelines/templates/variables/tool-metadata-exporter.yml |
Defines release datastore settings. |
eng/pipelines/templates/jobs/release.yml |
Adds the metadata export release job. |
eng/pipelines/templates/common.yml |
Loads metadata exporter variables. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
25af259 to
b560620
Compare
b560620 to
78b3497
Compare
| /// Escapes raw control characters inside JSON strings while preserving structural whitespace. | ||
| /// Historical azmcp versions emitted characters such as U+001A unescaped inside tool descriptions. | ||
| /// </summary> | ||
| private static string EscapeInvalidJsonStringControlCharacters(string json) |
There was a problem hiding this comment.
added because 3.0.0-beta.21 has control characters that are not escaped correctly when returning JSON resulting in a JSON parse exceptions.
| ServerName: ${{ parameters.ServerName }} | ||
| DependsOn: | ||
| - TagRepository | ||
| - PublishNugetPackage |
There was a problem hiding this comment.
PublishNugetPackage already depends on TagRepository, do we need to include it as a dependency here as well?
There was a problem hiding this comment.
Nah. I just wanted to look the same as the other ones and then you'd see there's an additional stage it needed. ;P
There was a problem hiding this comment.
Higher level thought, not sure where to put it, but I'm going to put it here.
We do a lot of effort to build and run tool listing in quite a few places, I'm wondering if we'll be better off by having a source code parser that can get us this information. That'll also allow us to not worry about tools which require external applications to be installed (AZD, azqr, etc).
There was a problem hiding this comment.
That would be nice and a future improvement but since a lot of our existing analyses use the tool at runtime to check tools, I kept it at that.
| throw "ToolMetadataExporter build failed with exit code $LASTEXITCODE." | ||
| } | ||
|
|
||
| $env:AppConfig__WorkDirectory = [System.IO.Path]::GetFullPath($ArtifactDirectory) |
| $successfulPaths = [System.Collections.Generic.HashSet[string]]::new( | ||
| [System.StringComparer]::OrdinalIgnoreCase) | ||
|
|
||
| if (Test-Path -LiteralPath $SuccessfulPathsFile -PathType Leaf) { |
588e477 to
94e1f37
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
94e1f37 to
c28196f
Compare


What does this PR do?
ToolMetadataExporterafter Azure MCP NuGet releases and publishes generated tool-change metadata as a pipeline artifact.Validation:
dotnet test -c Debug --project .\tests\ToolMetadataExporter.Tests\ToolMetadataExporter.Tests.csproj --filter-class "ToolMetadataExporter.Tests.UtilityTests"— passed (2 tests).dotnet build .\src\ToolMetadataExporter.csproj --no-restore --nologo— passed with 0 warnings.GitHub issue number?
https://github.com/microsoft/mcp-pr/issues/268
Pre-merge Checklist
ToolDescriptionEvaluator: N/Aconsolidated-tools.json: N/Aazmcp-commands.md: N/AUpdate-AzCommandsMetadata.ps1: N/Ae2eTestPrompts.md: N/Acrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline