Repository navigation
feat(fabric): add core_delete-item with explicit hard-delete opt-in - #3848
Closed
Amos Hersch (AmosHersch) wants to merge 1 commit into
Closed
Amos Hersch (AmosHersch) wants to merge 1 commit into
Amos Hersch (AmosHersch) wants to merge 1 commit into
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. |
5 of 21 tasks
Amos Hersch (AmosHersch)
force-pushed
the
amoshersch-fabric-delete-item
branch
from
October 6, 2026 00:06
e345110 to
b1aa5b0
Compare
Amos Hersch (AmosHersch)
changed the base branch from
main
to
amoshersch-fabric-update-item
October 6, 2026 00:06
This was referenced Oct 6, 2026
Amos Hersch (AmosHersch)
force-pushed
the
amoshersch-fabric-delete-item
branch
2 times, most recently
from
October 6, 2026 12:28
061aed3 to
ea7c453
Compare
Amos Hersch (AmosHersch)
force-pushed
the
amoshersch-fabric-delete-item
branch
2 times, most recently
from
October 7, 2026 11:49
9d41820 to
e91f09a
Compare
Amos Hersch (AmosHersch)
marked this pull request as ready for review
October 7, 2026 12:53
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
A cancellation race can misreport a confirmed deletion, and HTTP 400 guidance is misleading.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds Fabric Core’s core_delete-item tool with explicit permanent-deletion opt-in and safe deletion confirmation.
Changes:
- Implements validated soft/hard item deletion.
- Registers and documents the destructive tool.
- Adds comprehensive mocked, command, schema, and discovery tests.
| File | Description |
|---|---|
tools/Fabric.Mcp.Tools.Core/src/Commands/ItemDeleteCommand.cs |
Adds command behavior and errors. |
tools/Fabric.Mcp.Tools.Core/src/FabricCoreSetup.cs |
Registers and guards the command. |
tools/Fabric.Mcp.Tools.Core/src/Models/CoreJsonContext.cs |
Registers result serialization. |
tools/Fabric.Mcp.Tools.Core/src/Models/ItemDeleteCommandResult.cs |
Defines deletion confirmation. |
tools/Fabric.Mcp.Tools.Core/src/Options/ItemDeleteOptions.cs |
Defines deletion inputs. |
tools/Fabric.Mcp.Tools.Core/src/Services/FabricCoreService.cs |
Implements DELETE request handling. |
tools/Fabric.Mcp.Tools.Core/src/Services/FabricItemDeleteThrottledException.cs |
Adds throttling guidance. |
tools/Fabric.Mcp.Tools.Core/src/Services/IFabricCoreService.cs |
Exposes deletion service API. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/Commands/ItemDeleteCommandTests.cs |
Tests command behavior. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/FabricCoreSetupTests.cs |
Tests registration. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/ItemDeleteToolRegistrationTests.cs |
Tests MCP and CLI integration. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/ItemUpdateToolRegistrationTests.cs |
Extends read-only assertions. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/README.md |
Documents test coverage. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/Services/FabricCoreServiceItemDeleteTests.cs |
Tests HTTP deletion behavior. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/TestSupport/ItemDeleteTestData.cs |
Adds deletion fixtures. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/TestSupport/ItemDeleteTrackingContent.cs |
Tracks response disposal. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/WorkspaceCreateToolRegistrationTests.cs |
Updates discovery expectations. |
tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.Tests/WorkspaceUpdateToolRegistrationTests.cs |
Extends read-only assertions. |
servers/Fabric.Mcp.Server/tests/Fabric.Mcp.Server.Tests/Infrastructure/ServerStartupTests.cs |
Verifies host discovery and schema. |
servers/Fabric.Mcp.Server/README.md |
Documents deletion usage and safety. |
servers/Fabric.Mcp.Server/docs/e2eTestPrompts.md |
Adds tool-selection prompts. |
servers/Fabric.Mcp.Server/changelog-entries/amoshersch-fabric-delete-item.yaml |
Records the feature. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
KupoCat
reviewed
Oct 8, 2026
KupoCat
approved these changes
Oct 8, 2026
Co-authored-by: Copilot App <[email protected]>
Amos Hersch (AmosHersch)
force-pushed
the
amoshersch-fabric-delete-item
branch
from
October 8, 2026 08:29
e91f09a to
ad9127c
Compare
9 of 21 tasks
Contributor
Author
|
Superseded by #3887, which has merged into |
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 exactly one Fabric Core tool,
core_delete-item, using the Fabric Delete Item API.Depends directly on #3849, Update Item; the ultimate target remains
main. This existing PR and branch were rebased in place for the user-authorized conflict-prevention chain. Its immediate base isamoshersch-fabric-update-itemata92fad0120739d227ab2aa867ec4c6d5fb4a9390. This layer is one commit,b1aa5b024f228be6a38eebf8eec8824298d2f62f, changing 22 files relative to that parent. No replacement PR, other branch mutation, main import, merge, closure, or native-stack metadata change was made.workspaceId,itemId, andhardDeleteRequested.hard-deleteoptional. Omission/null leaves the API query parameter unspecified, false sendshardDelete=false, and explicit true sendshardDelete=true. The reviewed registration-time System.CommandLine guard rejects bare, empty/invalid, and repeated/ambiguous CLI occurrences before service/authentication. It remains configured before discovery/execution, with command-local validators and no shared binder changes."true"or["true"]can bind as one explicit true token. This does not claim original JSON-type enforcement. Missing/null/empty/false never enables hard deletion, and aliases that repeat the option are rejected.IAzureTokenCredentialProviderand DataFactory's per-requestProviderDelegatingCredentialasTokenCredential, existing destructive-operation consent, and read-only exclusion.Default/false soft-deletes only supported item types and does not promise recovery. Soft deletion requires item write permission; hard/permanent deletion requires workspace Admin. Delegated callers need
Item.ReadWrite.Allor the item-specific write scope; service principal/managed identity support depends on item type. The tool is destructive and not read-only.Idempotent=truefollows Fabric OneLake deletion-effect conventions; a subsequent 404 remains an error, not success or permission to retry. Cancellation/timeouts retain the original truthful warning that deletion state was not confirmed.Adaptation to the common foundation
Reuses #3855's single private
FabricCoreService.SendFabricHttpRequestAsync, preserving the original bufferedResponseContentReaddefault and namedcancellationToken:. The legacy create/search wrapper and every other operation's completion setting are unchanged.FabricCoreHttpHelpers.GetRetryAfterreplaces only the duplicate parser;FabricItemDeleteThrottledException, nullable-header fallback, status/error wording, and unknown-outcome behavior remain unchanged.Tests reuse thread-safe
FabricCoreHttpMessageHandler.CallCount, capturing requests in callbacks for the original disposal assertions rather than adding properties to the shared handler.ItemDeleteTrackingContentremains intact. The original command/options/result/exception, registration guard, command tests, specialized content, and test-data helper are unchanged; every original Delete Item test method and InlineData case was retained.All lower tools, helpers, models, tests, docs, prompts, and changelog entries are retained. The named Get Workspace and List Items service/MCP suites are unchanged. Cumulative discovery assertions now include Delete Item, and read-only discovery excludes it and all earlier mutations. All five inherited default/all host cases remain. This layer introduces no engineering, shared framework, production host/proxy, auth, project, or dependency changes; only host discovery-test assertions are extended.
GitHub issue number?
N/A — no issue was supplied or created. This is the existing single-tool PR, now dependent on Update Item as described above.
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 prompts - Not run; score/ranking requirement waived for this PR by the Fabric MCP maintainer.consolidated-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 PipelineApplicability: this is Fabric-only and renames no tools. Fabric uses
NullConsolidatedToolDefinitionProvider, so Azure-only consolidation/command-metadata items do not apply. No live-pipeline comment was posted. The ToolDescriptionEvaluator score/ranking requirement is waived for this PR by the Fabric MCP maintainer; the evaluator was not run.Cumulative validation
SDK 10.0.401. 1,344 focused offline tests passed, zero failed/skipped: 1,337 Core, five host, and two credential-bridge cases. All 1,199 parent Core cases remain, plus all 138 original Delete Item cases. Discovery contains 57 Fabric tools / 11 Core names. All 31 prompt rows match; the 28 inherited rows are retained exactly.
All deletion HTTP/credential interactions are mocked. Host tests perform local discovery only; no real Fabric call or deletion was made.
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-restore --no-progressdotnet build 'servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --nologo --verbosity quietdotnet build 'servers\Fabric.Mcp.Server\src\Fabric.Mcp.Server.csproj' --no-restore --nologo --verbosity quietdotnet test --project 'servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --no-build --no-restore --no-progressdotnet build 'tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj' --nologo --verbosity quietdotnet test --project 'tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj' --no-build --no-restore --filter-class '*ProviderDelegatingCredentialTests' --no-progressdotnet format 'tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj' --no-restore --verify-no-changes --include $source --verbosity quietdotnet format 'tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj' --no-restore --verify-no-changes --include $tests --verbosity quietdotnet format 'servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --no-restore --verify-no-changes --include 'servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Infrastructure\ServerStartupTests.cs' --verbosity quiet.\eng\common\spelling\Invoke-Cspell.ps1 -FileList $paths -PackageInstallCache $cache.\eng\scripts\Process-PackageReadMe.ps1 -Command 'validate' -InputReadMePath 'servers\Fabric.Mcp.Server\README.md'.\eng\scripts\Compile-Changelog.ps1 -ChangelogPath 'servers\Fabric.Mcp.Server\CHANGELOG.md' -DryRun& '.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe' 'tools' 'list' '--name-only'pwsh -NoProfile -File '.\eng\scripts\Test-ToolSelectionPrompts.ps1' -ServerName 'Fabric.Mcp.Server' -OutputPath $outputgit --no-pager diff --check 'a92fad0120739d227ab2aa867ec4c6d5fb4a9390..HEAD' --$source,$tests, and$pathsare layer-relative file arrays.$cachewas the session-localfiles\delete-item-stack-cspell-cache, cleaned by the spelling script.$outputwasJoin-Path $PWD '.work\stack-3848-prompt-build', verified absent before the fresh build. Git long-path support was process-local, not a repository/global configuration change.Coverage includes actual guarded registered CLI/MCP paths, omission/false/explicit true, bare/empty/invalid/repeated/alias inputs, existing coercions, pre-authentication UUID validation, exact request/query/body shape and counts, empty 200, 403/404 and other failures, validated throttling guidance, cancellation/disposal, output/schema/annotations, read-only exclusion, destructive consent, and all lower-layer regressions.
The former stderr/JSON prompt-validator failure is resolved by inherited #3854; the actual script passes on this layer. This is catalog-name validation, not a ToolDescriptionEvaluator score. No new engineering workaround is included.
Recovery and publication
The create-only local recovery ref
refs/backup/fabric-stack-3848-20261005retains original heade345110ab2c92bec39b282c9ea82cce1b0a8e0ac. Only the verified original one-tool commit after historical forkd4df988aae3ba1de008efe10f664f12817bdcc24was rebased onto the exact frozen parent. Publication used only the owning branch refspec with--force-with-lease=refs/heads/amoshersch-fabric-delete-item:e345110ab2c92bec39b282c9ea82cce1b0a8e0ac.Own/lower PR states, refs, locks, auto-merge/queue absence, and empty filtered native-stack membership were revalidated before publication and retargeting, then verified afterward. The same draft PR and branch remain. GitHub refreshed the old main-based metadata to
0fa879ecf7c51946fa17e73304e468558c351b6c; this was observation only and was not imported.Limitations and current CI
6920355shows cancelled Initialize and SDL Sources Analysis stages, while the aggregatemcp - pullrequestcheck remains queued. No retries or live pipelines were requested. Required CI and human review still apply.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.