Skip to content

Handle unknown or legacy component - #534

Merged
Hoa Nguyen (nguhoa) merged 7 commits into
mainfrom
nguhoa/clone
Dec 2, 2026
Merged

Hoa Nguyen (nguhoa) merged 7 commits into
mainfrom
nguhoa/clone

Conversation

@nguhoa

@nguhoa Hoa Nguyen (nguhoa) commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Handle unknown or legacy component. Sync keeps these components only in the cloud cache, writes no file for them. Add readonly view for legacy or newer component.

Fix: #532

Copilot AI balanced review requested due to automatic review settings November 30, 2026 16:46

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.

🟡 Changes recommended

Unsupported-component handling can recreate remotely deleted topics or let later pushes delete remote components because deletion identity and read-only protection are not consistently preserved.

3 open issues
What changed in this PR

This PR addresses #532 by keeping legacy and unsupported components in the cloud cache rather than attempting to project them into editable files. It adds a read-only Explorer view and extends sync safeguards and diagnostics across the TypeScript extension and C# backend.

Changes:

  • Preserve unsupported components during sync, with a protection record for components that become readable after an update.
  • Add read-only documents, folder badges, explanatory diagnostics, and links to Copilot Studio.
  • Expand unit, host, and interoperability tests for unsupported components and their lifecycle.
File Description
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​package.json Registers the read-only Explorer view.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​utils/​genericUtils.ts Extracts folder URI normalization.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​types.ts Adds read-only component request and response types.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​ui/​scenarios/​groupC.test.ts Adds read-only component interoperability scenarios.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​ui/​lib/​shapes.ts Enables the new scenario for both agent layouts.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​ui/​lib/​groups.ts Registers the new interoperability scenario.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​ui/​lib/​dataverse.ts Adds Dataverse row creation for test setup.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​ui/​lib/​cleanup.ts Supports injected component cleanup.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​ui/​driver.ts Deletes injected components before test agents.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​host/​readOnlyComponents.test.ts Tests read-only views, refreshes, documents, and telemetry.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​host/​lspE2EHarness.test.ts Tests component injection and cleanup helpers.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​host/​genericUtils.test.ts Tests folder URI normalization.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​tests/​host/​agentIdentifier.test.ts Tests cluster-specific portal URLs.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​sync/​remoteFileSystem.ts Uses the shared read-only filesystem base.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​sync/​readOnlyFileSystem.ts Adds shared read-only filesystem behavior.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​sync/​originalFileSystem.ts Uses the shared read-only filesystem base.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​services/​telemetryDimensions.ts Adds the read-only component count dimension.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​services/​logger.ts Adds component metadata redaction categories.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​readOnlyComponents/​readOnlyComponents.ts Implements read-only browsing, refreshes, and diagnostics.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​extension.ts Initializes read-only component support.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​constants.ts Adds request names and telemetry events.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​commands/​remoteFileSystemProvider.ts Reuses shared filesystem registration.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​commands/​originalFileSystemProvider.ts Reuses shared filesystem registration.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​clone/​agentIdentifier.ts Builds cluster-specific agent portal URLs.
src/​vscode-extensions/​microsoft-powerplatformlang-extension/​client/​src/​clone/​agentDirectory.ts Reuses folder URI normalization.
src/​LanguageServers/​PowerPlatformLS/​UnitTests/​PowerPlatformLS.UnitTests/​TestUtilities/​CloudCacheJson.cs Adds cloud-cache test fixtures.
src/​LanguageServers/​PowerPlatformLS/​UnitTests/​PowerPlatformLS.UnitTests/​Impl.PullAgent/​Methods/​ReadOnlyComponentHandlerTests.cs Tests component listing and cached-content handlers.
src/​LanguageServers/​PowerPlatformLS/​UnitTests/​PowerPlatformLS.UnitTests/​Impl.PullAgent/​LspExceptionHandlerTests.cs Tests unreadable-cache error reporting.
src/​LanguageServers/​PowerPlatformLS/​UnitTests/​PowerPlatformLS.UnitTests/​Impl.Language.CopilotStudio/​WorkspaceCompilerTests.cs Tests component preservation and compatibility diagnostics.
src/​LanguageServers/​PowerPlatformLS/​UnitTests/​PowerPlatformLS.UnitTests/​Impl.Language.CopilotStudio/​ObjectModelExtensionsTests.cs Tests warnings for unchanged unknown elements.
src/​LanguageServers/​PowerPlatformLS/​UnitTests/​PowerPlatformLS.UnitTests/​Contracts.FileLayout/​ProjectorComparisonTests.cs Verifies concrete dialog folder mappings.
src/​LanguageServers/​PowerPlatformLS/​Impl.PullAgent/​ReadOnlyComponentHandlers.cs Adds listing and cached-content endpoints.
src/​LanguageServers/​PowerPlatformLS/​Impl.PullAgent/​LspExceptionHandler.cs Handles unreadable-cache failures.
src/​LanguageServers/​PowerPlatformLS/​Impl.PullAgent/​DependencyInjection/​PullAgentLspModule.cs Registers the new handlers.
src/​LanguageServers/​PowerPlatformLS/​Impl.Language.CopilotStudio/​Models/​ObjectModelExtensions.cs Downgrades unchanged unknown-element errors to warnings.
src/​LanguageServers/​PowerPlatformLS/​Impl.Language.CopilotStudio/​Models/​McsWorkspaceCompiler.cs Preserves protected components and flags read-only files.
src/​LanguageServers/​PowerPlatformLS/​Impl.Language.CopilotStudio/​Models/​McsCompilationAnalyzer.cs Compares unknown elements with their cached versions.
src/​LanguageServers/​PowerPlatformLS/​Impl.Language.CopilotStudio/​Exceptions/​ReadOnlyComponentException.cs Adds the read-only file warning.
src/​CopilotStudio.Sync/​WorkspaceSynchronizer.cs Integrates cache-only handling and protection records into sync.
src/​CopilotStudio.Sync/​UnreadableCloudCacheException.cs Adds an update-required cache exception.
src/​CopilotStudio.Sync/​TranslationsFolderMigration.cs Accepts a filtered component sequence.
src/​CopilotStudio.Sync/​SyncServiceRegistrations.cs Registers the read-only component reader.
src/​CopilotStudio.Sync/​SYNC-SEMANTICS.md Documents cache-only behavior and protection records.
src/​CopilotStudio.Sync/​ReadOnlyComponents.cs Classifies, labels, and serializes read-only components.
src/​CopilotStudio.Sync/​Models.cs Adds shared read-only component models.
src/​CopilotStudio.Sync/​IReadOnlyComponentReader.cs Defines listing and cached-content operations.
src/​CopilotStudio.Sync/​Dataverse/​SyncDataverseClient.cs Fetches and caches component type labels.
src/​CopilotStudio.Sync/​Dataverse/​IDataverseOperations.cs Adds the component type label contract.
src/​CopilotStudio.Sync.UnitTests/​StandaloneWorkflowDataverseTests.cs Tests label caching, retries, and cancellation.
src/​CopilotStudio.Sync.UnitTests/​LegacyOrUnknownComponentSyncTests.cs Tests unsupported component sync and preservation.
src/​CopilotStudio.Sync.UnitTests/​EnvironmentVariableTestFixtures.cs Allows tests to capture sync progress.
src/​CopilotStudio.McsCore/​SyncStateMap.cs Adds explicit read outcomes and atomic writes.
src/​CopilotStudio.McsCore/​ReadOnlyComponentRecord.cs Persists protection for unsupported components.
src/​CopilotStudio.McsCore/​CacheOnlyComponents.cs Centralizes cache-only classification and matching.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 30, 2026 18:08

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.

🟡 Changes recommended

Filename-based matching can associate a file with an unrelated unreadable component despite its explicit schema name, causing Sync to skip or delete the wrong file.

3 open issues
3 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 30, 2026 21:06

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.

🔵 Needs a closer look

The cleanup scan misses nested skill anchors, leaving files that can cause a remotely deleted skill to be rediscovered and recreated on the next Apply.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

High severity Clean up nested anchors for remotely deleted skills

src/​CopilotStudio.Sync/​WorkspaceSynchronizer.cs:5146

The CLI cleanup scan excludes nested anchors such as behaviors/weather/skill.mcs.yml, so a skill that becomes unreadable and is then deleted remotely retains its anchor and SKILL.md. DetectNewLocalSkills rediscovers the retained folder, allowing the next Apply to recreate the deleted skill. Add a cleanup-specific scan for nested skill folders and prevent synthesis from matched deleted folders without removing surviving components' assets; cover this transition with a nested CLI skill regression.

3 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 01:36

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.

🟡 Changes recommended

Critical protection gaps during reattach and failed-retarget rollback can allow unintended cloud deletions, while unreadable skill rediscovery can create unintended cloud inserts.

3 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 03:34

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.

🔵 Needs a closer look

Persistent cloud-delete protection spans upgrades, retargeting, and retries, requiring human validation of real-tenant PAC/msagent interoperability and recovery paths that could not be verified here.

2 open issues
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 15:21
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 687a8620-eb41-4dcc-84ed-057bbdc36c01

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.

🟡 Changes recommended

Restoring a previously unreadable skill’s parent leaves attachment sidecars and payloads without skill ownership, allowing a later metadata edit to clear ParentBotComponentId.

1 open issue
2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 15:33

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.

🟡 Changes recommended

Critical cleanup gaps can leave orphaned child files and silently delete unpushed local skill files when unreadable components are later deleted remotely.

3 open issues

Review effort: Balanced

@nguhoa
Hoa Nguyen (nguhoa) merged commit 1f72a13 into main Dec 2, 2026
5 checks passed
@nguhoa
Hoa Nguyen (nguhoa) deleted the nguhoa/clone branch December 2, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LegacyOrUnknownComponent

3 participants