Skip to content

Commit 4deb66b

Browse files
authored
Merge pull request #2 from forcedotcom/main
Pulling changes from main
2 parents 393506c + f53efc2 commit 4deb66b

File tree

9 files changed

+123
-17
lines changed

9 files changed

+123
-17
lines changed

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
## [12.27.2](https://github.com/forcedotcom/source-deploy-retrieve/compare/12.27.1...12.27.2) (2025-11-12)
2+
3+
4+
### Bug Fixes
5+
6+
* add support for `DataObjectSearchIndexConf` metadata ([#1649](https://github.com/forcedotcom/source-deploy-retrieve/issues/1649)) ([46a3b00](https://github.com/forcedotcom/source-deploy-retrieve/commit/46a3b00b45c833728ebba6d734e975fd73f610c1))
7+
8+
9+
10+
## [12.27.1](https://github.com/forcedotcom/source-deploy-retrieve/compare/12.27.0...12.27.1) (2025-11-11)
11+
12+
13+
### Bug Fixes
14+
15+
* add support for `LightningOutApp` metadata ([#1648](https://github.com/forcedotcom/source-deploy-retrieve/issues/1648)) ([bdc1fb0](https://github.com/forcedotcom/source-deploy-retrieve/commit/bdc1fb057c5ce5a325c296fb4a0999e3ced26b55))
16+
17+
18+
19+
# [12.27.0](https://github.com/forcedotcom/source-deploy-retrieve/compare/12.26.1...12.27.0) (2025-11-11)
20+
21+
22+
### Features
23+
24+
* added RunRelevantTests test-level @W-20152151@ ([#1644](https://github.com/forcedotcom/source-deploy-retrieve/issues/1644)) ([96a176f](https://github.com/forcedotcom/source-deploy-retrieve/commit/96a176f7bc28d3671a9f50a89079373ffe1fcea9))
25+
26+
27+
28+
## [12.26.1](https://github.com/forcedotcom/source-deploy-retrieve/compare/12.26.0...12.26.1) (2025-11-11)
29+
30+
31+
### Bug Fixes
32+
33+
* web support without cwd W-20175875 ([#1647](https://github.com/forcedotcom/source-deploy-retrieve/issues/1647)) ([6dd7c70](https://github.com/forcedotcom/source-deploy-retrieve/commit/6dd7c708defdd064ac34ba77d154cc91ab2cee2b))
34+
35+
36+
137
# [12.26.0](https://github.com/forcedotcom/source-deploy-retrieve/compare/12.25.0...12.26.0) (2025-11-07)
238

339

METADATA_SUPPORT.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This list compares metadata types found in Salesforce v65 with the [metadata reg
44

55
This repository is used by both the Salesforce CLIs and Salesforce's VSCode Extensions.
66

7-
Currently, there are 675/719 supported metadata types.
7+
Currently, there are 678/719 supported metadata types.
88
For status on any existing gaps, please search or file an issue in the [Salesforce CLI issues only repo](https://github.com/forcedotcom/cli/issues).
99
To contribute a new metadata type, please see the [Contributing Metadata Types to the Registry](./contributing/metadata.md)
1010

@@ -45,6 +45,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
4545
|AgentforceAccountManagementSettings|||
4646
|AgentforceForDevelopersSettings|||
4747
|Ai4mSettings|||
48+
|AiAuthoringBundle|||
4849
|AiEvaluationDefinition|⚠️|Supports deploy/retrieve but not source tracking|
4950
|AiPlannerVoiceDef||Not supported, but support could be added (but not for tracking)|
5051
|AnalyticSnapshot|||
@@ -207,7 +208,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
207208
|DataKitObjectDependency|||
208209
|DataKitObjectTemplate|||
209210
|DataObjectBuildOrgTemplate|||
210-
|DataObjectSearchIndexConf||Not supported, but support could be added (but not for tracking)|
211+
|DataObjectSearchIndexConf|⚠️|Supports deploy/retrieve but not source tracking|
211212
|DataPackageKitDefinition|||
212213
|DataPackageKitObject|||
213214
|DataSource|||
@@ -437,7 +438,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
437438
|LightningExperienceTheme|||
438439
|LightningMessageChannel|||
439440
|LightningOnboardingConfig|||
440-
|LightningOutApp||Not supported, but support could be added|
441+
|LightningOutApp|||
441442
|LightningTypeBundle|||
442443
|ListView|||
443444
|LiveAgentSettings|||
@@ -715,7 +716,6 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
715716
|WebStoreBundle|||
716717
|WebStoreTemplate|||
717718
|WebToXSettings|||
718-
|WelcomeRecommendation||Not supported, but support could be added|
719719
|WorkDotComSettings|||
720720
|WorkSkillRouting|||
721721
|Workflow|||
@@ -750,8 +750,8 @@ v66 introduces the following new types. Here's their current level of support
750750
|DynamicGanttSettings|||
751751
|EmergencySettings|||
752752
|ExtlClntAppAttestSettings|||
753-
|GENComputingSummaryDEF||Not supported, but support could be added|
754753
|GRCIntelligenceUddSettings|||
754+
|GenComputingSummaryDef||Not supported, but support could be added|
755755
|GeneralConfigSettings|||
756756
|GeocodeSettings|||
757757
|GiftEntryGridTemplate|||
@@ -774,6 +774,7 @@ v66 introduces the following new types. Here's their current level of support
774774
|StockRotationSettings|||
775775
|SynchronizeSettings|||
776776
|TriggerConfigurationsSettings|||
777+
|UnifiedSalesIntelligenceSettings|||
777778

778779
## Additional Types
779780

@@ -786,7 +787,6 @@ v66 introduces the following new types. Here's their current level of support
786787
787788
- AccessControlPolicy
788789
- AIAssistantTemplate
789-
- AiAuthoringBundle
790790
- AssignmentRule
791791
- AssistantRecommendationType
792792
- AutoResponseRule

messages/sdr.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Could not find parent type for %s (%s)
2222

2323
Component conversion failed: %s
2424

25+
# error_invalid_test_level
26+
27+
TestLevel cannot be '%s' unless API version is %s or later
28+
2529
# error_merge_metadata_target_unsupported
2630

2731
Merge convert for metadata target format currently unsupported

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@salesforce/source-deploy-retrieve",
3-
"version": "12.26.0",
3+
"version": "12.27.2",
44
"description": "JavaScript library to run Salesforce metadata deploys and retrieves",
55
"main": "lib/src/index.js",
66
"author": "Salesforce",

src/client/metadataApiDeploy.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export class MetadataApiDeploy extends MetadataTransfer<
116116
public constructor(options: MetadataApiDeployOptions) {
117117
super(options);
118118
options.apiOptions = { ...MetadataApiDeploy.DEFAULT_OPTIONS.apiOptions, ...options.apiOptions };
119+
validateOptions(options);
119120
this.options = Object.assign({}, options);
120121
this.isRestDeploy = !!options.apiOptions?.rest;
121122
this.registry = options.registry ?? new RegistryAccess();
@@ -524,6 +525,17 @@ const buildFileResponsesFromComponentSet =
524525
}
525526
return fileResponses;
526527
};
528+
529+
const validateOptions = (options: MetadataApiDeployOptions): void => {
530+
const runningRelevantTestsOnly = options.apiOptions?.testLevel === 'RunRelevantTests';
531+
const beforeApiV66 = options.apiVersion && Number(options.apiVersion) < 66.0;
532+
if (runningRelevantTestsOnly && beforeApiV66) {
533+
throw new SfError(
534+
messages.getMessage('error_invalid_test_level', ['RunRelevantTests', '66.0']),
535+
'InvalidTestLevelSelection'
536+
);
537+
}
538+
};
527539
/**
528540
* register a listener to `scopedPreDeploy`
529541
*/

src/client/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export type MetadataApiDeployOptions = {
364364
runAllTests?: boolean;
365365
runTests?: string[];
366366
singlePackage?: boolean;
367-
testLevel?: 'NoTestRun' | 'RunSpecifiedTests' | 'RunLocalTests' | 'RunAllTestsInOrg';
367+
testLevel?: 'NoTestRun' | 'RunSpecifiedTests' | 'RunLocalTests' | 'RunAllTestsInOrg' | 'RunRelevantTests';
368368
/**
369369
* Set to true to use the REST API for deploying.
370370
*/

src/registry/metadataRegistry.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,9 @@
566566
"dataMapperDefinition": "datamapperdefinition",
567567
"integrationProcdDefinition": "integrationprocddefinition",
568568
"omniscriptDefinition": "omniscriptdefinition",
569-
"computeExtension": "computeextension"
569+
"computeExtension": "computeextension",
570+
"dataObjectSearchIndexConf": "dataobjectsearchindexconf",
571+
"lightningOutApp": "lightningoutapp"
570572
},
571573
"types": {
572574
"accesscontrolpolicy": {
@@ -5051,6 +5053,22 @@
50515053
"directoryName": "computeExtensions",
50525054
"inFolder": false,
50535055
"strictDirectoryName": false
5056+
},
5057+
"dataobjectsearchindexconf": {
5058+
"id": "dataobjectsearchindexconf",
5059+
"name": "DataObjectSearchIndexConf",
5060+
"suffix": "dataObjectSearchIndexConf",
5061+
"directoryName": "dataObjectSearchIndexConfs",
5062+
"inFolder": false,
5063+
"strictDirectoryName": false
5064+
},
5065+
"lightningoutapp": {
5066+
"id": "lightningoutapp",
5067+
"name": "LightningOutApp",
5068+
"suffix": "lightningOutApp",
5069+
"directoryName": "lightningOutApp",
5070+
"inFolder": false,
5071+
"strictDirectoryName": false
50545072
}
50555073
}
50565074
}

src/resolve/treeContainers.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ const messages = Messages.loadMessages('@salesforce/source-deploy-retrieve', 'sd
3636
* Extend this base class to implement a custom container.
3737
*/
3838
export abstract class TreeContainer {
39+
protected cwd?: string;
40+
41+
/** specify a cwd to use instead of the real cwd. Useful for tests and web environments where process.cwd is undefined */
42+
public constructor(cwd?: string) {
43+
this.cwd = cwd;
44+
}
3945
/**
4046
* Searches for a metadata component file in a container directory.
4147
*
@@ -46,14 +52,20 @@ export abstract class TreeContainer {
4652
*/
4753
public find(fileType: 'content' | 'metadataXml', name: string, directory: string): string | undefined {
4854
const fileName = this.readDirectory(directory).find((entry) => {
49-
const parsed = parseMetadataXml(join(directory, entry));
55+
const parsed = parseMetadataXml(this.getUpdatedFsPath(join(directory, entry)));
5056
const metaXmlCondition = fileType === 'metadataXml' ? !!parsed : !parsed;
5157
return baseName(entry) === name && metaXmlCondition;
5258
});
5359
if (fileName) {
54-
return join(directory, fileName);
60+
return this.getUpdatedFsPath(join(directory, fileName));
5561
}
5662
}
63+
64+
/** if the container has cwd set, apply it to the path */
65+
protected getUpdatedFsPath(fsPath: SourcePath): string {
66+
return this.cwd ? join(this.cwd, fsPath) : fsPath;
67+
}
68+
5769
/**
5870
* Whether or not a file path exists in the container.
5971
*
@@ -104,31 +116,31 @@ export abstract class TreeContainer {
104116
export class NodeFSTreeContainer extends TreeContainer {
105117
public isDirectory(fsPath: SourcePath): boolean {
106118
// use stat instead of lstat to follow symlinks
107-
return statSync(fsPath).isDirectory();
119+
return statSync(this.getUpdatedFsPath(fsPath)).isDirectory();
108120
}
109121

110122
public exists(fsPath: SourcePath): boolean {
111-
return existsSync(fsPath);
123+
return existsSync(this.getUpdatedFsPath(fsPath));
112124
}
113125

114126
public readDirectory(fsPath: SourcePath): string[] {
115-
return readdirSync(fsPath);
127+
return readdirSync(this.getUpdatedFsPath(fsPath));
116128
}
117129

118130
public readFile(fsPath: SourcePath): Promise<Buffer> {
119131
// significant enough performance increase using sync instead of fs.promise version
120-
return Promise.resolve(readFileSync(fsPath));
132+
return Promise.resolve(readFileSync(this.getUpdatedFsPath(fsPath)));
121133
}
122134

123135
public readFileSync(fsPath: SourcePath): Buffer {
124-
return readFileSync(fsPath);
136+
return readFileSync(this.getUpdatedFsPath(fsPath));
125137
}
126138

127139
public stream(fsPath: SourcePath): Readable {
128140
if (!this.exists(fsPath)) {
129141
throw new Error(`File not found: ${fsPath}`);
130142
}
131-
return createReadStream(fsPath);
143+
return createReadStream(this.getUpdatedFsPath(fsPath));
132144
}
133145
}
134146

test/client/metadataApiDeploy.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,30 @@ describe('MetadataApiDeploy', () => {
13071307
expect(mdOpts.zipPath).to.equal('foo/myZip.zip');
13081308
});
13091309

1310+
it('should disallow "RunRelevantTests" for API versions <66.0', () => {
1311+
const testCases = ['8.0', '10.0', '60.0', '65.0'];
1312+
const constructorError = {
1313+
name: 'InvalidTestLevelSelection',
1314+
message: messages.getMessage('error_invalid_test_level', ['RunRelevantTests', '66.0']),
1315+
};
1316+
try {
1317+
testCases.forEach((v) => {
1318+
new MetadataApiDeploy({
1319+
usernameOrConnection: 'testing',
1320+
apiOptions: {
1321+
testLevel: 'RunRelevantTests',
1322+
},
1323+
apiVersion: v,
1324+
});
1325+
assert.fail(`Should have thrown an error for API version ${v}`);
1326+
});
1327+
} catch (e) {
1328+
assert(e instanceof Error);
1329+
expect(e.name).to.equal(constructorError.name);
1330+
expect(e.message).to.equal(constructorError.message);
1331+
}
1332+
});
1333+
13101334
it('should allow mdapi path', () => {
13111335
const mdApiDeploy = new MetadataApiDeploy({
13121336
usernameOrConnection: 'testing',

0 commit comments

Comments
 (0)