From 7f6365b6cfd36cf098aef178070dce2aeddefda9 Mon Sep 17 00:00:00 2001 From: Kyle Zhang Date: Wed, 3 Jun 2026 15:03:06 +0800 Subject: [PATCH 1/3] refactor: remove unnecessary check for HighLevelClient to ModularClient transition in filterClassPropertiesMovedToInternals --- .../src/changelog/v2/DifferenceDetector.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/js-sdk-release-tools/src/changelog/v2/DifferenceDetector.ts b/tools/js-sdk-release-tools/src/changelog/v2/DifferenceDetector.ts index 41aa74274ea..3dedafa6b70 100644 --- a/tools/js-sdk-release-tools/src/changelog/v2/DifferenceDetector.ts +++ b/tools/js-sdk-release-tools/src/changelog/v2/DifferenceDetector.ts @@ -166,11 +166,6 @@ export class DifferenceDetector { // 2. A property on the constructor parameter type (e.g. options?: XxxOptionalParams // exposing apiVersion, cloudSetting, etc.) private filterClassPropertiesMovedToInternals(v: DiffPair[], className: string): DiffPair[] { - const isHlcToModular = - this.baselineApiViewOptions.sdkType === SDKType.HighLevelClient && - this.currentApiViewOptions.sdkType === SDKType.ModularClient; - if (!isHlcToModular) return v; - const currentClass = this.context!.current.getClass(className); if (!currentClass) return v; From c248a3265a7b527979fcf7c268695cca692a4070 Mon Sep 17 00:00:00 2001 From: Kyle Zhang Date: Wed, 3 Jun 2026 15:36:11 +0800 Subject: [PATCH 2/3] feat: add test for filtering removed class properties in ModularClient transition --- .../test/changelog/changelogGenerator.test.ts | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tools/js-sdk-release-tools/src/test/changelog/changelogGenerator.test.ts b/tools/js-sdk-release-tools/src/test/changelog/changelogGenerator.test.ts index 0ecbe4ee926..96cc8607c19 100644 --- a/tools/js-sdk-release-tools/src/test/changelog/changelogGenerator.test.ts +++ b/tools/js-sdk-release-tools/src/test/changelog/changelogGenerator.test.ts @@ -1126,6 +1126,59 @@ export interface ResourceManagementClientOptionalParams extends ClientOptions { expect(items[0]).toBe('Class ResourceManagementClient no longer has parameter tagsOperations'); }); + test('Class Property Removed that remains a constructor parameter is filtered regardless of SDK type', async () => { + // The HLC -> Modular guard was removed from filterClassPropertiesMovedToInternals, + // so properties that are still accessible via constructor signatures are filtered + // for ANY transition. This case uses Modular -> Modular to prove the filtering is + // no longer tied to the HLC -> Modular transition. + const baselineApiView = ` +\`\`\`ts +// @public +export class DataProductClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: DataProductClientOptionalParams); + subscriptionId: string; + readonly dataProducts: DataProducts; + readonly analytics: Analytics; +} + +// @public +export interface DataProductClientOptionalParams extends ClientOptions { + apiVersion?: string; +} +\`\`\` +`; + // subscriptionId — filtered because it is still a direct constructor parameter + // apiVersion — not present as a property here, but exposed via the options bag + // analytics — BREAKING: genuinely removed, must still be reported + const currentApiView = ` +\`\`\`ts +// @public +export class DataProductClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: DataProductClientOptionalParams); + readonly dataProducts: DataProducts; +} + +// @public +export interface DataProductClientOptionalParams extends ClientOptions { + apiVersion?: string; +} +\`\`\` +`; + const changelogItems = await generateChangelogItems( + { + apiView: baselineApiView, + sdkType: SDKType.ModularClient, + }, + { + apiView: currentApiView, + sdkType: SDKType.ModularClient, + } + ); + const items = getItemsByCategory(changelogItems, ChangelogItemCategory.ClassPropertyRemoved); + expect(items).toHaveLength(1); + expect(items[0]).toBe('Class DataProductClient no longer has parameter analytics'); + }); + test('Class Property Optional To Required', async () => { const baselineApiView = ` \`\`\`ts From 4fba58dd94a92c004a56b39c1e4a79a284164233 Mon Sep 17 00:00:00 2001 From: Kyle Zhang Date: Wed, 3 Jun 2026 16:51:36 +0800 Subject: [PATCH 3/3] refactor: update comments to clarify filtering of class property removals in SDK transitions --- .../src/changelog/v2/DifferenceDetector.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/js-sdk-release-tools/src/changelog/v2/DifferenceDetector.ts b/tools/js-sdk-release-tools/src/changelog/v2/DifferenceDetector.ts index 3dedafa6b70..2cff1688071 100644 --- a/tools/js-sdk-release-tools/src/changelog/v2/DifferenceDetector.ts +++ b/tools/js-sdk-release-tools/src/changelog/v2/DifferenceDetector.ts @@ -159,9 +159,12 @@ export class DifferenceDetector { }); } - // Filters out class property removals that are "by design" in HLC -> Modular migration. - // A removed property is considered non-breaking when it is still accessible via constructor - // signatures in the Modular client, either as: + // Filters out class property removals that are "by design" when a property is no longer + // a public class member but is still accessible via the current client's constructor + // signatures. This is applied to every SDK transition (not just HLC -> Modular), because + // the baseline SDK type detected from a downloaded npm package can be unreliable, and the + // constructor-based check below is sufficient on its own to decide whether the removal is + // non-breaking. A removed property is considered non-breaking when it is still accessible as: // 1. The constructor parameter name itself (e.g. subscriptionId) // 2. A property on the constructor parameter type (e.g. options?: XxxOptionalParams // exposing apiVersion, cloudSetting, etc.)