From 49b74af42bb39674b958746047684547b27e7f67 Mon Sep 17 00:00:00 2001 From: soridalac Date: Tue, 19 Aug 2025 14:17:44 -0700 Subject: [PATCH 1/9] feat: add deprecation cycle deploy/retrieve start --- messages/deploy.metadata.md | 5 +++++ messages/retrieve.start.md | 5 +++++ src/commands/project/deploy/start.ts | 1 + src/commands/project/retrieve/start.ts | 14 ++++++++++++++ src/utils/deploy.ts | 7 ++++++- test/nuts/retrieve/noTracking.nut.ts | 9 +++++++++ 6 files changed, 40 insertions(+), 1 deletion(-) diff --git a/messages/deploy.metadata.md b/messages/deploy.metadata.md index 349838870..1ca534b38 100644 --- a/messages/deploy.metadata.md +++ b/messages/deploy.metadata.md @@ -257,3 +257,8 @@ The `pushPackageDirectoriesSequentially` property is not respected by this comma # apiVersionMsgDetailed %s %s metadata to %s using the v%s %s API. + +# noSourceTrackingWarning + +Starting in December 2025, this command will require source tracking support. +Production orgs and other non-tracking orgs will no longer be supported without explicit metadata specification. diff --git a/messages/retrieve.start.md b/messages/retrieve.start.md index 4ab517f1c..25b282adc 100644 --- a/messages/retrieve.start.md +++ b/messages/retrieve.start.md @@ -199,3 +199,8 @@ This command expects the org to support source tracking. If it doesn't, you must - Use the `--source-dir`, `--manifest` or `--package-name` flags to retrieve metadata in source format. - Use the `--target-metadata-dir` flag to retrieve metadata in metadata format to a directory. + +# noSourceTrackingWarning + +Starting in December 2025, this command will require source tracking support. +Production orgs and other non-tracking orgs will no longer be supported without explicit metadata specification. diff --git a/src/commands/project/deploy/start.ts b/src/commands/project/deploy/start.ts index 58fa7733a..dc2522543 100644 --- a/src/commands/project/deploy/start.ts +++ b/src/commands/project/deploy/start.ts @@ -234,6 +234,7 @@ export default class DeployMetadata extends SfCommand { ...flags, 'target-org': username, api, + warnCallback: this.warn.bind(this), }, project ); diff --git a/src/commands/project/retrieve/start.ts b/src/commands/project/retrieve/start.ts index f79134776..99f029ca5 100644 --- a/src/commands/project/retrieve/start.ts +++ b/src/commands/project/retrieve/start.ts @@ -176,6 +176,19 @@ export default class RetrieveMetadata extends SfCommand { // eslint-disable-next-line complexity public async run(): Promise { const { flags } = await this.parse(RetrieveMetadata); + + // Add warning for non-source-tracking orgs when using default behavior + const isChanges = + !flags['source-dir'] && + !flags['manifest'] && + !flags['metadata'] && + !flags['target-metadata-dir'] && + !flags['package-name']?.length; + + if (isChanges && !(await flags['target-org'].tracksSource())) { + this.warn(messages.getMessage('noSourceTrackingWarning')); + } + let resolvedTargetDir: string | undefined; if (flags['output-dir']) { resolvedTargetDir = resolve(flags['output-dir']); @@ -518,6 +531,7 @@ const buildRetrieveOptions = async ( output: string | undefined ): Promise => { const apiVersion = await resolveApiVersion(flags); + return { usernameOrConnection: flags['target-org'].getUsername() ?? flags['target-org'].getConnection(flags['api-version']), merge: true, diff --git a/src/utils/deploy.ts b/src/utils/deploy.ts index 188cee18d..13c54c1c2 100644 --- a/src/utils/deploy.ts +++ b/src/utils/deploy.ts @@ -53,10 +53,11 @@ export type DeployOptions = { 'pre-destructive-changes'?: string; 'post-destructive-changes'?: string; 'purge-on-delete'?: boolean; + warnCallback?: (message: string) => void; }; /** Manifest is expected. You cannot pass metadata and source-dir array--use those to get a manifest */ -export type CachedOptions = Omit & { +export type CachedOptions = Omit & { wait: number; /** whether the user passed in anything for metadata-dir (could be a folder, could be a zip) */ isMdapi: boolean; @@ -150,6 +151,10 @@ export async function executeDeploy( subscribeSDREvents: !opts['dry-run'] || !(await org.tracksSource()), ignoreConflicts: opts['ignore-conflicts'], }); + + if (!(await org.tracksSource()) && opts.warnCallback) { + opts.warnCallback(deployMessages.getMessage('noSourceTrackingWarning')); + } registry = stl.registry; componentSet = await buildComponentSet(opts, stl); diff --git a/test/nuts/retrieve/noTracking.nut.ts b/test/nuts/retrieve/noTracking.nut.ts index f6fc47391..518495ca1 100644 --- a/test/nuts/retrieve/noTracking.nut.ts +++ b/test/nuts/retrieve/noTracking.nut.ts @@ -49,6 +49,15 @@ describe('retrieve mdapi format without project', () => { expect(result?.files).to.not.be.empty; }); + it('should fail when retrieving changes from a non-tracking org', () => { + const result = execCmd(`project:retrieve:start -o ${session.hubOrg.username} --json`, { + ensureExitCode: 1, + }); + + expect(result.jsonOutput?.name).to.equal('noSourceTracking'); + expect(result.jsonOutput?.message).to.include('does not support source tracking'); + }); + after(async () => { await session?.clean(); }); From ddfe068bca2e9afc2de8ba0ad07d3665b92fb62f Mon Sep 17 00:00:00 2001 From: soridalac Date: Tue, 19 Aug 2025 14:54:34 -0700 Subject: [PATCH 2/9] fix: update NUT --- test/nuts/retrieve/noTracking.nut.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/nuts/retrieve/noTracking.nut.ts b/test/nuts/retrieve/noTracking.nut.ts index 518495ca1..fa45c054d 100644 --- a/test/nuts/retrieve/noTracking.nut.ts +++ b/test/nuts/retrieve/noTracking.nut.ts @@ -55,7 +55,7 @@ describe('retrieve mdapi format without project', () => { }); expect(result.jsonOutput?.name).to.equal('noSourceTracking'); - expect(result.jsonOutput?.message).to.include('does not support source tracking'); + expect(result.jsonOutput?.message).to.include('Unable to track changes in your source files'); }); after(async () => { From f6777904b632d5f25dfb4939e91a9051c15b1eac Mon Sep 17 00:00:00 2001 From: Sorida Lac <96142310+soridalac@users.noreply.github.com> Date: Thu, 21 Aug 2025 09:38:01 -0700 Subject: [PATCH 3/9] Update messages/deploy.metadata.md Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com> --- messages/deploy.metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/deploy.metadata.md b/messages/deploy.metadata.md index 1ca534b38..50f623834 100644 --- a/messages/deploy.metadata.md +++ b/messages/deploy.metadata.md @@ -261,4 +261,4 @@ The `pushPackageDirectoriesSequentially` property is not respected by this comma # noSourceTrackingWarning Starting in December 2025, this command will require source tracking support. -Production orgs and other non-tracking orgs will no longer be supported without explicit metadata specification. +Specifically, to use this command with a production org, scratch org created with the `--no-track-source` flag, or other non-source-tracking org, you must specify the metadata you want to deploy with either the `--metadata`, `--source-dir`, or `--manifest` flag. From be43446fce5eccb09753e1c19337c1646b0e8d99 Mon Sep 17 00:00:00 2001 From: Sorida Lac <96142310+soridalac@users.noreply.github.com> Date: Thu, 21 Aug 2025 09:38:11 -0700 Subject: [PATCH 4/9] Update messages/deploy.metadata.md Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com> --- messages/deploy.metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/deploy.metadata.md b/messages/deploy.metadata.md index 50f623834..27056a7c3 100644 --- a/messages/deploy.metadata.md +++ b/messages/deploy.metadata.md @@ -260,5 +260,5 @@ The `pushPackageDirectoriesSequentially` property is not respected by this comma # noSourceTrackingWarning -Starting in December 2025, this command will require source tracking support. +Starting in December 2025, this command will require that the target org use source tracking. Specifically, to use this command with a production org, scratch org created with the `--no-track-source` flag, or other non-source-tracking org, you must specify the metadata you want to deploy with either the `--metadata`, `--source-dir`, or `--manifest` flag. From e355a562da74df2b850b5c5b757e2db5d73f7c1b Mon Sep 17 00:00:00 2001 From: Sorida Lac <96142310+soridalac@users.noreply.github.com> Date: Thu, 21 Aug 2025 09:38:25 -0700 Subject: [PATCH 5/9] Update messages/retrieve.start.md Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com> --- messages/retrieve.start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/retrieve.start.md b/messages/retrieve.start.md index 25b282adc..5562a2415 100644 --- a/messages/retrieve.start.md +++ b/messages/retrieve.start.md @@ -202,5 +202,5 @@ This command expects the org to support source tracking. If it doesn't, you must # noSourceTrackingWarning -Starting in December 2025, this command will require source tracking support. +Starting in December 2025, this command will require that the target org use source tracking. Production orgs and other non-tracking orgs will no longer be supported without explicit metadata specification. From 960c2d922c94a871aa3496dca601c1b639654361 Mon Sep 17 00:00:00 2001 From: Sorida Lac <96142310+soridalac@users.noreply.github.com> Date: Thu, 21 Aug 2025 09:39:17 -0700 Subject: [PATCH 6/9] Update messages/retrieve.start.md Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com> --- messages/retrieve.start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/retrieve.start.md b/messages/retrieve.start.md index 5562a2415..34431ec9f 100644 --- a/messages/retrieve.start.md +++ b/messages/retrieve.start.md @@ -203,4 +203,4 @@ This command expects the org to support source tracking. If it doesn't, you must # noSourceTrackingWarning Starting in December 2025, this command will require that the target org use source tracking. -Production orgs and other non-tracking orgs will no longer be supported without explicit metadata specification. +Specifically, to use this command with a production org, scratch org created with the `--no-track-source` flag, or other non-source-tracking org, you must specify the metadata you want to retrieve with either the `--metadata`, `--source-dir`, or `--manifest` flag. From 22448361e9fd0e685c34926099746644e1d0d267 Mon Sep 17 00:00:00 2001 From: soridalac Date: Thu, 21 Aug 2025 10:29:22 -0700 Subject: [PATCH 7/9] chore: ci-rerun From 04dac7650f128cc8b81c09059521372041a5141a Mon Sep 17 00:00:00 2001 From: soridalac Date: Mon, 25 Aug 2025 10:49:07 -0700 Subject: [PATCH 8/9] fix: add validate flags --- src/commands/project/deploy/start.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/commands/project/deploy/start.ts b/src/commands/project/deploy/start.ts index dc2522543..6afa44f12 100644 --- a/src/commands/project/deploy/start.ts +++ b/src/commands/project/deploy/start.ts @@ -199,6 +199,12 @@ export default class DeployMetadata extends SfCommand { throw messages.createError('error.NoTestsSpecified'); } + const noDeployFlags = !flags['source-dir'] && !flags.manifest && !flags.metadata && !flags['metadata-dir']; + + if (noDeployFlags && !(await flags['target-org'].tracksSource())) { + this.warn(messages.getMessage('noSourceTrackingWarning')); + } + const api = await resolveApi(this.configAggregator); const username = flags['target-org'].getUsername(); const title = flags['dry-run'] ? 'Deploying Metadata (dry-run)' : 'Deploying Metadata'; From c703dd95e0d75b2e81dbf82d7d39a4e7d0842066 Mon Sep 17 00:00:00 2001 From: soridalac Date: Mon, 25 Aug 2025 12:39:00 -0700 Subject: [PATCH 9/9] fix: remove callback --- src/commands/project/deploy/start.ts | 1 - src/utils/deploy.ts | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/commands/project/deploy/start.ts b/src/commands/project/deploy/start.ts index 6afa44f12..eed1d3640 100644 --- a/src/commands/project/deploy/start.ts +++ b/src/commands/project/deploy/start.ts @@ -240,7 +240,6 @@ export default class DeployMetadata extends SfCommand { ...flags, 'target-org': username, api, - warnCallback: this.warn.bind(this), }, project ); diff --git a/src/utils/deploy.ts b/src/utils/deploy.ts index 13c54c1c2..188cee18d 100644 --- a/src/utils/deploy.ts +++ b/src/utils/deploy.ts @@ -53,11 +53,10 @@ export type DeployOptions = { 'pre-destructive-changes'?: string; 'post-destructive-changes'?: string; 'purge-on-delete'?: boolean; - warnCallback?: (message: string) => void; }; /** Manifest is expected. You cannot pass metadata and source-dir array--use those to get a manifest */ -export type CachedOptions = Omit & { +export type CachedOptions = Omit & { wait: number; /** whether the user passed in anything for metadata-dir (could be a folder, could be a zip) */ isMdapi: boolean; @@ -151,10 +150,6 @@ export async function executeDeploy( subscribeSDREvents: !opts['dry-run'] || !(await org.tracksSource()), ignoreConflicts: opts['ignore-conflicts'], }); - - if (!(await org.tracksSource()) && opts.warnCallback) { - opts.warnCallback(deployMessages.getMessage('noSourceTrackingWarning')); - } registry = stl.registry; componentSet = await buildComponentSet(opts, stl);