Skip to content

feat: migration providers whitelisting + documentation#162

Merged
tnaum-ms merged 6 commits into
feature/migration-plugin-apifrom
dev/tnaum/migration-api-improvements
Jun 16, 2025
Merged

feat: migration providers whitelisting + documentation#162
tnaum-ms merged 6 commits into
feature/migration-plugin-apifrom
dev/tnaum/migration-api-improvements

Conversation

@tnaum-ms

Copy link
Copy Markdown
Collaborator

This pull request introduces experimental features for the DocumentDB extension in VS Code, focusing on a new data migration framework and enhanced API safeguards. It also includes minor updates to documentation, localization strings, and code cleanup. Below is a summary of the most important changes grouped by theme.

Experimental Data Migration Framework

  • Added documentation for a new experimental data migration feature, outlining its functionality, provider-based architecture, and preview phase restrictions. (docs/learn-more/data-migrations.md, docs/learn-more/data-migrations.mdR1-R92)
  • Updated package.json to include a whitelist of registered clients allowed to use the experimental API. (package.json, package.jsonR922-R927)

API Safeguards and Validation

  • Introduced a type guard (isValidPackageJson) to validate the DocumentDB API configuration in package.json and ensure calling extensions are whitelisted. (api/src/utils/getApi.ts, [1] [2]
  • Enhanced authentication warnings with detailed instructions for users to expand the tree item of the selected cluster before proceeding. (src/commands/chooseDataMigrationExtension/chooseDataMigrationExtension.ts, [1] [2]

Documentation Updates

  • Added a new section on data migrations to the documentation index and linked it in multiple places. (docs/index.md, [1]; docs/learn-more/index.md, [2]
  • Updated example connection strings in the manual to use localhost instead of external clusters for clarity. (docs/manual/how-to-construct-url.md, docs/manual/how-to-construct-url.mdL87-R105)

Codebase Enhancements

  • Refactored MigrationService to include methods for registering and unregistering migration providers, with automatic updates to VS Code context. (src/services/migrationServices.ts, [1] [2]
  • Removed unused imports and commented out functionality related to adding new migration providers. (src/commands/chooseDataMigrationExtension/chooseDataMigrationExtension.ts, [1] [2] [3]

Localization Adjustments

  • Updated localization strings for improved clarity, such as changing "Authentication is required for this action" to "Authentication is required to run this action." (l10n/bundle.l10n.json, [1] [2]

@tnaum-ms tnaum-ms requested a review from Copilot June 16, 2025 08:09

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.

Pull Request Overview

This PR introduces an experimental data migration framework for the DocumentDB extension along with enhanced API safeguards, documentation updates, and localization improvements.

  • Refactored MigrationService to update VS Code context upon provider registration/unregistration.
  • Updated the data migration command to improve authentication warnings and remove legacy code.
  • Added a client whitelist to the API configuration in package.json and enhanced related documentation.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/services/migrationServices.ts Refactored provider registration/unregistration and added context updates for migration providers.
src/commands/chooseDataMigrationExtension/chooseDataMigrationExtension.ts Updated authentication prompts and commented out unused add-migration-provider code for clarity.
package.json Included a whitelist of registered clients and updated the context condition for migration providers.
l10n/bundle.l10n.json Updated localization strings to reflect new authentication warning details.
docs/manual/how-to-construct-url.md Updated connection string examples to use localhost for clarity.
docs/learn-more/index.md & docs/learn-more/data-migrations.md Added new sections documenting the experimental data migrations feature.
docs/index.md Updated index to reference the new data migrations section.
api/src/utils/getApi.ts Introduced a type guard to validate the API configuration and ensure calling extensions are whitelisted.

Comment thread src/services/migrationServices.ts
@tnaum-ms tnaum-ms merged commit 8467a78 into feature/migration-plugin-api Jun 16, 2025
5 checks passed
@tnaum-ms tnaum-ms deleted the dev/tnaum/migration-api-improvements branch June 16, 2025 08:18
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