Skip to content

Commit 95e7086

Browse files
committed
fix: address deploy/run PR review feedback
- Remove the datacustomcode binary check so init/scan work with only the SDK library installed; the retired console-script is no longer required (was throwing BinaryNotFound). Deletes DatacodeBinaryChecker and its dead keys. - Localize the configNotFound actions and render the real command (e.g. 'sf data-code-extension script init') instead of a literal '<type>'. - Guard htmlUnescape against RangeError on invalid code points, matching Python's html.unescape (leave the raw entity intact). - Reject non-HTTPS presigned upload URLs instead of allowing plaintext http. - Point the stale 'datacustomcode init' hint in nativeScan at the SF CLI command. - Keep the intentional COMPUTE_TYPES offset note in nativeDeploy.
1 parent f1c1d62 commit 95e7086

19 files changed

Lines changed: 52 additions & 434 deletions

messages/datacodeBinaryChecker.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

messages/deploy.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ Checking required Python packages...
5252

5353
Package '%s' version %s found
5454

55-
# info.checkingBinary
56-
57-
Checking datacustomcode binary...
58-
59-
# info.binaryFound
60-
61-
Datacustomcode binary version %s found
62-
6355
# info.authenticating
6456

6557
Authenticating with Salesforce org '%s'...
@@ -212,6 +204,11 @@ Function signature does not match a supported type. Use SearchIndexChunkingV1Req
212204

213205
config.json not found at %s.
214206

207+
# actions.configNotFound
208+
209+
- Run 'sf data-code-extension %s init' to scaffold the package.
210+
- Run 'sf data-code-extension %s scan' to populate config.json before deploying.
211+
215212
# error.configInvalidJson
216213

217214
config.json at %s is not valid JSON.
@@ -240,6 +237,10 @@ The deployment request returned no file upload URL. Verify the org has Data Clou
240237

241238
Failed to upload the deployment package (HTTP %s): %s
242239

240+
# error.insecureUploadUrl
241+
242+
The deployment upload URL must use HTTPS but a '%s' URL was returned. Refusing to upload the package over an insecure connection.
243+
243244
# error.deploymentTimedOut
244245

245246
Deployment timed out.

messages/init.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ Checking required Python packages...
4444

4545
Package '%s' version %s found
4646

47-
# info.checkingBinary
48-
49-
Checking datacustomcode binary...
50-
51-
# info.binaryFound
52-
53-
Datacustomcode binary version %s found
54-
5547
# info.executingInit
5648

5749
Initializing Data Cloud package...

messages/run.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ Checking required Python packages...
4646

4747
Package '%s' version %s found
4848

49-
# info.checkingBinary
50-
51-
Checking datacustomcode binary...
52-
53-
# info.binaryFound
54-
55-
Datacustomcode binary version %s found
56-
5749
# info.authenticating
5850

5951
Authenticating with Salesforce org '%s'...

messages/scan.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,3 @@ Checking required Python packages...
101101
# info.packageFound
102102

103103
Package '%s' version %s found
104-
105-
# info.checkingBinary
106-
107-
Checking datacustomcode binary...
108-
109-
# info.binaryFound
110-
111-
Datacustomcode binary version %s found

messages/zip.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ Checking required Python packages...
2828

2929
Package '%s' version %s found
3030

31-
# info.checkingBinary
32-
33-
Checking datacustomcode binary...
34-
35-
# info.binaryFound
36-
37-
Datacustomcode binary version %s found
38-
3931
# info.executingZip
4032

4133
Creating package archive...

src/base/initBase.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ export abstract class InitBase<TFlags extends BaseInitFlags = BaseInitFlags> ext
4040
const additionalFlags = this.getAdditionalFlags(flags);
4141

4242
try {
43-
const { pythonInfo, packageInfo, binaryInfo } = await checkEnvironment(
44-
this.spinner,
45-
this.log.bind(this),
46-
messages
47-
);
43+
const { pythonInfo, packageInfo } = await checkEnvironment(this.spinner, this.log.bind(this), messages);
4844

4945
this.spinner.start(messages.getMessage('info.executingInit'));
5046
const executionResult = await executeNativeInit({
@@ -66,7 +62,6 @@ export abstract class InitBase<TFlags extends BaseInitFlags = BaseInitFlags> ext
6662
success: true,
6763
pythonVersion: pythonInfo,
6864
packageInfo,
69-
binaryInfo,
7065
codeType,
7166
packageDir,
7267
executionResult,

src/base/runBase.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ export abstract class RunBase extends SfCommand<RunResult> {
5050

5151
try {
5252
// `run` invokes the SDK library (datacustomcode.run.run_entrypoint) through
53-
// Python, so it needs Python + the salesforce-data-customcode package but NOT
54-
// the datacustomcode console-script binary.
55-
const { pythonInfo, packageInfo } = await checkEnvironment(this.spinner, this.log.bind(this), messages, {
56-
checkBinary: false,
57-
});
53+
// Python, so it needs Python + the salesforce-data-customcode package.
54+
const { pythonInfo, packageInfo } = await checkEnvironment(this.spinner, this.log.bind(this), messages);
5855

5956
let orgUsername: string | undefined;
6057

src/base/scanBase.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ export abstract class ScanBase extends SfCommand<ScanResult> {
4646
const workingDir = process.cwd();
4747

4848
try {
49-
const { pythonInfo, packageInfo, binaryInfo } = await checkEnvironment(
50-
this.spinner,
51-
this.log.bind(this),
52-
messages
53-
);
49+
const { pythonInfo, packageInfo } = await checkEnvironment(this.spinner, this.log.bind(this), messages);
5450

5551
this.spinner.start(messages.getMessage('info.executingScan'));
5652
const executionResult = await executeNativeScan({
@@ -85,7 +81,6 @@ export abstract class ScanBase extends SfCommand<ScanResult> {
8581
success: true,
8682
pythonInfo,
8783
packageInfo,
88-
binaryInfo,
8984
codeType,
9085
workingDirectory: workingDir,
9186
executionResult,

src/base/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
*/
1616
import { type PythonVersionInfo } from '../utils/pythonChecker.js';
1717
import { type PipPackageInfo } from '../utils/pipChecker.js';
18-
import { type DatacodeBinaryInfo } from '../utils/datacodeBinaryChecker.js';
1918

2019
export type SharedResultProps = {
2120
success: boolean;
2221
/** Populated by commands that run the Python environment check (e.g. `run`); absent for `deploy`. */
2322
pythonVersion?: PythonVersionInfo;
2423
packageInfo?: PipPackageInfo;
25-
binaryInfo?: DatacodeBinaryInfo;
2624
codeType: 'script' | 'function';
2725
packageDir: string;
2826
message: string;

0 commit comments

Comments
 (0)