From 2d94089e5a51856dc565fc457890fa32e59ca73f Mon Sep 17 00:00:00 2001 From: soridalac Date: Thu, 14 Nov 2024 11:29:49 -0800 Subject: [PATCH 1/8] fix: source tracking error --- src/shared/sandboxCommandBase.ts | 4 ++-- src/shared/sandboxProgress.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/sandboxCommandBase.ts b/src/shared/sandboxCommandBase.ts index f4575129..0d126603 100644 --- a/src/shared/sandboxCommandBase.ts +++ b/src/shared/sandboxCommandBase.ts @@ -76,8 +76,8 @@ export abstract class SandboxCommandBase extends SfCommand { // if user hasn't opted out of tracking, and sandbox type supports it, verify that prod org supports tracking-enabled sandboxes const sourceTrackingSettings = await this.prodOrg .getConnection() - .metadata.read('SourceTrackingSettings', 'SourceTrackingSettings'); - if (sourceTrackingSettings.enableSourceTrackingSandboxes !== true) { + .singleRecordQuery('SELECT IsSourceTrackingSandboxesEnabled FROM SourceTrackingSettings', { tooling: true }); + if (sourceTrackingSettings.IsSourceTrackingSandboxesEnabled !== true) { return false; } } diff --git a/src/shared/sandboxProgress.ts b/src/shared/sandboxProgress.ts index 6b6a97c2..c994bc74 100644 --- a/src/shared/sandboxProgress.ts +++ b/src/shared/sandboxProgress.ts @@ -20,7 +20,7 @@ export type SandboxProgressData = { }; export type SandboxStatusData = { - sandboxUsername: string; + sandboxUsername: string | undefined; sandboxProgress: SandboxProgressData; sandboxProcessObj?: SandboxProcessObject | undefined; }; From d5c6bec13e0bb6d9afd64ce1e93bccb87ab118bd Mon Sep 17 00:00:00 2001 From: soridalac Date: Thu, 14 Nov 2024 15:53:01 -0800 Subject: [PATCH 2/8] chore: ci-rerun From d3ea0ea0b151867f9281d42bf938cd27cb224a1e Mon Sep 17 00:00:00 2001 From: soridalac Date: Thu, 14 Nov 2024 19:43:29 -0800 Subject: [PATCH 3/8] fix: validation source tracking --- src/shared/sandboxCommandBase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/sandboxCommandBase.ts b/src/shared/sandboxCommandBase.ts index 0d126603..40c85a9f 100644 --- a/src/shared/sandboxCommandBase.ts +++ b/src/shared/sandboxCommandBase.ts @@ -77,7 +77,7 @@ export abstract class SandboxCommandBase extends SfCommand { const sourceTrackingSettings = await this.prodOrg .getConnection() .singleRecordQuery('SELECT IsSourceTrackingSandboxesEnabled FROM SourceTrackingSettings', { tooling: true }); - if (sourceTrackingSettings.IsSourceTrackingSandboxesEnabled !== true) { + if (sourceTrackingSettings && sourceTrackingSettings.IsSourceTrackingSandboxesEnabled !== true) { return false; } } From 5df9bbbe252ed7d8da7a017335758b6235b28e4b Mon Sep 17 00:00:00 2001 From: soridalac Date: Fri, 15 Nov 2024 08:10:59 -0800 Subject: [PATCH 4/8] fix: remove redundancy --- src/shared/sandboxCommandBase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/sandboxCommandBase.ts b/src/shared/sandboxCommandBase.ts index 40c85a9f..0d126603 100644 --- a/src/shared/sandboxCommandBase.ts +++ b/src/shared/sandboxCommandBase.ts @@ -77,7 +77,7 @@ export abstract class SandboxCommandBase extends SfCommand { const sourceTrackingSettings = await this.prodOrg .getConnection() .singleRecordQuery('SELECT IsSourceTrackingSandboxesEnabled FROM SourceTrackingSettings', { tooling: true }); - if (sourceTrackingSettings && sourceTrackingSettings.IsSourceTrackingSandboxesEnabled !== true) { + if (sourceTrackingSettings.IsSourceTrackingSandboxesEnabled !== true) { return false; } } From bb42e312f7183deff02cc2460f16559c6237441d Mon Sep 17 00:00:00 2001 From: soridalac Date: Fri, 15 Nov 2024 11:19:24 -0800 Subject: [PATCH 5/8] chore: ci-rerun From e5daf4550149b38faad8081d0ce02c73f6a3f394 Mon Sep 17 00:00:00 2001 From: soridalac Date: Mon, 18 Nov 2024 08:30:09 -0800 Subject: [PATCH 6/8] chore: ci-rerun From 733600270f12e687179fd9f6875799696082165a Mon Sep 17 00:00:00 2001 From: soridalac Date: Mon, 18 Nov 2024 09:17:31 -0800 Subject: [PATCH 7/8] fix: add sourcetracking field --- src/commands/org/refresh/sandbox.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/org/refresh/sandbox.ts b/src/commands/org/refresh/sandbox.ts index bf591749..436f21e8 100644 --- a/src/commands/org/refresh/sandbox.ts +++ b/src/commands/org/refresh/sandbox.ts @@ -34,6 +34,7 @@ const fields = [ 'SourceId', // (string) SandboxInfoId as the source org used for a clone // 'ActivationUserGroupId', // Currently not supported but might be added in API v61.0 // 'CopyArchivedActivities', -- only for full sandboxes; depends if a license was purchased + 'IsSourceTrackingSandboxesEnabled', ...uneditableFields, ]; From 66e57cd12c835d6fff240519dc71ba06e6811e3d Mon Sep 17 00:00:00 2001 From: soridalac Date: Tue, 19 Nov 2024 09:30:24 -0800 Subject: [PATCH 8/8] fix: remove the field --- src/commands/org/refresh/sandbox.ts | 1 - src/shared/sandboxCommandBase.ts | 2 +- src/shared/sandboxProgress.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/commands/org/refresh/sandbox.ts b/src/commands/org/refresh/sandbox.ts index 436f21e8..bf591749 100644 --- a/src/commands/org/refresh/sandbox.ts +++ b/src/commands/org/refresh/sandbox.ts @@ -34,7 +34,6 @@ const fields = [ 'SourceId', // (string) SandboxInfoId as the source org used for a clone // 'ActivationUserGroupId', // Currently not supported but might be added in API v61.0 // 'CopyArchivedActivities', -- only for full sandboxes; depends if a license was purchased - 'IsSourceTrackingSandboxesEnabled', ...uneditableFields, ]; diff --git a/src/shared/sandboxCommandBase.ts b/src/shared/sandboxCommandBase.ts index 0d126603..84b3de53 100644 --- a/src/shared/sandboxCommandBase.ts +++ b/src/shared/sandboxCommandBase.ts @@ -77,7 +77,7 @@ export abstract class SandboxCommandBase extends SfCommand { const sourceTrackingSettings = await this.prodOrg .getConnection() .singleRecordQuery('SELECT IsSourceTrackingSandboxesEnabled FROM SourceTrackingSettings', { tooling: true }); - if (sourceTrackingSettings.IsSourceTrackingSandboxesEnabled !== true) { + if (sourceTrackingSettings?.IsSourceTrackingSandboxesEnabled !== true) { return false; } } diff --git a/src/shared/sandboxProgress.ts b/src/shared/sandboxProgress.ts index c994bc74..6b6a97c2 100644 --- a/src/shared/sandboxProgress.ts +++ b/src/shared/sandboxProgress.ts @@ -20,7 +20,7 @@ export type SandboxProgressData = { }; export type SandboxStatusData = { - sandboxUsername: string | undefined; + sandboxUsername: string; sandboxProgress: SandboxProgressData; sandboxProcessObj?: SandboxProcessObject | undefined; };