Skip to content

Commit

Permalink
feat: metadata script updates and dev-scripts
Browse files Browse the repository at this point in the history
* chore: print API version when updating registry

* chore: throw friendly error if no devhub is found

* chore: skip org msg if no features are set

* feat: add support for ActionLauncherItemDef metadata type [skip-ci]

* chore: auto-update metadata coverage in METADATA_SUPPORT.md [skip ci]

* chore: bump dev-scripts

* chore: auto-update metadata coverage in METADATA_SUPPORT.md

* test: record perf

---------

Co-authored-by: mshanemc <shane.mclaughlin@salesforce.com>
Co-authored-by: svc-cli-bot <svc_cli_bot@salesforce.com>
  • Loading branch information
3 people authored Feb 1, 2023
1 parent 53b194f commit 1b777de
Show file tree
Hide file tree
Showing 9 changed files with 455 additions and 1,078 deletions.
1,010 changes: 211 additions & 799 deletions CHANGELOG.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions METADATA_SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,10 @@ v58 introduces the following new types. Here's their current level of support
|Metadata Type|Support|Notes|
|:---|:---|:---|
|Ai4mSettings|||
|DataTypeToDisplayType||Not supported, but support could be added|
|DataWeaveResource|||
|OmniChannelPricingSettings|||
|PriceSheetDefinition||Not supported, but support could be added|
|ProcessFlowMigration||Not supported, but support could be added|

## Additional Types

Expand Down Expand Up @@ -607,4 +609,3 @@ v58 introduces the following new types. Here's their current level of support
- InternalOrganization
- UiViewDefinition
- MobileSecurityPolicySet
- DataWeaveResource
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"devDependencies": {
"@salesforce/cli-plugins-testkit": "^3.2.16",
"@salesforce/dev-config": "^3.0.1",
"@salesforce/dev-scripts": "^3.1.0",
"@salesforce/dev-scripts": "^3.1.1",
"@salesforce/prettier-config": "^0.0.2",
"@salesforce/ts-sinon": "^1.4.2",
"@types/archiver": "^5.3.1",
Expand Down Expand Up @@ -114,4 +114,4 @@
"yarn": "1.22.4"
},
"config": {}
}
}
19 changes: 18 additions & 1 deletion scripts/update-registry/update2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ interface DescribeResult {
// get the coverage report
(async () => {
const currentApiVersion = await getCurrentApiVersion();
console.log(`Using API version: ${currentApiVersion}`);

const metadataCoverage = await getCoverage(currentApiVersion);
console.log(
`CoverageReport shows ${Object.keys(metadataCoverage.types).length} items in the metadata coverage report`
Expand All @@ -49,6 +51,19 @@ interface DescribeResult {
updateProjectScratchDef(missingTypes);
// TODO: sourceApi has to match the coverage report
if (!process.env.RB_EXISTING_ORG) {
const hasDefaultDevHub = Boolean(
JSON.parse(shelljs.exec('sfdx config:get defaultdevhubusername --json', { silent: true }).stdout).result[0].value
);

if (!hasDefaultDevHub) {
console.log(`
Failed to create scratch org: default Dev Hub not found.
To create the scratch org you need to set a default Dev Hub with \`sfdx\`.
Example: \`sfdx config:set defaultdevhubusername=<devhub-username> --global\`
`);
exit(1);
}

shelljs.exec('sfdx force:org:create -f registryBuilder/config/project-scratch-def.json -d 1 -a registryBuilder');
}
// describe the org
Expand Down Expand Up @@ -114,5 +129,7 @@ const updateProjectScratchDef = (missingTypes: [string, CoverageObjectType][]) =
scratchDefSummary.features = [...new Set(scratchDefSummary.features)];
const jsonData = JSON.stringify({ edition: 'developer', ...scratchDefSummary });
fs.writeFileSync('./registryBuilder/config/project-scratch-def.json', jsonData);
console.log(`Creating org with features ${scratchDefSummary.features.join(',')}`);
if (scratchDefSummary.features.length > 0) {
console.log(`Creating org with features ${scratchDefSummary.features.join(',')}`);
}
};
2 changes: 1 addition & 1 deletion src/registry/metadataRegistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -3816,4 +3816,4 @@
"decisionmatrixdefinitionversion": "decisionmatrixdefinition",
"expressionsetdefinitionversion": "expressionsetdefinition"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 338.2604289999872
"duration": 337.5220079999999
},
{
"name": "sourceToMdapi",
"duration": 10037.080420000013
"duration": 7736.946278000018
},
{
"name": "sourceToZip",
"duration": 6153.247639999987
"duration": 6700.4404600000125
},
{
"name": "mdapiToSource",
"duration": 5962.892909999995
"duration": 5970.132784999994
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 650.104994000023
"duration": 662.4489630000025
},
{
"name": "sourceToMdapi",
"duration": 10624.100027000008
"duration": 11665.150204000005
},
{
"name": "sourceToZip",
"duration": 9675.212842999987
"duration": 10208.353223999991
},
{
"name": "mdapiToSource",
"duration": 7507.290072000003
"duration": 7473.582662000001
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 1056.6362640000007
"duration": 1158.1638160000439
},
{
"name": "sourceToMdapi",
"duration": 17650.56812000001
"duration": 17111.19612400001
},
{
"name": "sourceToZip",
"duration": 15290.788772999978
"duration": 14803.339584000001
},
{
"name": "mdapiToSource",
"duration": 12925.659993000008
"duration": 13311.371785000025
}
]
Loading

0 comments on commit 1b777de

Please sign in to comment.