From c2f5ac99f55733672ae0c4f6b0f95c00d114f506 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Mon, 7 Jul 2025 11:20:44 -0600 Subject: [PATCH 1/2] fix: optionally subscribe to SDR events, rather than optionally creating STL --- src/utils/deploy.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/utils/deploy.ts b/src/utils/deploy.ts index 0028bc7c..670d60d8 100644 --- a/src/utils/deploy.ts +++ b/src/utils/deploy.ts @@ -87,7 +87,7 @@ export async function buildComponentSet(opts: Partial, stl?: Sour return cs; } - return ComponentSetBuilder.build({ + const x = await ComponentSetBuilder.build({ apiversion: opts['api-version'], sourceapiversion: await getSourceApiVersion(), sourcepath: opts['source-dir'], @@ -104,6 +104,7 @@ export async function buildComponentSet(opts: Partial, stl?: Sour ...(opts.metadata ? { metadata: { metadataEntries: opts.metadata, directoryPaths: await getPackageDirs() } } : {}), projectDir: stl?.projectPath, }); + return x; } export async function executeDeploy( @@ -143,17 +144,14 @@ export async function executeDeploy( } else { // instantiate source tracking // stl will decide, based on the org's properties, what needs to be done - let stl: SourceTracking | undefined; - if (!opts['dry-run'] || !(await org.tracksSource())) { - stl = await SourceTracking.create({ - org, - // mdapi format deploys don't require a project, but at this point we need one - project: project ?? (await SfProject.resolve()), - subscribeSDREvents: true, - ignoreConflicts: opts['ignore-conflicts'], - }); - registry = stl.registry; - } + const stl = await SourceTracking.create({ + org, + // mdapi format deploys don't require a project, but at this point we need one + project: project ?? (await SfProject.resolve()), + subscribeSDREvents: !opts['dry-run'] || !(await org.tracksSource()), + ignoreConflicts: opts['ignore-conflicts'], + }); + registry = stl.registry; componentSet = await buildComponentSet(opts, stl); if (componentSet.size === 0) { From 759dc40ba09e0c1adbffbacae18d677309281188 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Mon, 7 Jul 2025 11:21:34 -0600 Subject: [PATCH 2/2] chore: undo temp var --- src/utils/deploy.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/deploy.ts b/src/utils/deploy.ts index 670d60d8..188cee18 100644 --- a/src/utils/deploy.ts +++ b/src/utils/deploy.ts @@ -87,7 +87,7 @@ export async function buildComponentSet(opts: Partial, stl?: Sour return cs; } - const x = await ComponentSetBuilder.build({ + return ComponentSetBuilder.build({ apiversion: opts['api-version'], sourceapiversion: await getSourceApiVersion(), sourcepath: opts['source-dir'], @@ -104,7 +104,6 @@ export async function buildComponentSet(opts: Partial, stl?: Sour ...(opts.metadata ? { metadata: { metadataEntries: opts.metadata, directoryPaths: await getPackageDirs() } } : {}), projectDir: stl?.projectPath, }); - return x; } export async function executeDeploy(