Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Documentation and test comments incorrectly stated that Azure Resource IDs use '-' (hyphen) for sanitization, when the actual implementation uses '_' (underscore). This created confusion about the dual ID architecture where clusterId must never contain '/' characters.

Changes:

  • Source documentation - Updated BaseClusterModel.ts and copilot-instructions.md to correctly document that '/' is replaced with '_' in sanitized IDs
  • Test clarifications - Enhanced test titles and comments in BaseClusterModel.test.ts and AzureClusterModel.test.ts to explicitly show both clusterId and treeId are sanitized for Azure/Discovery Views
  • Test cleanup - Removed unused outputChannelWarnMock variable and fixed lint error in DiscoveryBranchDataProvider.test.ts

Example:

// BEFORE (misleading comment)
// Sanitized Azure Resource ID (no '/' - replaced with '-')

// AFTER (correct)
// Sanitized Azure Resource ID (no '/' - replaced with '_')

// Test now correctly demonstrates sanitization
const sanitizedId = azureResourceId.replace(/\//g, '_');  // Uses underscore
expect(cluster.clusterId).toBe(sanitizedId);
expect(cluster.clusterId).not.toContain('/');

All documentation now consistently reflects that the original unsanitized Azure Resource ID is preserved in AzureClusterModel.id for Azure API calls, while clusterId and treeId use the sanitized version with underscores.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…stead of hyphen

Co-authored-by: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-documentdb/vscode-documentdb/node_modules/.bin/vscode-test --testPathPattern=BaseClusterModel.test|AzureClusterModel.test|CredentialCache.test --passWithNoTests (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Refactor base cluster model architecture for clarity Fix Azure Resource ID sanitization documentation inconsistencies Jan 30, 2026
Copilot AI requested a review from tnaum-ms January 30, 2026 20:50
@tnaum-ms tnaum-ms marked this pull request as ready for review January 30, 2026 21:05
@tnaum-ms tnaum-ms requested a review from a team as a code owner January 30, 2026 21:05
@tnaum-ms tnaum-ms merged commit 0da279e into dev/tnaum/refactor-base-cluster-model-architecture Jan 30, 2026
2 checks passed
@tnaum-ms tnaum-ms deleted the copilot/sub-pr-473 branch January 30, 2026 21:05
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.

2 participants