Skip to content

fix(fabric): correct Core errors, workspace responses, and deletion safety - #3873

Closed
Amos Hersch (AmosHersch) wants to merge 4 commits into
amoshersch-fabric-assign-workspace-capacityfrom
amoshersch-fabric-http-status-errors
Closed

Amos Hersch (AmosHersch) wants to merge 4 commits into
amoshersch-fabric-assign-workspace-capacityfrom
amoshersch-fabric-http-status-errors

Conversation

@AmosHersch

@AmosHersch Amos Hersch (AmosHersch) commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Corrects Fabric Core HTTP errors and input handling, with user-authorized review fixes delivered through this existing top PR rather than rewriting earlier stack layers.

  • Safe validation and shared handling (human-review follow-up): Create Item now identifies missing registered required options, such as --display-name and --item-type, without exposing parser input, private paths, unknown names, or optional names. Catalog reuses the same safe-name helper and retains its existing generic/parser, page-size, and continuation guidance. Twelve commands share a small AOT-annotated FabricCoreCommand base for exception-result removal while retaining their operation-specific status/message overrides. The base requires an explicit message override rather than inheriting raw AuthenticatedCommand details.
  • Shared throttling (human-review follow-up): Replace the five identical capacity/workspace throttling exception classes with one sealed FabricThrottledException and update their five service callers and command handlers. The existing validated delta/date formatting and invalid-header fallbacks are unchanged. Item List's tick-based precision, Item Delete's nullable-header/deletion wording, Workspace Update's wording, Item Update's integer seconds, capacity assignment's long seconds/sanitized result, and workspace creation's header string/uncertain-outcome contracts remain distinct. No alias exceptions or generic retry framework.
  • Errors and inputs: Preserve upstream Create Item/Catalog Search HTTP statuses; sanitize public exception details, including parser failures; retain transport 503 and existing authentication/cancellation mappings. Validate Create Item workspace UUIDs while preserving the workspace alias and precedence. Reject catalog continuation tokens combined with search/filter without changing token-only paging or the nested success contract. Keep the earlier help and Update Item punctuation corrections.
  • Workspace responses and deletion: Accept optional/null workspace Type consistently for Get/List/Create/Update, retaining ID/display-name/tag checks and future type strings. Disable automatic redirects on existing Fabric Core transports without replacing proxy/timeout/recording configuration. Honor a returned deletion 200 despite late cancellation, retain genuine cancellation handling, and distinguish upstream deletion 400 from local input errors. Hard-delete omitted/false/true behavior and exact-URL tests are unchanged.
  • Prompt contract: Preserve the earlier correction of all 23 invalid interaction cells, all 37 natural prompt strings, and the 14 already-valid cells. Consent and deletion-safety guidance remain outside the interaction column; no shared parser changes or live prompt execution.

Command IDs/names, option names, metadata flags, descriptions, provider-delegating authentication, operation-specific retry guidance, and success envelopes are unchanged by the human-review follow-up. Catalog remains results.results.value with continuationToken and hierarchy. The earlier public error-results removal and optional workspace-type correction remain intentional. No new tools, dependencies, infrastructure, retries, or shared Microsoft.Mcp.Core edits.

This ready-for-review PR is the top of native stack 3860 and targets #3850, branch amoshersch-fabric-assign-workspace-capacity, at 07a5d88221b6b1fadfb9df2d6da91cc962be5a58. The latest normal follow-up commit is 1161bc109a47409b95d3ce46b47d246e145f5046, directly after 66d40867f87d8dafd511240b3159cd57fe25bfc7. No amendments, rebases, force-pushes, lower-ref changes, or stack metadata changes were made for this batch. Human-review replies are handled separately by the coordinator.

Contract references: bundled tools/Fabric.Mcp.Tools.Docs/src/Resources/fabric-rest-api-specs/contents/platform/definitions/platform.json; official Create Item, Catalog Search, and Fabric enablement.

Validation

Fresh results for the human-review follow-up: source and Debug/Release test builds passed with 0 warnings/errors; 184 focused tests, the full 1,759-test Debug Core suite, and 577 scoped Release tests passed with 0 failed/skipped. The missing-option regressions reproduced 7 failures before the fix. New coverage includes specific safe missing names, mixed sensitive parser errors, forged/optional name filtering, and 55 real-service/fake-HTTP cases across all five shared throttling callers (zero/positive/max delta, HTTP date, missing/malformed/negative/fractional/overflow/multiple-value headers). Existing per-operation 403/429/503, authentication, cancellation, serialization, host/schema, and distinct retry-contract coverage remains passing.

# Passed: 0 warnings, 0 errors.
dotnet build 'tools\Fabric.Mcp.Tools.Core\src' -m:1 -nr:false --verbosity minimal
dotnet build 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' -m:1 -nr:false --verbosity minimal

# Passed: 184 tests, 0 failed/skipped.
dotnet test --project 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --no-build --filter-class '*ItemCreateCommandTests' --filter-class '*CatalogSearchCommandTests' --filter-class '*FabricThrottlingTests' --filter-class '*FabricCoreHttpHelpersTests' --no-progress --no-ansi

# Passed: 1,759 tests, 0 failed/skipped (Microsoft.Testing.Platform).
dotnet test --project 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --no-build --no-progress --no-ansi

# Passed: 0 warnings, 0 errors; includes the source dependencies in Release.
dotnet build 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --configuration Release -m:1 -nr:false --verbosity minimal

# Passed: 577 command/sanitization/throttling tests, 0 failed/skipped.
dotnet test --project 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --configuration Release --no-build --filter-class '*CommandTests' --filter-class '*FabricThrottlingTests' --filter-class '*FabricCoreHttpHelpersTests' --no-progress --no-ansi
Formatting, spelling, compatibility, and README checks

Fresh formatting checks passed without corrections on 23 existing source and 22 test files changed by the cumulative PR. Actual resolved paths were passed to --include, and removed duplicate files were excluded. Spelling passed on all 48 existing changed files; the temporary cache was removed. These selection commands ran before staging the latest follow-up:

$files = @(git --no-pager diff --name-only --diff-filter=ACMR '07a5d88221b6b1fadfb9df2d6da91cc962be5a58' -- 'tools\Fabric.Mcp.Tools.Core\src'; git ls-files --others --exclude-standard -- 'tools\Fabric.Mcp.Tools.Core\src') | Where-Object { $_.EndsWith('.cs') } | Sort-Object -Unique | ForEach-Object { (Resolve-Path -LiteralPath $_.Replace('/', '\')).Path }
dotnet format 'tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj' --no-restore --verify-no-changes --include $files --verbosity normal

$files = @(git --no-pager diff --name-only --diff-filter=ACMR '07a5d88221b6b1fadfb9df2d6da91cc962be5a58' -- 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests'; git ls-files --others --exclude-standard -- 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests') | Where-Object { $_.EndsWith('.cs') } | Sort-Object -Unique | ForEach-Object { (Resolve-Path -LiteralPath $_.Replace('/', '\')).Path }
dotnet format 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --no-restore --verify-no-changes --include $files --verbosity normal

$files = @(git --no-pager diff --name-only --diff-filter=ACMR '07a5d88221b6b1fadfb9df2d6da91cc962be5a58' --; git ls-files --others --exclude-standard) | Sort-Object -Unique | ForEach-Object { $_.Replace('/', '\') }
.\eng\common\spelling\Invoke-Cspell.ps1 -FileList $files -PackageInstallCache 'C:\Users\amhersch\.copilot\session-state\13fe6f97-7abe-490b-9fa1-8041ffbb3147\files\fabric-human-cspell'

# Completed, exit 0, with the same 14 pre-existing TOC heading-level warnings.
.\eng\scripts\Process-PackageReadMe.ps1 -Command validate -InputReadMePath 'servers\Fabric.Mcp.Server\README.md'

All 12 affected command metadata/description blocks were compared with 66d40867 and are unchanged. Options, response models, redirect setup, the prompt file, and all intentionally distinct retry types have no diff in this batch. git --no-pager diff --cached --check passed. No unrelated cleanup or formatting was performed.

Historical evidence: 66d40867f87d8dafd511240b3159cd57fe25bfc7 passed 18 focused tests and the then-1,695-test full Debug suite. Its exact shared-parser-regex/token check verified 37 unchanged natural prompts, 23 corrected cells, 14 valid cells preserved, and all List Capacities rows using none; the prompt file is unchanged by this follow-up. be5a204671c17053b0f58cbd979e9d5c8da93e78 previously passed 1,669 Debug tests and 131 scoped Release tests. These are historical results, distinct from the fresh commands above.

No real Fabric calls or mutations, live/recorded/OBO validation, or ToolDescriptionEvaluator calls were made. Fabric evaluator validation remains optional; no score or CI success is claimed. No whole-repository, native, or NPX build was needed.

GitHub issue number?

N/A — user-requested corrections and review follow-ups; no tracking issue was created. All corrections land through this top PR rather than modifying earlier PR heads.

Pre-merge Checklist

The one-tool checkbox is intentionally unchecked: the user approved the related Fabric corrections and review follow-ups in this existing top PR. New-tool/rename, evaluator, and Azure-only items are not applicable. README validation ran with the pre-existing warnings disclosed above.

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions (excluding Fabric MCP tools), ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access 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.

@azure-pipelines

Copy link
Copy Markdown
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.

@github-actions github-actions Bot added the server-Fabric.Mcp Microsoft Fabric MCP Server label Oct 7, 2026
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-http-status-errors branch from a7b5144 to 17a8397 Compare October 7, 2026 11:55
@AmosHersch Amos Hersch (AmosHersch) changed the title fix(fabric): preserve HTTP status in Create Item and Catalog Search fix(fabric): correct Core errors, workspace IDs, and catalog paging Oct 7, 2026
@AmosHersch
Amos Hersch (AmosHersch) marked this pull request as ready for review October 7, 2026 12:53
@AmosHersch
Amos Hersch (AmosHersch) requested a review from a team as a code owner October 7, 2026 12:53
Copilot AI balanced review requested due to automatic review settings October 7, 2026 12:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation is consistent with the stated behavior and has comprehensive regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Corrects Fabric Create Item and Catalog Search validation/error handling, preserves HTTP statuses, and fixes Update Item error punctuation.

Changes:

  • Adds UUID and continuation-request validation.
  • Sanitizes public errors while preserving HTTP status codes.
  • Expands tests, documentation, and changelog coverage.
File Description
tools/​Fabric.Mcp.Tools.Core/​src/​Commands/​ItemCreateCommand.cs Validates workspace UUIDs and sanitizes errors.
tools/​Fabric.Mcp.Tools.Core/​src/​Commands/​CatalogSearchCommand.cs Validates pagination and sanitizes errors.
tools/​Fabric.Mcp.Tools.Core/​src/​Commands/​ItemUpdateCommand.cs Prevents duplicate punctuation.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​FabricCoreService.cs Normalizes UUIDs and preserves HTTP statuses.
tools/​Fabric.Mcp.Tools.Core/​src/​Validation/​CatalogSearchInputValidator.cs Adds shared catalog request validation.
tools/​Fabric.Mcp.Tools.Core/​src/​Options/​ItemCreateOptions.cs Clarifies Create Item inputs.
tools/​Fabric.Mcp.Tools.Core/​src/​Options/​CatalogSearchOptions.cs Clarifies continuation-token behavior.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​TestSupport/​FabricCoreErrorTestData.cs Adds sanitization test helpers.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Commands/​ItemCreateCommandTests.cs Covers creation, validation, and failures.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Commands/​CatalogSearchCommandTests.cs Covers pagination and sanitized failures.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Commands/​ItemUpdateCommandTests.cs Verifies punctuation behavior.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceBaselineTests.cs Covers service validation and statuses.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​WorkspaceGetServiceTests.cs Updates preserved-status expectations.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​ItemListServiceTests.cs Updates preserved-status expectations.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceWorkspaceUpdateTests.cs Updates preserved-status expectations.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceWorkspaceListTests.cs Uses valid workspace UUID fixtures.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceWorkspaceDeleteTests.cs Updates preserved-status expectations.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceWorkspaceCreateTests.cs Uses valid UUIDs and status assertions.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceItemUpdateTests.cs Updates preserved-status expectations.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceCapacityListTests.cs Updates continuation and UUID fixtures.
servers/​Fabric.Mcp.Server/​README.md Documents requirements and pagination behavior.
servers/​Fabric.Mcp.Server/​changelog-entries/​amoshersch-fabric-preserve-http-status.yaml Records the fixes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AmosHersch Amos Hersch (AmosHersch) changed the title fix(fabric): correct Core errors, workspace IDs, and catalog paging fix(fabric): correct Core errors, workspace responses, and deletion safety Oct 7, 2026
Preserve response status in EnsureSuccessAsync and add operation-local HTTP guidance without changing shared error handling, result shapes, or retries. Cover service and command regressions, update old status-loss assertions, and add a Fabric bug-fix changelog entry.

Co-authored-by: Copilot App <[email protected]>
Sanitize Create Item and Catalog Search public errors without changing status mappings or success contracts. Validate workspace UUIDs with the compatible alias, reject mixed catalog continuation criteria, document verified requirements, and correct Update Item error punctuation. Cover serialized Debug/Release errors and command/service validation.

Co-authored-by: Copilot App <[email protected]>
Make workspace type optional across get, list, create, and update; retain configured HTTP transports while disabling automatic redirects; preserve confirmed delete responses during late cancellation and improve upstream 400 guidance. Correct all 23 invalid prompt interaction cells without changing 37 prompts, and add regression coverage and documentation.

Co-authored-by: Copilot App <[email protected]>
Report only registered required option names for Create Item validation failures while keeping parser details private. Centralize null exception results in an AOT-safe Fabric command base and consolidate five identical throttling exceptions without changing operation-specific errors, retry contracts, or deletion modes.

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server-Fabric.Mcp Microsoft Fabric MCP Server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants