Skip to content

feat(fabric): add core_delete-workspace tool - #3847

Closed
Amos Hersch (AmosHersch) wants to merge 1 commit into
amoshersch-fabric-delete-itemfrom
amoshersch-fabric-delete-workspace
Closed

Amos Hersch (AmosHersch) wants to merge 1 commit into
amoshersch-fabric-delete-itemfrom
amoshersch-fabric-delete-workspace

Conversation

@AmosHersch

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

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds exactly one Fabric Core tool, core_delete-workspace, for the Delete Workspace REST API.

Dependency: This existing PR is now the next sequential layer above #3848 (Delete Item). Its immediate base is amoshersch-fabric-delete-item at b1aa5b024f228be6a38eebf8eec8824298d2f62f; the ultimate target remains main. Review this PR's one-commit, 22-file diff relative to that parent. The PR number and branch are preserved; no replacement PR, merge, or native stack metadata was created.

Tool contract

  • Requires an explicit nonempty workspace UUID, validates before authentication/HTTP, and normalizes the target. No name lookup, implicit selection, bulk deletion, or tenant-wide operation.
  • Sends one DELETE /v1/workspaces/{workspaceId} with no request body. Only HTTP 200 OK, the documented synchronous response with no body, produces the source-generated acknowledgement { "workspaceId": "<canonical UUID>", "deleted": true }. No empty-body deserialization as a workspace, prefetch, item-by-item deletion, permission changes, retries, follow-up requests, or polling.
  • Explicitly warns that the workspace AND the items under it are deleted. Requires workspace Admin access and delegated Workspace.ReadWrite.All. No recovery, retention, or permanent-deletion guarantees are added. A 403/404 is never fabricated as success; cancellation, timeout, and post-send failures do not assert a definite deletion outcome.
  • Preserves destructive=true, read-only=false, idempotent=true metadata, source-generated output/schema, the existing MCP elicitation/read-only gates, and the host credential bridge. Idempotence means no additional effects; repeated requests can still return 404. Annotations alone do not guarantee confirmation, and direct CLI execution is not the MCP consent gate.

Rebase adaptation

  • Reuses the inherited SendFabricHttpRequestAsync signature with explicit ResponseHeadersRead and named cancellation. All sibling completion choices remain unchanged.
  • Reuses FabricCoreHttpHelpers.GetRetryAfter while retaining WorkspaceDeleteThrottledException and deletion-specific status/unknown-outcome messages. Replaces the duplicate test handler with inherited FabricCoreHttpMessageHandler; keeps the specialized no-body-read/disposal content double and original semantic cases.
  • One explicitly authorized shared-sender improvement remains from the original PR: cancellationToken.ThrowIfCancellationRequested() immediately after credential acquisition. This preserves the existing regression requiring zero HTTP sends if a credential returns after cancellation. The signature, authentication selection, and noncancelled behavior are unchanged; no lower branch or foundation was rewritten.
  • Preserves the parent's guarded Delete Item factory registration, optional hard-delete validation, every inherited operation/test suite, and all five default/all-mode host tests. Cumulative registration/read-only assertions, README, prompts, changelog, and test documentation are composed rather than overwritten.

The Workspace Delete command, options, result, throttling exception, command tests, and specialized content/test data are byte-identical to the original reviewed commit. Only shared-helper use and cumulative integration assertions/documentation were adapted. The layer does not change shared HTTP helper definitions, authentication, option binding, production host/proxy infrastructure, project/package files, or engineering scripts.

GitHub issue number?

No tracking issue was supplied or created. This is the user-authorized reorganization of the existing single-tool PR; #3848 is its dependency, not a replacement tracking issue.

Pre-merge Checklist

  • 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, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts - Not run; score/ranking requirement waived for this PR by the Fabric MCP maintainer.
    • 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

The consolidated mapping, rename checklist, and Azure-specific items are not applicable: this layer adds one Fabric tool, renames none, and the Fabric host uses NullConsolidatedToolDefinitionProvider. Fabric prompts are maintained cumulatively in servers/Fabric.Mcp.Server/docs/e2eTestPrompts.md. Evaluator scoring was not run and is waived for this PR by the Fabric MCP maintainer.

Validation at the rebased head

All results below were rerun for 83da05281e680f9716b1408f710a8a0aa308d8da with .NET SDK 10.0.401, not copied from the old standalone checks. 1,475 focused tests passed, zero failed/skipped: 1,468 Core, five inherited Fabric host tests, and two credential-bridge tests. API-level tests use substituted HTTP/credentials only; local host tests perform discovery, not Fabric resource operations.

Command Result
dotnet build '.\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --nologo --verbosity quiet Passed; 0 warnings/errors, including the owning Core source project.
dotnet test --project '.\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --no-build --no-restore --verbosity quiet Passed: 1,468 cumulative Core tests, including both deletions, consent/read-only gates, empty-response/schema behavior, all earlier tools and legacy create/search regressions.
dotnet build '.\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --nologo --verbosity quiet Passed; 0 warnings/errors, including the Fabric server.
dotnet test --project '.\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --no-build --no-restore --filter-class '*ServerStartupTests' --verbosity quiet Passed: 5 inherited default/all-mode local stdio/HTTP discovery and legacy initialization cases, with cumulative assertions for both deletions.
dotnet test --project '.\tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj' --filter-class '*ProviderDelegatingCredentialTests' --verbosity quiet Passed: 2 existing offline credential-delegation tests.
dotnet format '.\tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj' --verify-no-changes --no-restore --verbosity quiet Passed for the full owning source project.
dotnet format '.\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --verify-no-changes --no-restore --verbosity quiet Passed for the full owning test project.
dotnet format '.\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --verify-no-changes --no-restore --include '.\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Infrastructure\ServerStartupTests.cs' --verbosity quiet Passed.
.\eng\common\spelling\Invoke-Cspell.ps1 -FileList $files -PackageInstallCache $cache Passed: all 22 layer-relative files, 0 spelling issues; isolated session-local cache was removed.
.\eng\scripts\Process-PackageReadMe.ps1 -Command validate -InputReadMePath '.\servers\Fabric.Mcp.Server\README.md' Exited 0; retains 14 pre-existing heading-level warnings.
.\eng\scripts\Compile-Changelog.ps1 -ChangelogPath '.\servers\Fabric.Mcp.Server\CHANGELOG.md' -DryRun Passed: all 21 cumulative Fabric entries validate; no changelog files rewritten.
.\eng\scripts\Test-ToolSelectionPrompts.ps1 -ServerName 'Fabric.Mcp.Server' -OutputPath $promptOutput Passed with fresh Debug, self-contained, trimmed win-x64 artifacts: 58 tools, 1 server tested, 0 skipped, 0 violations. The inherited #3854 stdout/stderr fix is exercised; the old standalone validator failure no longer applies to this head. No new engineering change was made here.
.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe tools list --name-only Passed with stderr separate. Exact checks confirmed 58 Fabric tools / 12 Core tools and all 34 cumulative prompt rows, including three Delete Workspace rows.
git -c core.longpaths=true --no-pager diff --check 'b1aa5b024f228be6a38eebf8eec8824298d2f62f...HEAD' Passed.

$files was the exact output of git -c core.longpaths=true diff --name-only 'b1aa5b024f228be6a38eebf8eec8824298d2f62f...HEAD', normalized to Windows paths. $cache was the dedicated session-artifact directory files\stack-3847-cspell; $promptOutput was the absolute path to this worktree's .work\stack-3847-prompts directory. The prompt script was run without -SkipServerBuild, so it produced fresh branch artifacts. No tracked configuration was changed.

CI and evidence limits

  • The new-head snapshot after push/retarget showed SpellCheck, Verify Links, event processing, and CLA successful. The Azure mcp - pullrequest aggregate was queued, with its Initialize and SDL Sources jobs cancelled in that run. Required hosted CI is not claimed green; final CI and human review still apply.
  • ToolDescriptionEvaluator: not run; maintainer exemption. The Fabric MCP maintainer has waived the score/ranking requirement for this PR. Configuration is unavailable; no score or top-three ranking is claimed. The checkbox remains unchecked because the evaluator was not run. Normal code review and required CI still apply.
  • Live Fabric requests, real OBO authorization, service-principal/managed-identity access, and recorded playback: unexercised. No real deletion or resource request occurred. Applicable Fabric live/recorded infrastructure remains outside scope; offline tests do not establish live permissions or service behavior.
  • No broad NPX/package/native rerun was performed for this rebase. The scoped prompt validator's managed trimmed publication is recorded above, not described as native AOT evidence.
  • This remains a draft dependent on feat(fabric): add core_delete-item with explicit hard-delete opt-in #3848, not merge approval or authorization to delete a workspace. No auto-merge, queue enrollment, merge/closure, live-test pipeline, or native stack registration was requested.

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

azure-pipelines Bot commented Oct 5, 2026 •

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 5, 2026
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-delete-workspace branch from 2696016 to 83da052 Compare October 6, 2026 00:25
@AmosHersch
Amos Hersch (AmosHersch) changed the base branch from main to amoshersch-fabric-delete-item October 6, 2026 00:25
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-delete-workspace branch 2 times, most recently from bc6e926 to 942381b Compare October 6, 2026 12:28
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-delete-workspace branch 2 times, most recently from 71d2721 to e0c7276 Compare October 7, 2026 11:49
@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

🟡 Changes recommended

Automatic redirects can issue an additional DELETE, and upstream HTTP 400 responses currently produce misleading UUID guidance.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds the Fabric Core core_delete-workspace tool with validated UUID targeting, destructive-operation safeguards, and typed acknowledgement output.

Changes:

  • Implements and registers workspace deletion.
  • Adds comprehensive mocked command, service, consent, and discovery tests.
  • Updates Fabric documentation, prompts, and changelog.
File Description
WorkspaceUpdateToolRegistrationTests.cs Verifies read-only exclusion.
WorkspaceDeleteToolRegistrationTests.cs Tests MCP registration and safeguards.
WorkspaceCreateToolRegistrationTests.cs Updates expected tool catalog.
TestSupport/​WorkspaceDeleteTestData.cs Adds deletion fixtures.
TestSupport/​WorkspaceDeleteResponseContent.cs Tests response disposal.
Services/​FabricCoreServiceWorkspaceDeleteTests.cs Tests HTTP deletion behavior.
tests/​README.md Documents deletion tests.
ItemUpdateToolRegistrationTests.cs Extends read-only assertions.
FabricCoreSetupTests.cs Tests command registration.
Commands/​WorkspaceDeleteCommandTests.cs Tests command contract and failures.
WorkspaceDeleteThrottledException.cs Adds throttling guidance.
IFabricCoreService.cs Adds deletion service contract.
FabricCoreService.cs Implements authenticated DELETE request.
WorkspaceDeleteOptions.cs Defines required workspace UUID option.
WorkspaceDeleteCommandResult.cs Defines typed acknowledgement.
CoreJsonContext.cs Registers result serialization.
FabricCoreSetup.cs Registers and advertises the command.
WorkspaceDeleteCommand.cs Implements tool behavior and errors.
ServerStartupTests.cs Verifies host discovery metadata.
servers/​Fabric.Mcp.Server/​README.md Documents tool usage and risks.
docs/​e2eTestPrompts.md Adds selection prompts.
amoshersch-fabric-core-delete-workspace.yaml Adds feature changelog entry.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AmosHersch

Copy link
Copy Markdown
Contributor Author

Superseded by #3887, which has merged into main with this layer's changes and the associated fixes. Closing this PR to avoid merging the same work again; its original review history is preserved.

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