Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sm/qa pr 900 new branch #911

Merged
merged 27 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4c34cc3
fix: use always forward slash for DEB and DE fullName
skesanthosh Mar 25, 2023
948c621
chore: auto-update metadata coverage in METADATA_SUPPORT.md
skesanthosh Mar 25, 2023
4450157
chore: fix tests for windows os
skesanthosh Mar 25, 2023
20a7751
chore: fix tests for windows os
skesanthosh Mar 25, 2023
56c01b2
Merge remote-tracking branch 'origin/main' into 900
mshanemc Mar 28, 2023
c59e7bd
test: run windows nuts on sdr
mshanemc Mar 28, 2023
7c9fa39
test: record perf
svc-cli-bot Mar 28, 2023
ea52ad5
test: use deb script
mshanemc Mar 28, 2023
fea199f
Merge branch 'sm/qa-pr-900' of https://github.com/forcedotcom/source-…
mshanemc Mar 28, 2023
e49ef94
test: record perf
svc-cli-bot Mar 28, 2023
fbeccc5
test: specialTypes and deb
mshanemc Mar 28, 2023
094fb7d
Merge branch 'sm/qa-pr-900' of https://github.com/forcedotcom/source-…
mshanemc Mar 28, 2023
e1af010
test: record perf
svc-cli-bot Mar 28, 2023
e741f19
chore: disable other nuts to test only deb
skesanthosh Mar 28, 2023
e933707
chore: run deb nuts only o windows
skesanthosh Mar 28, 2023
6ef26ea
test: empty
mshanemc Mar 28, 2023
ccf97b4
test: no cache for deb
mshanemc Mar 28, 2023
2c22fc6
chore: run deb nuts
skesanthosh Mar 28, 2023
33b39af
test: enable deb nuts
mshanemc Mar 28, 2023
2b002fd
test: record perf
svc-cli-bot Mar 28, 2023
fc2fd46
test: once more against the plugin-source branch since specialTypes n…
mshanemc Mar 28, 2023
5615b8e
test: record perf
svc-cli-bot Mar 28, 2023
5c5f40d
Merge branch 'main' into sm/qa-pr-900-new-branch
skesanthosh Mar 29, 2023
5673370
test: record perf
svc-cli-bot Mar 29, 2023
970476f
test: run deb nuts
skesanthosh Mar 29, 2023
5cc60db
test: run deb nuts
skesanthosh Mar 29, 2023
242dc0a
test: record perf
svc-cli-bot Mar 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
matrix:
command:
- 'yarn test:nuts:convert'
- 'yarn test:nuts:deb'
- 'yarn test:nuts:delete'
- 'yarn test:nuts:deploy:async'
- 'yarn test:nuts:deploy:destructive'
Expand All @@ -100,6 +101,7 @@ jobs:
postbuildCommands: 'cp src/registry/metadataRegistry.json lib/src/registry'
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/source-tracking/node_modules/@salesforce/source-deploy-retrieve'
os: ubuntu-latest
branch: sm/qa-771
secrets: inherit

# now run the rest of the nuts for each os via cached version of all the setup steps
Expand All @@ -111,6 +113,7 @@ jobs:
matrix:
command:
- 'yarn test:nuts:convert'
- 'yarn test:nuts:deb'
- 'yarn test:nuts:delete'
- 'yarn test:nuts:deploy:async'
- 'yarn test:nuts:deploy:destructive'
Expand All @@ -134,4 +137,5 @@ jobs:
postbuildCommands: 'cp src/registry/metadataRegistry.json lib/src/registry'
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/source-tracking/node_modules/@salesforce/source-deploy-retrieve'
os: windows-latest
branch: sm/qa-771
secrets: inherit
5 changes: 2 additions & 3 deletions src/resolve/adapters/digitalExperienceSourceAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class DigitalExperienceSourceAdapter extends BundleSourceAdapter {

private getBundleName(contentPath: string): string {
const bundlePath = this.getBundleMetadataXmlPath(contentPath);
return `${parentName(dirname(bundlePath))}${sep}${parentName(bundlePath)}`;
return `${parentName(dirname(bundlePath))}/${parentName(bundlePath)}`;
}

private getBundleMetadataXmlPath(path: string): string {
Expand All @@ -129,5 +129,4 @@ export class DigitalExperienceSourceAdapter extends BundleSourceAdapter {
* @param contentPath This hook is called only after trimPathToContent() is called. so this will always be a folder structure
* @returns name of type/apiName format
*/
const calculateNameFromPath = (contentPath: string): string =>
`${parentName(contentPath)}${sep}${baseName(contentPath)}`;
const calculateNameFromPath = (contentPath: string): string => `${parentName(contentPath)}/${baseName(contentPath)}`;
13 changes: 6 additions & 7 deletions test/collections/componentSet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,9 @@ describe('ComponentSet', () => {
type: digitalExperienceBundle.DEB_TYPE.id,
};

const debMetaFilePath = join('path', 'to', 'digitalExperiences', 'site', 'foo', 'foo.digitalExperience-meta.xml');
expect(set.getComponentFilenamesByNameAndType(deb)).to.have.members([debMetaFilePath]);
expect(set.getComponentFilenamesByNameAndType(deb)).to.have.members([
digitalExperienceBundle.BUNDLE_META_FILE_PATH,
]);
});

it('should correctly return DE (DigitalExperience) component file paths', () => {
Expand All @@ -1272,12 +1273,10 @@ describe('ComponentSet', () => {
type: digitalExperienceBundle.DE_TYPE.id,
};

const deViewHomePath = join('path', 'to', 'digitalExperiences', 'site', 'foo', 'sfdc_cms__view', 'home');

expect(set.getComponentFilenamesByNameAndType(de)).to.have.members([
join(deViewHomePath, 'content.json'),
join(deViewHomePath, 'fr.json'),
join(deViewHomePath, '_meta.json'),
join(digitalExperienceBundle.HOME_VIEW_PATH, 'content.json'),
join(digitalExperienceBundle.HOME_VIEW_PATH, 'fr.json'),
join(digitalExperienceBundle.HOME_VIEW_PATH, '_meta.json'),
]);
});
});
Expand Down
10 changes: 5 additions & 5 deletions test/mock/type-constants/digitalExperienceBundleConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { join } from 'path';
import { registry, SourceComponent } from '../../../src';
import { META_XML_SUFFIX } from '../../../src/common';

export const DE_TYPE = registry.types.digitalexperiencebundle.children.types.digitalexperience;
export const DEB_TYPE = registry.types.digitalexperiencebundle;
export const DE_TYPE = DEB_TYPE.children.types.digitalexperience;

// metaFileName = metaFileSuffix for DigitalExperience.
export const DE_METAFILE = DE_TYPE.metaFileSuffix;

export const BUNDLE_NAME = join('site', 'foo');
export const BUNDLE_NAME = 'site/foo';
export const BUNDLE_FULL_NAME = BUNDLE_NAME;
export const HOME_VIEW_NAME = join('sfdc_cms__view', 'home');
export const HOME_VIEW_NAME = 'sfdc_cms__view/home';
export const HOME_VIEW_FULL_NAME = `${BUNDLE_FULL_NAME}.${HOME_VIEW_NAME}`;

export const BUNDLE_META_FILE = `foo.${DEB_TYPE.suffix}${META_XML_SUFFIX}`;
Expand All @@ -25,9 +25,9 @@ export const HOME_VIEW_CONTENT_FILE = 'content.json';
export const HOME_VIEW_FRENCH_VARIANT_FILE = 'fr.json';

export const BASE_PATH = join('path', 'to', DEB_TYPE.directoryName);
export const BUNDLE_PATH = join(BASE_PATH, BUNDLE_NAME);
export const BUNDLE_PATH = join(BASE_PATH, 'site', 'foo');
export const BUNDLE_META_FILE_PATH = join(BUNDLE_PATH, BUNDLE_META_FILE);
export const HOME_VIEW_PATH = join(BUNDLE_PATH, HOME_VIEW_NAME);
export const HOME_VIEW_PATH = join(BUNDLE_PATH, 'sfdc_cms__view', 'home');
export const HOME_VIEW_CONTENT_FILE_PATH = join(HOME_VIEW_PATH, HOME_VIEW_CONTENT_FILE);
export const HOME_VIEW_FRENCH_VARIANT_FILE_PATH = join(HOME_VIEW_PATH, HOME_VIEW_FRENCH_VARIANT_FILE);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 221.1766770000104
"duration": 220.98211799998535
},
{
"name": "sourceToMdapi",
"duration": 6279.265217999986
"duration": 5883.410992000019
},
{
"name": "sourceToZip",
"duration": 4784.06782299999
"duration": 4195.635892999999
},
{
"name": "mdapiToSource",
"duration": 4182.580141999992
"duration": 4158.288854999992
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 458.3479590000061
"duration": 423.7058580000303
},
{
"name": "sourceToMdapi",
"duration": 9421.391817999975
"duration": 9075.414397999994
},
{
"name": "sourceToZip",
"duration": 6710.942861999996
"duration": 6641.056959000009
},
{
"name": "mdapiToSource",
"duration": 4806.480233000009
"duration": 4751.506416000018
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 753.9240889999783
"duration": 761.5197770000086
},
{
"name": "sourceToMdapi",
"duration": 11511.726317000022
"duration": 12648.731094999996
},
{
"name": "sourceToZip",
"duration": 10486.967529999965
"duration": 10670.394476999994
},
{
"name": "mdapiToSource",
"duration": 8522.32658199995
"duration": 8812.610347000009
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 207.436284000054
"duration": 208.37945000000764
},
{
"name": "sourceToMdapi",
"duration": 5423.031130000018
"duration": 5163.694585999998
},
{
"name": "sourceToZip",
"duration": 5202.063126999885
"duration": 4249.0233250000165
},
{
"name": "mdapiToSource",
"duration": 3417.4116909999866
"duration": 3356.330946000002
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 444.3853680000175
"duration": 408.6128360000148
},
{
"name": "sourceToMdapi",
"duration": 8262.888810999924
"duration": 7221.068067000015
},
{
"name": "sourceToZip",
"duration": 7476.526809000177
"duration": 5880.985977000004
},
{
"name": "mdapiToSource",
"duration": 4032.80767800007
"duration": 4112.393477000005
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 707.5937909998465
"duration": 707.7821399999957
},
{
"name": "sourceToMdapi",
"duration": 10896.007658000104
"duration": 9948.782891999988
},
{
"name": "sourceToZip",
"duration": 9609.415148
"duration": 9234.353405000002
},
{
"name": "mdapiToSource",
"duration": 6808.866952999961
"duration": 7288.00951600002
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import { DE_METAFILE } from '../../mock/type-constants/digitalExperienceBundleCo
describe('DigitalExperienceSourceAdapter', () => {
const BASE_PATH = join('path', 'to', registry.types.digitalexperiencebundle.directoryName);

const BUNDLE_NAME = join('site', 'foo');
const BUNDLE_PATH = join(BASE_PATH, BUNDLE_NAME);
const BUNDLE_NAME = 'site/foo';
const BUNDLE_PATH = join(BASE_PATH, 'site', 'foo');
const BUNDLE_META_FILE = join(BUNDLE_PATH, `foo.${registry.types.digitalexperiencebundle.suffix}${META_XML_SUFFIX}`);

const HOME_VIEW_NAME = join('sfdc_cms__view', 'home');
const HOME_VIEW_PATH = join(BUNDLE_PATH, HOME_VIEW_NAME);
const HOME_VIEW_NAME = 'sfdc_cms__view/home';
const HOME_VIEW_PATH = join(BUNDLE_PATH, 'sfdc_cms__view', 'home');
const HOME_VIEW_CONTENT_FILE = join(HOME_VIEW_PATH, 'content.json');
const HOME_VIEW_META_FILE = join(HOME_VIEW_PATH, DE_METAFILE);
const HOME_VIEW_FRENCH_VARIANT_FILE = join(HOME_VIEW_PATH, 'fr.json');
Expand Down
4 changes: 2 additions & 2 deletions test/resolve/metadataResolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ describe('MetadataResolver', () => {
const mdResolver = new MetadataResolver(undefined, treeContainer);
const parentComponent = new SourceComponent(
{
name: join('site', 'foo'),
name: 'site/foo',
type: registry.types.digitalexperiencebundle,
xml: parent_meta_file,
},
treeContainer
);
const expectedComponent = new SourceComponent(
{
name: join('sfdc_cms__view', 'home'),
name: 'sfdc_cms__view/home',
type: registry.types.digitalexperiencebundle.children.types.digitalexperience,
content: dirname(path),
parent: parentComponent,
Expand Down
4 changes: 2 additions & 2 deletions test/utils/filePathGenerator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const testData = {
expectedFilePaths: [getFilePath('digitalExperiences/site/foo/foo.digitalExperience-meta.xml')],
expectedComponents: [
{
name: path.join('site', 'foo'), // as defined in digitalExperienceSourceAdapter.calculateNameFromPath()
name: 'site/foo', // as defined in digitalExperienceSourceAdapter.getBundleName()
type: registryAccess.getTypeByName('DigitalExperienceBundle'),
xml: getFilePath('digitalExperiences/site/foo/foo.digitalExperience-meta.xml'),
},
Expand All @@ -199,7 +199,7 @@ const testData = {
expectedFilePaths: [getFilePath('digitalExperiences/site/foo/sfdc_cms__view/home/_meta.json')],
expectedComponents: [
{
name: path.join('sfdc_cms__view', 'home'), // as defined in digitalExperienceSourceAdapter.calculateNameFromPath()
name: 'sfdc_cms__view/home', // as defined in digitalExperienceSourceAdapter.calculateNameFromPath()
type: registryAccess.getTypeByName('DigitalExperience'),
},
],
Expand Down