-
Notifications
You must be signed in to change notification settings - Fork 29
Add manual cleanup block for unpublish #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
deepaligargms
wants to merge
4
commits into
main
Choose a base branch
from
u/deepaligarg/unpublishchanges
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
26 changes: 26 additions & 0 deletions
26
src/Microsoft.Agents.A365.DevTools.Cli/Models/McpServerAppEntry.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace Microsoft.Agents.A365.DevTools.Cli.Models; | ||
|
|
||
| /// <summary> | ||
| /// An Entra app registration associated with a published MCP server that the CLI is responsible for | ||
| /// deleting on unpublish. The platform cannot delete app registrations in the customer tenant, so it | ||
| /// returns these entries and the CLI performs the deletion using the caller's Graph permissions. | ||
| /// </summary> | ||
| public class McpServerAppEntry | ||
| { | ||
| /// <summary> | ||
| /// Friendly name of the app registration (for logging / manual cleanup guidance). | ||
| /// </summary> | ||
| [JsonPropertyName("AppName")] | ||
| public string? AppName { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The app (client) id of the Entra app registration. The CLI resolves the underlying application | ||
| /// object id from this before calling Graph's application delete. | ||
| /// </summary> | ||
| [JsonPropertyName("AppId")] | ||
| public string? AppId { get; set; } | ||
| } |
27 changes: 27 additions & 0 deletions
27
src/Microsoft.Agents.A365.DevTools.Cli/Models/McpServerManualCleanup.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| using System.Collections.Generic; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace Microsoft.Agents.A365.DevTools.Cli.Models; | ||
|
|
||
| /// <summary> | ||
| /// Describes resources the unpublish operation could not delete on the caller's behalf and that the | ||
| /// caller must remove manually. Mirrors the platform's response contract so any client (not just this | ||
| /// CLI) can discover the cleanup responsibility from the response body. | ||
| /// </summary> | ||
| public class McpServerManualCleanup | ||
| { | ||
| /// <summary> | ||
| /// Human-readable explanation of why the listed resources were not deleted automatically and how | ||
| /// to remove them. | ||
| /// </summary> | ||
| [JsonPropertyName("Reason")] | ||
| public string? Reason { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The Entra app registrations the caller must delete manually in their own tenant. | ||
| /// </summary> | ||
| [JsonPropertyName("Apps")] | ||
| public List<McpServerAppEntry>? Apps { get; set; } | ||
| } |
38 changes: 38 additions & 0 deletions
38
src/Microsoft.Agents.A365.DevTools.Cli/Models/UnpublishMcpServerResponse.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| using System; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace Microsoft.Agents.A365.DevTools.Cli.Models; | ||
|
|
||
| /// <summary> | ||
| /// Response model for an MCP server unpublish operation. | ||
| /// </summary> | ||
| public class UnpublishMcpServerResponse | ||
| { | ||
| /// <summary> | ||
| /// Status of the unpublish operation. | ||
| /// </summary> | ||
| [JsonPropertyName("Status")] | ||
| public string? Status { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Message from the API response. | ||
| /// </summary> | ||
| [JsonPropertyName("Message")] | ||
| public string? Message { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Resources the platform could not delete in the customer tenant and that the caller must remove | ||
| /// manually (with a reason and the affected app registrations). Null when there is nothing for the | ||
| /// caller to clean up (for example OOB Dataverse servers or legacy records). | ||
| /// </summary> | ||
| [JsonPropertyName("ManualCleanupRequired")] | ||
| public McpServerManualCleanup? ManualCleanupRequired { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Whether the operation was successful. | ||
| /// </summary> | ||
| [JsonIgnore] | ||
| public bool IsSuccess => Status?.Equals("Success", StringComparison.OrdinalIgnoreCase) ?? false; | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.