Skip to content

Sync next with main after two patch releases#330

Closed
tnaum-ms wants to merge 19 commits intonextfrom
main
Closed

Sync next with main after two patch releases#330
tnaum-ms wants to merge 19 commits intonextfrom
main

Conversation

@tnaum-ms
Copy link
Collaborator

No description provided.

@tnaum-ms tnaum-ms marked this pull request as ready for review October 31, 2025 10:13
@tnaum-ms tnaum-ms requested a review from a team as a code owner October 31, 2025 10:13
Copilot AI review requested due to automatic review settings October 31, 2025 10:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces API versioning for the DocumentDB extension API and adds support for a new v0.3.0 API with stricter provider registration and context validation. The PR also includes fixes for connection string parsing issues with special characters in query parameters.

  • Introduces v0.3.0 API with extension context-based provider registration that enforces one-provider-per-extension rule
  • Maintains backward compatibility with v0.2.0 API (marked as deprecated)
  • Fixes connection string parsing for special characters (e.g., @) in query parameters
  • Adds comprehensive test coverage for connection string parsing edge cases
  • Updates documentation and release notes for both patch releases (0.5.1 and 0.5.2)

Reviewed Changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/services/migrationServices.ts Adds registerProviderWithContext method to enforce one-provider-per-extension rule and tracks extension-to-provider mappings
src/extension.ts Implements dual API support (v0.2.0 and v0.3.0) using createApiProvider
src/documentdb/utils/DocumentDBConnectionString.ts Adds constructor-based sanitization for query parameters and username encoding/decoding support
src/documentdb/utils/DocumentDBConnectionString.test.ts Adds comprehensive test coverage for special characters, duplicate parameters, and edge cases
src/commands/chooseDataMigrationExtension/chooseDataMigrationExtension.ts Refactors to remove async wrapper function and inline action items creation
api/src/utils/getApi.ts Updates to support versioned API selection using getApi<T>()
api/src/migration/migrationApi.ts Adds MigrationApiV030 interface requiring extension context parameter
api/src/extensionApi.ts Extends interfaces from AzureExtensionApi and adds v0.3.0 interface
package.json, api/package.json Version bumps and dependency updates
Documentation files Updates for release notes, API usage examples, and version information
Files not reviewed (1)
  • api/package-lock.json: Language not supported

* The main API interface for the DocumentDB extension
*/
export interface DocumentDBExtensionApi {
export interface DocumentDBExtensionApi extends AzureExtensionApi {
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DocumentDBExtensionApi interface is missing the apiVersion property that was previously documented. According to the AzureExtensionApi interface, it should include an apiVersion: string property. Either add this property to the interface definition or update the documentation to clarify that the version is inherited from AzureExtensionApi.

Copilot uses AI. Check for mistakes.
Comment on lines +74 to 78
// Create the DocumentDB Extension API v0.2.0
const documentDBApiV2: DocumentDBExtensionApi = {
apiVersion: '0.2.0',
migration: {
registerProvider: (provider) => {
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment states "v0.2.0" but the actual implementation includes more than just the DocumentDB API. The API object should either be documented as deprecated or the comment should clarify its relationship to the new v0.3.0 API. Consider adding a deprecation notice in the comment.

Copilot uses AI. Check for mistakes.
Comment on lines +123 to +127
const availableActions: (QuickPickItem & {
id: string;
learnMoreUrl?: string;
requiresAuthentication?: boolean;
})[] = (await selectedProvider.getAvailableActions(options)).map((action) => ({
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline type definition for availableActions is duplicated (appears again when extending with learn more options). Consider extracting this type to a shared interface or type alias to improve maintainability and avoid duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +10
- **v0.3.0 (Latest)**: The current and only supported version. It requires the extension context for provider registration and enforces a one-provider-per-extension rule.
- **v0.2.0 (Deprecated)**: This version is deprecated and will be removed in a future release. New integrations should not use it.
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states v0.3.0 is the "only supported version" while also stating v0.2.0 is "deprecated" in the next line. This is contradictory. If v0.2.0 is still functional (as the code shows), it should be described as "supported but deprecated" rather than implying it's unsupported.

Suggested change
- **v0.3.0 (Latest)**: The current and only supported version. It requires the extension context for provider registration and enforces a one-provider-per-extension rule.
- **v0.2.0 (Deprecated)**: This version is deprecated and will be removed in a future release. New integrations should not use it.
- **v0.3.0 (Latest)**: The latest and recommended version. It requires the extension context for provider registration and enforces a one-provider-per-extension rule.
- **v0.2.0 (Supported but Deprecated)**: This version is still supported but deprecated and will be removed in a future release. New integrations should not use it.

Copilot uses AI. Check for mistakes.
const encodedParams: string[] = [];

// Get all unique keys (without duplicates)
const uniqueKeys = [...new Set([...searchParams.keys()])];
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a Set from searchParams.keys() and then spreading it into an array is unnecessary since URLSearchParams.keys() already returns unique keys. The Set construction adds overhead without benefit. Consider using Array.from(searchParams.keys()) or [...searchParams.keys()] directly.

Suggested change
const uniqueKeys = [...new Set([...searchParams.keys()])];
const uniqueKeys = [...searchParams.keys()];

Copilot uses AI. Check for mistakes.
@tnaum-ms
Copy link
Collaborator Author

branch protections are making this PR difficult to handle.

@tnaum-ms tnaum-ms closed this Oct 31, 2025
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.

1 participant