Repository navigation
[Fabric] Extract shared Core HTTP and capacity foundation - #3855
Merged
Amos Hersch (AmosHersch) merged 2 commits intoOct 6, 2026
Merged
Conversation
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
10 of 21 tasks
This was referenced Oct 5, 2026
Amos Hersch (AmosHersch)
marked this pull request as ready for review
October 6, 2026 07:32
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The narrowly scoped foundation is documented, AOT-registered, and comprehensively regression-tested with no unresolved issues found.
Review effort: Balanced
Findings: None
What changed in this PR
Extracts reusable Fabric Core HTTP, pagination, throttling, capacity-model, and testing foundations without changing registered tools.
Changes:
- Adds shared authenticated HTTP and URI/header helpers.
- Adds source-generated capacity metadata and validation.
- Adds focused regression tests, documentation, and changelog entry.
| File | Description |
|---|---|
src/AssemblyInfo.cs |
Exposes internals to Core tests. |
src/Models/CoreJsonContext.cs |
Registers capacity metadata for source generation. |
src/Models/FabricCapacityMetadata.cs |
Defines and validates shared capacity metadata. |
src/Services/FabricCoreService.cs |
Extracts the response-returning HTTP sender. |
src/Services/FabricCoreHttpHelpers.cs |
Adds retry-header parsing and token encoding. |
tests/.../FabricCapacityMetadataTests.cs |
Tests serialization, schema, and validation. |
tests/.../FabricCoreHttpHelpersTests.cs |
Tests retry parsing and URI encoding. |
tests/.../FabricCoreServiceBaselineTests.cs |
Protects existing create/search behavior. |
tests/.../FabricCoreHttpMessageHandler.cs |
Adds a thread-safe HTTP test double. |
tests/.../README.md |
Documents shared test foundations. |
changelog-entries/amoshersch-fabric-core-foundation.yaml |
Records the internal refactoring. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <[email protected]>
Amos Hersch (AmosHersch)
force-pushed
the
amoshersch-shared-fabric-foundation
branch
from
October 6, 2026 08:34
21655d0 to
a67bf4a
Compare
KupoCat
reviewed
Oct 6, 2026
Co-authored-by: Copilot App <[email protected]>
KupoCat
approved these changes
Oct 6, 2026
Amos Hersch (AmosHersch)
deleted the
amoshersch-shared-fabric-foundation
branch
October 6, 2026 12:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds the no-new-tool shared Fabric prerequisite for the user-authorized reorganization of 11 existing drafts: #3846, #3852, #3841, #3842, #3843, #3853, #3851, #3849, #3848, #3847, and #3850. Their existing PR numbers are being preserved. The coordinator will rebase those layers sequentially and register the native stack; this PR does not modify their branches or stack metadata. Another author's #3701 remains outside this work.
Depends on #3854, not directly on main. This diff is one foundation commit,
21655d0f8af45619013675656caf4a179329e261, relative to parent/base4cd80df719783ed6b83583bfc4dd7b20aacfa982onamoshersch-tool-catalog-stream-fix. The inherited engineering fix is unchanged.Inspected all 11 original source diffs and revalidated their pushed heads before publication. Extracts only demonstrated common plumbing:
Retry-Afterparser returns a typed value, not an error message or retry policy. A query-value encoder preserves existing percent escapes while encoding raw delimiters, invalid percent sequences, and raw+as data. Normal .NET URI canonicalization remains enabled.FabricCapacityMetadatacontract with five required fields, open string values, and shared nonempty/nonblank validation. Get operations still need their requested-ID equality check. Workspace/item output models are deliberately not unified.No new tools, command hierarchy, REST framework, packages, project/configuration changes, configurable retries, authentication redesign, endpoint-following behavior, or engineering fixes. The combined Fabric catalog still contains 48 tools, with exactly
core_create-itemandcore_search-catalogin Core.The URI tests use actual
HttpClient-constructed request URIs and the official continuation examples for capacities, workspaces, and items.%3Dis not doubled to%253D; escaped reserved characters remain escaped;%41/%7ecanonicalize normally toA/~. Response tokens are not rewritten, and metadata URLs are not followed.GitHub issue number?
N/A — explicitly authorized prerequisite for reorganizing the existing Fabric drafts listed above; no new issue was requested or opened.
Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test PipelineThe MCP-tool-specific and Azure-tool-specific items are not applicable to this no-new-tool foundation. Tool names, registrations, descriptions, options, and the service interface are unchanged. Only the internal Core test/developer README changed, not a package README. ToolDescriptionEvaluator is not run/pending for the later tool layers; no score is claimed here.
Validation performed in this foundation
.NET SDK 10.0.401. All resource interactions in the Core suite use offline HTTP/credential doubles. The host suite covers stdio and loopback HTTP discovery/startup, not live Fabric authentication.
dotnet build '.\tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj' --no-restore --nologo --verbosity quietdotnet build '.\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --no-restore --nologo --verbosity quietdotnet test --project '.\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --no-build --no-restoredotnet build '.\servers\Fabric.Mcp.Server\src\Fabric.Mcp.Server.csproj' --no-restore --nologo --verbosity quietdotnet build '.\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --nologo --verbosity quietdotnet test --project '.\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --no-build --no-restore& '.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe' 'tools' 'list' '--name-only'git diff --cached --checkbefore commit andgit diff --checkThe initial no-restore build reported the expected missing
project.assets.jsonin this new worktree.dotnet build '.\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --nologo --verbosity quietrestored the existing dependencies and passed; no dependency manifests or SDK settings were changed. Existing Core/host AOT analyzers and the source-generated serialization/schema tests passed; a native publish was not run.Changed-file formatting commands — both passed:
Invoke-Cspell.ps1— passed, 11 files checked, 0 issues, using this exact file scope and isolated session-local-PackageInstallCache/npm_config_cachelocations (removed afterward):No live Fabric calls, OBO, recorded/playback infrastructure, deployment, credential changes, full solution tests, or evaluator execution. Those omissions are explicitly accepted for this reorganization, not claimed as passing validation.
Inherited #3854 evidence — not rerun or changed here
The base PR separately records Pester 5/5, script-fixture 7/7, a successful trimmed Fabric publish/npm package, and independent packaged tool discovery. Its
Build-Local.ps1 -VerifyNpxdid not fully pass because the existingclear-npx-cachehelper hit the environment's protected npm cache option. This foundation does not claim that inherited command passed, does not rerun it, and includes no workaround or other engineering change. There are no PowerShell, project-file, or npm-package changes in this diff.Reuse contract for the dependent layers
In
Fabric.Mcp.Tools.Core.Services:Fabric.Mcp.Tools.Core.Models.FabricCapacityMetadatais a public sealed class with required, mutable properties orderedGuid Id,string DisplayName,string Sku,string Region,string State; it is registered once asCoreJsonContext.Default.FabricCapacityMetadata. Its internal staticIsValid([NotNullWhen(true)] FabricCapacityMetadata? capacity)checks null/empty/blank values without restricting future string values.Fabric.Mcp.Tools.Core.Tests.TestSupport.FabricCoreHttpMessageHandler(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> send)exposesint CallCountwith interlocked increments/volatile reads. Capture request details in the callback; retain specialized body/cancellation doubles and every operation-specific assertion.IsValidplus requested-ID equality. Replace inline authentication/send with the common send usingResponseHeadersRead; use the shared parser while retainingFabricCapacityGetThrottledException. Rename its counting handler to the shared handler.ResponseHeadersRead, common encoding/header parsing, andIsValidfor each entry. Keep page/result models and their independent unchanged continuation strings. Reuse the common handler.StubHttpMessageHandlerwith the common handler.ResponseHeadersRead, common encoder/parser and common handler. Keep role normalization, workspace/tag models, response validation and messages local.ResponseHeadersRead; replaceGetWorkspaceRetryAfterwith the common parser. Keep creation status,Locationhandling and uncertain-mutation policy local. Replace its handler and mapRequestCountassertions toCallCount.WorkspaceUpdateThrottledExceptionwording. Reuse the common handler.SendFabricApiRequestForResponseAsyncwith the common send, explicitly preservingResponseHeadersRead. Keep its stricter integer-onlyGetUpdateRetryAfterSecondscontract unless an equivalent projection is separately proven; do not add HTTP-date behavior. Keep exceptions/uncertain outcomes and map the handler'sRequestCounttoCallCount.LastRequestassertions; keep all request/body checks.ResponseHeadersReadand common parser; retain cancellation checks, status handling and deletion-specific outcomes. Reuse the common handler.ResponseHeadersRead; retain the 202-only contract, long nullable seconds output and date-ignored behavior. If using the parser, consume only its nonnegativeDelta, never a formatted message or backend body. MapRequestCounttoCallCountand captureLastRequestin the callback.Keep the foundation's single stream wrapper/send helper, not one replacement per rebased layer. Use named
cancellationToken:arguments with the new optional completion parameter. Leave API-returned continuation strings unchanged, preserve reserved escapes in requests, allow normal unreserved canonicalization, and never disable URI canonicalization or follow metadata URLs. Retain tool-specific error/status mappings and all meaningful tests.Invoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with
writeaccess to the repo need to validate the contents of this PR before leaving a comment with the text/azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.