Skip to content

Conversation

@sandy081
Copy link
Member

No description provided.

@sandy081 sandy081 requested review from Copilot and ulugbekna October 30, 2025 18:04
@sandy081 sandy081 enabled auto-merge October 30, 2025 18:04
@sandy081 sandy081 self-assigned this Oct 30, 2025
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 PR migrates internal configuration settings from the chat.advanced.* namespace to a simpler chat.* namespace, making them public/experimental settings accessible to users. The migration includes automatic configuration migration logic to transfer user values from old keys to new keys.

Key changes:

  • Created a configuration migration registry system to handle automatic migration of setting values
  • Moved 40+ settings from chat.advanced.* to chat.* namespace and changed them from internal-only to public settings
  • Updated tests to reflect new setting IDs and public visibility
  • Added localization strings and package.json schema entries for newly public settings

Reviewed Changes

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

Show a summary per file
File Description
src/platform/configuration/common/configurationService.ts Adds configuration migration infrastructure and updates 40+ setting definitions to use new namespace with migration
src/platform/configuration/test/common/configurationService.spec.ts Updates test assertions to verify new setting IDs and public visibility
src/extension/configuration/vscode-node/configurationMigration.ts Moves migration types to platform layer, imports them instead
package.nls.json Adds localization strings for newly public settings
package.json Adds schema definitions for newly public experimental settings

Comment on lines +531 to +543
function defineAndMigrateSetting<T>(oldKey: string, newKey: string, defaultValue: T | DefaultValueWithTeamValue<T> | DefaultValueWithTeamAndInternalValue<T>, options?: ConfigOptions): Config<T> {
const value = defineSetting(newKey, defaultValue, options);
ConfigurationMigrationRegistry.registerConfigurationMigrations([{
key: `${CopilotConfigPrefix}.${oldKey}`,
migrateFn: async (migrationValue: any) => {
return [
[`${CopilotConfigPrefix}.${newKey}`, { value: migrationValue }],
[`${CopilotConfigPrefix}.${oldKey}`, { value: undefined }]
];
}
}]);
return value;
}
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

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

The defineAndMigrateSetting function lacks documentation. Add a JSDoc comment explaining its purpose, parameters, and the migration behavior (that it automatically migrates values from oldKey to newKey and removes the old setting).

Copilot uses AI. Check for mistakes.
Comment on lines +564 to +576
export function defineAndMigrateExpSetting<T extends ExperimentBasedConfigType>(oldKey: string, newKey: string, defaultValue: T | DefaultValueWithTeamValue<T> | DefaultValueWithTeamAndInternalValue<T>, options?: ConfigOptions, expOptions?: { experimentName?: string }): ExperimentBasedConfig<T> {
const value = defineExpSetting(newKey, defaultValue, options, expOptions);
ConfigurationMigrationRegistry.registerConfigurationMigrations([{
key: `${CopilotConfigPrefix}.${oldKey}`,
migrateFn: async (migrationValue: any) => {
return [
[`${CopilotConfigPrefix}.${newKey}`, { value: migrationValue }],
[`${CopilotConfigPrefix}.${oldKey}`, { value: undefined }]
];
}
}]);
return value;
}
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

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

The defineAndMigrateExpSetting function lacks documentation. Add a JSDoc comment explaining its purpose, parameters, and how it differs from defineAndMigrateSetting (it creates an experiment-based setting with migration).

Copilot uses AI. Check for mistakes.
Comment on lines +496 to +498
export type ConfigurationValue = { value: any | undefined /* Remove */ };
export type ConfigurationKeyValuePairs = [string, ConfigurationValue][];
export type ConfigurationMigrationFn = (value: any) => ConfigurationValue | ConfigurationKeyValuePairs | Promise<ConfigurationValue | ConfigurationKeyValuePairs>;
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

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

The configuration migration types lack documentation. Add JSDoc comments explaining that ConfigurationValue with undefined marks settings for removal, ConfigurationKeyValuePairs allows multi-key migrations, and ConfigurationMigrationFn handles the migration logic.

Suggested change
export type ConfigurationValue = { value: any | undefined /* Remove */ };
export type ConfigurationKeyValuePairs = [string, ConfigurationValue][];
export type ConfigurationMigrationFn = (value: any) => ConfigurationValue | ConfigurationKeyValuePairs | Promise<ConfigurationValue | ConfigurationKeyValuePairs>;
/**
* Represents a migrated configuration value.
* If `value` is `undefined`, the setting will be removed.
*/
export type ConfigurationValue = { value: any | undefined };
/**
* Allows migration of multiple configuration keys at once.
* Each tuple contains a key and its corresponding migrated value.
*/
export type ConfigurationKeyValuePairs = [string, ConfigurationValue][];
/**
* Handles the migration logic for a configuration value.
* Returns either a single migrated value, multiple key-value pairs, or a Promise resolving to one of these.
*/
export type ConfigurationMigrationFn = (value: any) => ConfigurationValue | ConfigurationKeyValuePairs | Promise<ConfigurationValue | ConfigurationKeyValuePairs>;

Copilot uses AI. Check for mistakes.
Comment on lines +500 to +501

export interface IConfigurationMigrationRegistry {
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

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

The IConfigurationMigrationRegistry interface lacks documentation. Add a JSDoc comment explaining its purpose as a registry for configuration setting migrations that are automatically executed when the extension loads.

Suggested change
export interface IConfigurationMigrationRegistry {
/**
* Registry for configuration setting migrations.
*
* This interface allows registration of configuration migrations, which are functions
* that transform or update configuration values. These migrations are automatically
* executed when the extension loads, ensuring that user settings are kept up to date
* with the latest schema or requirements.
*/
export interface IConfigurationMigrationRegistry {
/**
* Registers one or more configuration migrations to be executed automatically on extension load.
* @param configurationMigrations Array of configuration migration objects, each specifying a key and a migration function.
*/

Copilot uses AI. Check for mistakes.
@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 30, 2025
@sandy081 sandy081 modified the milestones: October 2025, November 2025 Nov 7, 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.

3 participants