Skip to content

Commit

Permalink
Merge branch 'main' into sh/archiver-to-jszip-swap
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed May 22, 2023
2 parents e4a47c6 + c5a30dd commit 4824e4f
Show file tree
Hide file tree
Showing 9 changed files with 466 additions and 330 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/perfScaleNut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/setup-node@v3
with:
cache: yarn
- run: npm install -g sfdx-cli --omit=dev
- run: npm install -g @salesforce/cli --omit=dev
- run: yarn install
- run: yarn test:nuts:scale

Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## [8.5.3](https://github.com/forcedotcom/source-deploy-retrieve/compare/8.5.2...8.5.3) (2023-05-22)


### Bug Fixes

* bump core to latest ([#982](https://github.com/forcedotcom/source-deploy-retrieve/issues/982)) ([7a34fc0](https://github.com/forcedotcom/source-deploy-retrieve/commit/7a34fc0214cf6172383f3b5e54f4dbeda36066a3)), closes [#983](https://github.com/forcedotcom/source-deploy-retrieve/issues/983)



## [8.5.2](https://github.com/forcedotcom/source-deploy-retrieve/compare/8.5.1...8.5.2) (2023-05-21)


### Bug Fixes

* **deps:** bump unzipper from 0.10.11 to 0.10.14 ([#978](https://github.com/forcedotcom/source-deploy-retrieve/issues/978)) ([777f799](https://github.com/forcedotcom/source-deploy-retrieve/commit/777f799e2ebc63602f8695e8b59d9c5cbb795f51))



## [8.5.1](https://github.com/forcedotcom/source-deploy-retrieve/compare/8.5.0...8.5.1) (2023-05-17)


### Bug Fixes

* prevent [object Object] and provide component details ([#972](https://github.com/forcedotcom/source-deploy-retrieve/issues/972)) ([a16b9a2](https://github.com/forcedotcom/source-deploy-retrieve/commit/a16b9a256b7ff2eac99f466b11ba30312b09ab92))



# [8.5.0](https://github.com/forcedotcom/source-deploy-retrieve/compare/8.4.0...8.5.0) (2023-05-17)


### Features

* support for UserAccessPolicy ([#971](https://github.com/forcedotcom/source-deploy-retrieve/issues/971)) ([7a102b0](https://github.com/forcedotcom/source-deploy-retrieve/commit/7a102b0eb64c5ac5ecca9f55f2ce43a78f6763f6))



# [8.4.0](https://github.com/forcedotcom/source-deploy-retrieve/compare/8.3.1...8.4.0) (2023-05-09)


Expand Down
8 changes: 5 additions & 3 deletions METADATA_SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This list compares metadata types found in Salesforce v58 with the [metadata reg

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

Currently, there are 516/550 supported metadata types.
Currently, there are 516/549 supported metadata types.
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).
To contribute a new metadata type, please see the [Contributing Metadata Types to the Registry](./contributing/metadata.md)

Expand Down Expand Up @@ -246,7 +246,6 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|ExternalDocStorageConfig||Not supported, but support could be added|
|ExternalServiceRegistration|||
|ExtlClntAppGlobalOauthSettings|||
|ExtlClntAppMobileSettings|||
|ExtlClntAppOauthConfigurablePolicies|||
|ExtlClntAppOauthSettings|||
|FeatureParameterBoolean|||
Expand Down Expand Up @@ -519,7 +518,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|TrialOrgSettings|||
|UIObjectRelationConfig|||
|UiPlugin|||
|UserAccessPolicy||Not supported, but support could be added|
|UserAccessPolicy|||
|UserAuthCertificate|||
|UserCriteria|||
|UserEngagementSettings|||
Expand Down Expand Up @@ -568,6 +567,8 @@ v59 introduces the following new types. Here's their current level of support

|Metadata Type|Support|Notes|
|:---|:---|:---|
|FulfillmentStepType||Not supported, but support could be added|
|ProviderRelationshipMgmtConfig||Not supported, but support could be added|

## Additional Types

Expand Down Expand Up @@ -599,6 +600,7 @@ v59 introduces the following new types. Here's their current level of support
- MatchingRule
- MarketingResourceType
- ExtlClntAppMobileConfigurablePolicies
- ExtlClntAppMobileSettings
- CustomExperience
- ManagedTopic
- DataPipeline
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/source-deploy-retrieve",
"version": "8.4.0",
"version": "8.5.3",
"description": "JavaScript library to run Salesforce metadata deploys and retrieves",
"main": "lib/src/index.js",
"author": "Salesforce",
Expand All @@ -25,7 +25,7 @@
"node": ">=14.0.0"
},
"dependencies": {
"@salesforce/core": "^3.36.0",
"@salesforce/core": "^3.36.2",
"@salesforce/kit": "^1.9.2",
"@salesforce/ts-types": "^1.7.2",
"fast-levenshtein": "^3.0.0",
Expand All @@ -38,10 +38,10 @@
"minimatch": "^5.1.6",
"proxy-agent": "^5.0.0",
"proxy-from-env": "^1.1.0",
"unzipper": "0.10.11"
"unzipper": "0.10.14"
},
"devDependencies": {
"@salesforce/cli-plugins-testkit": "^3.3.3",
"@salesforce/cli-plugins-testkit": "^3.4.0",
"@salesforce/dev-config": "^3.1.0",
"@salesforce/dev-scripts": "^4.3.0",
"@salesforce/prettier-config": "^0.0.2",
Expand All @@ -60,7 +60,7 @@
"chai": "^4.3.7",
"deep-equal-in-any-order": "^1.1.19",
"deepmerge": "^4.3.1",
"eslint": "^8.40.0",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.7.0",
"eslint-config-salesforce": "^1.2.0",
"eslint-config-salesforce-license": "^0.2.0",
Expand Down
24 changes: 14 additions & 10 deletions src/client/diagnosticUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ export class DiagnosticUtil {
if (typeof message !== 'string') {
return parseDefault(component, message);
}
throw new SfError(`Unable to parse deploy diagnostic with string message: ${message}`);
throw new SfError(
`Unable to parse deploy diagnostic with string message: ${message} for component ${component.fullName}`
);
}
}

private parseLwc(component: SourceComponent, message: string | DeployMessage): ComponentDiagnostic {
const problem = getProblemFromMessage(message);
const problem = getProblemFromMessage(message, component);
const diagnostic: ComponentDiagnostic = {
error: problem,
problemType: 'Error',
Expand Down Expand Up @@ -77,7 +79,7 @@ export class DiagnosticUtil {
}

private parseAura(component: SourceComponent, message: string | DeployMessage): ComponentDiagnostic {
const problem = getProblemFromMessage(message);
const problem = getProblemFromMessage(message, component);
const diagnostic: ComponentDiagnostic = {
error: problem,
problemType: 'Error',
Expand Down Expand Up @@ -122,13 +124,11 @@ const appendErrorWithLocation = (error: string, line: string | number, column: s

const parseDefault = (component: SourceComponent, message: DeployMessage): ComponentDiagnostic => {
const { problemType, fileName, lineNumber, columnNumber } = message;
const problem = getProblemFromMessage(message);
if (!problemType) {
throw new SfError(`Unable to parse deploy diagnostic with empty problem type: ${message.toString()}`);
}
const problem = getProblemFromMessage(message, component);

const diagnostic: ComponentDiagnostic = {
error: problem,
problemType,
problemType: problemType ?? 'Error',
};

if (fileName) {
Expand All @@ -145,10 +145,14 @@ const parseDefault = (component: SourceComponent, message: DeployMessage): Compo
return diagnostic;
};

const getProblemFromMessage = (message: string | DeployMessage): string => {
const getProblemFromMessage = (message: string | DeployMessage, component: SourceComponent): string => {
const problem = typeof message === 'string' ? message : message.problem;
if (!problem) {
throw new SfError(`Unable to parse deploy diagnostic with empty problem: ${message.toString()}`);
throw new SfError(
`Unable to parse deploy diagnostic with empty problem: ${JSON.stringify(message)} for component ${
component.fullName
}`
);
}
return problem;
};
11 changes: 10 additions & 1 deletion src/registry/metadataRegistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -3452,6 +3452,14 @@
"aiScoringModelDefVersions": "aiscoringmodeldefversion"
}
}
},
"useraccesspolicy": {
"id": "useraccesspolicy",
"name": "UserAccessPolicy",
"suffix": "useraccesspolicy",
"directoryName": "useraccesspolicies",
"inFolder": false,
"strictDirectoryName": false
}
},
"suffixes": {
Expand Down Expand Up @@ -3829,7 +3837,8 @@
"locationUse": "locationuse",
"personAccountOwnerPowerUser": "personaccountownerpoweruser",
"pipelineInspMetricConfig": "pipelineinspmetricconfig",
"productSpecificationTypeDefinition": "productspecificationtypedefinition"
"productSpecificationTypeDefinition": "productspecificationtypedefinition",
"useraccesspolicy": "useraccesspolicy"
},
"strictDirectoryNames": {
"experiences": "experiencebundle",
Expand Down
17 changes: 16 additions & 1 deletion src/registry/nonSupportedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const features = [
'BOTBLOCKS',
'INDUSTRIESINTERACTIONCALCULATION',
'BUSINESSRULESENGINE',

'FUNDRAISING',
'PARDOTADVANCED', // org:create throws a C-9999 when this is not excluded
];

Expand Down Expand Up @@ -76,8 +76,23 @@ export const metadataTypes = [
// spun up with HIGHSCALEORDERS, not in describe
'RegisteredExternalService',

// spun up org with ASSESSMENTS, not in describe
'AssessmentConfiguration',

// spun up org with INDUSTRIESEPCNEXTPILOT, not in describe
'ProductAttrDisplayConfig',
'ProductSpecificationRecType',
'ProductSpecificationType',

// spun up org with ASSOCIATIONENGINE, not in describe
'RecAlrtDataSrcExpSetDef',
'RecordAlertTemplate',

// B2CLOYALTYMANAGEMENTPLUS, not in describe
'ServiceProcess',

// does not show up in describe, but requires no features
'ProcessFlowMigration',
];

export const hasUnsupportedFeatures = (type: CoverageObjectType): boolean => {
Expand Down
16 changes: 15 additions & 1 deletion test/client/diagnosticUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { join } from 'path';
import { expect } from 'chai';
import { assert, expect } from 'chai';
import { SfError } from '@salesforce/core';
import { DiagnosticUtil } from '../../src/client/diagnosticUtil';
import { DeployMessage, registry, SourceComponent } from '../../src';

Expand Down Expand Up @@ -53,6 +54,19 @@ describe('DiagnosticUtil', () => {
});
});

it('should throw friendly error for message with missing problem', () => {
const message = createDeployMessage({
problemType: 'Warning',
});
try {
util.parseDeployDiagnostic(component, message);
} catch (e) {
assert(e instanceof SfError);
expect(e.message).to.include('Unable to parse deploy diagnostic with empty problem');
expect(e.message).to.include(JSON.stringify(message));
}
});

it('should create diagnostic for problem with file line and column info', () => {
const message = createDeployMessage({
problem: 'Expected a ;',
Expand Down

2 comments on commit 4824e4f

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 4824e4f Previous: c9f250e Ratio
eda-componentSetCreate-linux 209 ms 223 ms 0.94
eda-sourceToMdapi-linux 6142 ms 6203 ms 0.99
eda-sourceToZip-linux 4898 ms 4320 ms 1.13
eda-mdapiToSource-linux 3795 ms 4238 ms 0.90
lotsOfClasses-componentSetCreate-linux 448 ms 461 ms 0.97
lotsOfClasses-sourceToMdapi-linux 8766 ms 8038 ms 1.09
lotsOfClasses-sourceToZip-linux 6893 ms 6736 ms 1.02
lotsOfClasses-mdapiToSource-linux 4061 ms 4917 ms 0.83
lotsOfClassesOneDir-componentSetCreate-linux 706 ms 756 ms 0.93
lotsOfClassesOneDir-sourceToMdapi-linux 11296 ms 14629 ms 0.77
lotsOfClassesOneDir-sourceToZip-linux 10844 ms 10402 ms 1.04
lotsOfClassesOneDir-mdapiToSource-linux 6978 ms 9099 ms 0.77

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 4824e4f Previous: c9f250e Ratio
eda-componentSetCreate-win32 625 ms 446 ms 1.40
eda-sourceToMdapi-win32 11388 ms 9300 ms 1.22
eda-sourceToZip-win32 7294 ms 6357 ms 1.15
eda-mdapiToSource-win32 11101 ms 8999 ms 1.23
lotsOfClasses-componentSetCreate-win32 1501 ms 918 ms 1.64
lotsOfClasses-sourceToMdapi-win32 16602 ms 12779 ms 1.30
lotsOfClasses-sourceToZip-win32 11108 ms 8500 ms 1.31
lotsOfClasses-mdapiToSource-win32 13070 ms 10475 ms 1.25
lotsOfClassesOneDir-componentSetCreate-win32 2583 ms 1654 ms 1.56
lotsOfClassesOneDir-sourceToMdapi-win32 26116 ms 21827 ms 1.20
lotsOfClassesOneDir-sourceToZip-win32 18128 ms 13748 ms 1.32
lotsOfClassesOneDir-mdapiToSource-win32 23427 ms 18634 ms 1.26

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.