From e676bb2bc3c74e4378954fed6ad3601058281692 Mon Sep 17 00:00:00 2001 From: Cristian Dominguez Date: Tue, 16 Jan 2024 13:50:11 -0300 Subject: [PATCH 1/3] fix(retrieve): improve source-tracking err message --- messages/retrieve.start.md | 11 ++++++++++ package.json | 4 ++-- src/commands/project/retrieve/start.ts | 7 +++++++ yarn.lock | 28 +++++++++++++------------- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/messages/retrieve.start.md b/messages/retrieve.start.md index 6108b8a0..5ab509b3 100644 --- a/messages/retrieve.start.md +++ b/messages/retrieve.start.md @@ -192,3 +192,14 @@ The retrieve target directory [%s] overlaps one of your package directories. Spe # wantsToRetrieveCustomFields Because you're retrieving one or more CustomFields, we're also retrieving the CustomObject to which it's associated. + +# noSourceTracking + +Unable to track changes in source. +This command expects the org to support source tracking, if it doesn't you need to specify the metadata to be retrieved. + +# noSourceTracking.actions + +- Use `--source-dir`, `--manifest` or `--package-name` to retrieve in source format: + +- Use `--target-metadata-dir` to retrieve in metadata format to a directory diff --git a/package.json b/package.json index affce077..e53e20ed 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "@salesforce/kit": "^3.0.15", "@salesforce/sf-plugins-core": "^7.1.1", "@salesforce/source-deploy-retrieve": "^10.2.10", - "@salesforce/source-tracking": "^5.1.3", + "@salesforce/source-tracking": "^5.1.4", "@salesforce/ts-types": "^2.0.9", "chalk": "^5.3.0" }, @@ -237,7 +237,7 @@ "output": [] }, "link-check": { - "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|my.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error", + "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|lib|test/|confluence.internal.salesforce.com|my.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error", "files": [ "./*.md", "./!(CHANGELOG).md", diff --git a/src/commands/project/retrieve/start.ts b/src/commands/project/retrieve/start.ts index 99374b56..d31518e4 100644 --- a/src/commands/project/retrieve/start.ts +++ b/src/commands/project/retrieve/start.ts @@ -359,6 +359,13 @@ const buildRetrieveAndDeleteTargets = async ( !flags['package-name']?.length; if (isChanges) { + if (!(await flags['target-org'].supportsSourceTracking())) { + throw new SfError( + messages.getMessage('noSourceTracking'), + 'noSourceTracking', + messages.getMessages('noSourceTracking.actions') + ); + } const stl = await SourceTracking.create({ org: flags['target-org'], project: await SfProject.resolve(), diff --git a/yarn.lock b/yarn.lock index 1ff15a68..560617aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1425,7 +1425,7 @@ read-package-json-fast "^3.0.0" which "^3.0.0" -"@oclif/core@^3.10.8", "@oclif/core@^3.11.0", "@oclif/core@^3.15.0", "@oclif/core@^3.15.1", "@oclif/core@^3.16.0", "@oclif/core@^3.18.1": +"@oclif/core@^3.11.0", "@oclif/core@^3.15.0", "@oclif/core@^3.15.1", "@oclif/core@^3.16.0", "@oclif/core@^3.18.1": version "3.18.1" resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.18.1.tgz#a8c9ee3848ad663d5694bef6079116c70d32fc55" integrity sha512-l0LsjzGcqjbUEdeSBX6bdZieVmEv82Q0W3StiyaDMEnPZ9KLH28HrLpcZg6d50mCYW9CUZNzmRo6qrCHWrgLKw== @@ -1651,7 +1651,7 @@ strip-ansi "6.0.1" ts-retry-promise "^0.7.1" -"@salesforce/core@^6.1.0", "@salesforce/core@^6.1.3", "@salesforce/core@^6.4.0", "@salesforce/core@^6.4.1", "@salesforce/core@^6.4.2", "@salesforce/core@^6.4.4", "@salesforce/core@^6.4.6": +"@salesforce/core@^6.1.0", "@salesforce/core@^6.1.3", "@salesforce/core@^6.4.0", "@salesforce/core@^6.4.1", "@salesforce/core@^6.4.2", "@salesforce/core@^6.4.4", "@salesforce/core@^6.4.6", "@salesforce/core@^6.4.7": version "6.4.7" resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-6.4.7.tgz#f15538380aa5c75de697d3c95a2ddbdabae69dbb" integrity sha512-gebjw2xC8Z0gqS3lYRQWz7J+PuGZtybotrnnaJbnzzxdfpBFIp6PjW4nt/235BQW9UWFTLaQh+AwkFgmMTTSkA== @@ -1787,12 +1787,12 @@ "@salesforce/ts-types" "^2.0.9" chalk "^5.3.0" -"@salesforce/source-deploy-retrieve@^10.0.0", "@salesforce/source-deploy-retrieve@^10.2.1", "@salesforce/source-deploy-retrieve@^10.2.10", "@salesforce/source-deploy-retrieve@^10.2.5": - version "10.2.10" - resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-10.2.10.tgz#76a70b534258bcddd4542a9709b1c2bfb1c93726" - integrity sha512-Io8JpYydSfdx7hgjYLj/5ZNIGKp3JZpcB/PVY+/uql6tFhGXcCSetyLbGnFdTw1lLlpN8RrYxexJG2PbhdoiYg== +"@salesforce/source-deploy-retrieve@^10.0.0", "@salesforce/source-deploy-retrieve@^10.2.10", "@salesforce/source-deploy-retrieve@^10.2.11", "@salesforce/source-deploy-retrieve@^10.2.5": + version "10.2.11" + resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-10.2.11.tgz#b3eaa75a1342d9dfbc8d84ff05d1a8ebf48b5241" + integrity sha512-XUoSn4I4Ki9m6rX/DaGpfM4PBu2TP/WSDszhlwvfktSO4XjLCqdI2B5KrGk/BQZ5KoxDQIhDp2G7rwgoyypJxw== dependencies: - "@salesforce/core" "^6.4.4" + "@salesforce/core" "^6.4.7" "@salesforce/kit" "^3.0.15" "@salesforce/ts-types" "^2.0.9" fast-levenshtein "^3.0.0" @@ -1822,15 +1822,15 @@ shelljs "^0.8.4" sinon "^10.0.0" -"@salesforce/source-tracking@^5.0.0", "@salesforce/source-tracking@^5.1.3": - version "5.1.3" - resolved "https://registry.yarnpkg.com/@salesforce/source-tracking/-/source-tracking-5.1.3.tgz#65dff11ffbd8f42ddd6477fe8342e338a9ec4f8f" - integrity sha512-X4lHQmpc62RQaW6CiRn4M7rYQ2cftE+bCBaMvTp/HGKq5k+DQIOVQmDU+xYBGiaenxTBXZdX2zwiuXmv3WGImg== +"@salesforce/source-tracking@^5.0.0", "@salesforce/source-tracking@^5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@salesforce/source-tracking/-/source-tracking-5.1.4.tgz#e7dbe46573fba154ab48b1fe4f04e13d653bf10c" + integrity sha512-VFxaR7457NjC/1r6MiVag7ES2A1Lg/O8oGmfYPeWgZ0FeEwmL++lxma5KxyE5rxcROqCXQYpXBSCPXfuOs05GQ== dependencies: - "@oclif/core" "^3.10.8" - "@salesforce/core" "^6.4.0" + "@oclif/core" "^3.18.1" + "@salesforce/core" "^6.4.7" "@salesforce/kit" "^3.0.15" - "@salesforce/source-deploy-retrieve" "^10.2.1" + "@salesforce/source-deploy-retrieve" "^10.2.11" "@salesforce/ts-types" "^2.0.9" fast-xml-parser "^4.2.5" graceful-fs "^4.2.11" From 7daafb44c20f8c0b082df41be7eafd3955367ca0 Mon Sep 17 00:00:00 2001 From: Cristian Dominguez Date: Tue, 16 Jan 2024 14:13:31 -0300 Subject: [PATCH 2/3] chore: revert link-check change --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e53e20ed..3adfb807 100644 --- a/package.json +++ b/package.json @@ -237,7 +237,7 @@ "output": [] }, "link-check": { - "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|lib|test/|confluence.internal.salesforce.com|my.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error", + "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|my.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error", "files": [ "./*.md", "./!(CHANGELOG).md", From 555fb97fd0a00bcff61303845244a5c6a75a7a11 Mon Sep 17 00:00:00 2001 From: Cristian Dominguez <6853656+cristiand391@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:33:14 -0300 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com> --- messages/retrieve.start.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/messages/retrieve.start.md b/messages/retrieve.start.md index 5ab509b3..dfcad166 100644 --- a/messages/retrieve.start.md +++ b/messages/retrieve.start.md @@ -195,11 +195,11 @@ Because you're retrieving one or more CustomFields, we're also retrieving the Cu # noSourceTracking -Unable to track changes in source. -This command expects the org to support source tracking, if it doesn't you need to specify the metadata to be retrieved. +Unable to track changes in your source files. +This command expects the org to support source tracking. If it doesn't, you must specify the metadata you want to retrieve. # noSourceTracking.actions -- Use `--source-dir`, `--manifest` or `--package-name` to retrieve in source format: +- Use the `--source-dir`, `--manifest` or `--package-name` flags to retrieve metadata in source format. -- Use `--target-metadata-dir` to retrieve in metadata format to a directory +- Use the `--target-metadata-dir` flag to retrieve metadata in metadata format to a directory.