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/retry-more-mdpai-errors #792

Merged
merged 3 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
61 changes: 30 additions & 31 deletions METADATA_SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Supported CLI Metadata Types

This list compares metadata types found in Salesforce v56 with the [metadata registry file](./src/registry/metadataRegistry.json) included in this repository.
This list compares metadata types found in Salesforce v57 with the [metadata registry file](./src/registry/metadataRegistry.json) included in this repository.

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

Currently, there are 482/511 supported metadata types.
Currently, there are 495/534 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 All @@ -23,8 +23,10 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|AccountingModelConfig|❌|Not supported, but support could be added|
|AccountingSettings|✅||
|AcctMgrTargetSettings|✅||
|ActionLauncherItemDef|❌|Not supported, but support could be added|
|ActionLinkGroupTemplate|✅||
|ActionPlanTemplate|✅||
|ActionableListDefinition|❌|Not supported, but support could be added|
|ActionsSettings|✅||
|ActivationPlatform|✅||
|ActivitiesSettings|✅||
Expand All @@ -44,6 +46,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|ApexTrigger|✅||
|AppAnalyticsSettings|✅||
|AppExperienceSettings|✅||
|AppExplorationDataConsent|❌|Not supported, but support could be added|
|AppMenu|✅||
|ApplicationRecordTypeConfig|✅||
|ApplicationSubtypeDefinition|✅||
Expand Down Expand Up @@ -106,6 +109,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|ChatterEmailsMDSettings|✅||
|ChatterExtension|✅||
|ChatterSettings|✅||
|ClauseCatgConfiguration|✅||
|CleanDataService|✅||
|CollectionsDashboardSettings|✅||
|CommandAction|✅||
Expand Down Expand Up @@ -169,9 +173,12 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|DelegateGroup|✅||
|DeploymentSettings|✅||
|DevHubSettings|✅||
|DigitalExperience|⚠️|Supports deploy/retrieve but not source tracking|
|DigitalExperienceBundle|⚠️|Supports deploy/retrieve but not source tracking|
|DigitalExperienceConfig|⚠️|Supports deploy/retrieve but not source tracking|
|DigitalExperience|✅||
|DigitalExperienceBundle|✅||
|DigitalExperienceConfig|✅||
|DisclosureDefinition|✅||
|DisclosureDefinitionVersion|✅||
|DisclosureType|✅||
|DiscoveryAIModel|✅||
|DiscoveryGoal|✅||
|DiscoverySettings|✅||
Expand Down Expand Up @@ -222,13 +229,19 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|ExpressionSetDefinitionVersion|✅||
|ExpressionSetObjectAlias|❌|Not supported, but support could be added|
|ExternalAIModel|❌|Not supported, but support could be added|
|ExternalClientAppSettings|✅||
|ExternalClientApplication|✅||
|ExternalCredential|✅||
|ExternalDataConnector|✅||
|ExternalDataSource|✅||
|ExternalDataSrcDescriptor|❌|Not supported, but support could be added|
|ExternalDataTranField|❌|Not supported, but support could be added|
|ExternalDataTranObject|❌|Not supported, but support could be added|
|ExternalServiceRegistration|✅||
|ExtlClntAppMobileConfigurablePolicies|✅||
|ExtlClntAppMobileSettings|✅||
|ExtlClntAppOauthConfigurablePolicies|✅||
|ExtlClntAppOauthSettings|✅||
|FeatureParameterBoolean|✅||
|FeatureParameterDate|✅||
|FeatureParameterInteger|✅||
Expand Down Expand Up @@ -267,6 +280,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|IPAddressRange|✅||
|Icon|✅||
|IdeasSettings|✅||
|IdentityProviderSettings|✅||
|IdentityVerificationProcDef|✅||
|IframeWhiteListUrlSettings|✅||
|InboundCertificate|✅||
Expand All @@ -279,6 +293,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|IndustriesManufacturingSettings|✅||
|IndustriesSettings|✅||
|InstalledPackage|⚠️|Supports deploy/retrieve but not source tracking|
|IntegrationProviderDef|❌|Not supported, but support could be added|
|InterestTaggingSettings|✅||
|InternalDataConnector|✅||
|InvLatePymntRiskCalcSettings|✅||
Expand All @@ -305,6 +320,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|LiveChatDeployment|✅||
|LiveChatSensitiveDataRule|✅||
|LiveMessageSettings|✅||
|LocationUse|❌|Not supported, but support could be added|
|LoyaltyProgramSetup|⚠️|Supports deploy/retrieve but not source tracking|
|MLDataDefinition|✅||
|MLPredictionDefinition|✅||
Expand Down Expand Up @@ -356,6 +372,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|OmniInteractionAccessConfig|⚠️|Supports deploy/retrieve but not source tracking|
|OmniInteractionConfig|⚠️|Supports deploy/retrieve but not source tracking|
|OmniScript|⚠️|Supports deploy/retrieve but not source tracking|
|OmniSupervisorConfig|✅||
|OmniUiCard|⚠️|Supports deploy/retrieve but not source tracking|
|OnlineSalesSettings|✅||
|OpportunityInsightsSettings|✅||
Expand All @@ -372,13 +389,16 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|PathAssistant|✅||
|PathAssistantSettings|✅||
|PaymentGatewayProvider|✅||
|PaymentsIngestEnabledSettings|✅||
|PaymentsManagementEnabledSettings|✅||
|PaymentsSettings|✅||
|PermissionSet|✅||
|PermissionSetGroup|✅||
|PermissionSetLicenseDefinition|✅||
|PersonAccountOwnerPowerUser|❌|Not supported, but support could be added|
|PicklistSettings|✅||
|PicklistValue|❌|Not supported, but support could be added|
|PipelineInspMetricConfig|❌|Not supported, but support could be added|
|PlatformCachePartition|✅||
|PlatformEventChannel|✅||
|PlatformEventChannelMember|✅||
Expand All @@ -393,6 +413,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|PrivacySettings|✅||
|ProductAttributeSet|✅||
|ProductSettings|✅||
|ProductSpecificationTypeDefinition|❌|Not supported, but support could be added|
|Profile|✅||
|ProfilePasswordPolicy|✅||
|ProfileSessionSetting|✅||
Expand Down Expand Up @@ -437,6 +458,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|ServiceChannel|✅||
|ServiceCloudVoiceSettings|✅||
|ServicePresenceStatus|✅||
|ServiceProcess|❌|Not supported, but support could be added|
|ServiceSetupAssistantSettings|✅||
|SharingCriteriaRule|✅||
|SharingGuestRule|✅||
Expand Down Expand Up @@ -497,6 +519,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
|VirtualVisitConfig|❌|Not supported, but support could be added|
|VoiceSettings|✅||
|WarrantyLifecycleMgmtSettings|✅||
|WaveAnalyticAssetCollection|❌|Not supported, but support could be added|
|WaveApplication|✅||
|WaveComponent|✅||
|WaveDashboard|✅||
Expand Down Expand Up @@ -524,35 +547,11 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t



## Next Release (v57)
v57 introduces the following new types. Here's their current level of support
## Next Release (v58)
v58 introduces the following new types. Here's their current level of support

|Metadata Type|Support|Notes|
|:---|:---|:---|
|ActionLauncherItemDef|❌|Not supported, but support could be added|
|ActionableListDefinition|❌|Not supported, but support could be added|
|AppExplorationDataConsent|❌|Not supported, but support could be added|
|ClaimFinancialSettings|✅||
|ClauseCatgConfiguration|✅||
|DisclosureDefinition|✅||
|DisclosureDefinitionVersion|✅||
|DisclosureType|✅||
|ExternalClientAppSettings|✅||
|ExternalClientApplication|✅||
|ExtlClntAppMobileConfigurablePolicies|✅||
|ExtlClntAppMobileSettings|✅||
|ExtlClntAppOauthConfigurablePolicies|✅||
|ExtlClntAppOauthSettings|✅||
|IdentityProviderSettings|✅||
|IntegrationProviderDef|❌|Not supported, but support could be added|
|LocationUse|❌|Not supported, but support could be added|
|OmniSupervisorConfig|✅||
|PaymentsIngestEnabledSettings|✅||
|PersonAccountOwnerPowerUser|❌|Not supported, but support could be added|
|PipelineInspMetricConfig|❌|Not supported, but support could be added|
|ProductSpecificationTypeDefinition|❌|Not supported, but support could be added|
|ServiceProcess|❌|Not supported, but support could be added|
|WaveAnalyticAssetCollection|❌|Not supported, but support could be added|

## Additional Types

Expand Down
11 changes: 8 additions & 3 deletions src/client/metadataTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,14 @@ export abstract class MetadataTransfer<Status extends MetadataRequestStatus, Res
}
// tolerate intermittent network errors upto retry limit
if (
['ETIMEDOUT', 'ENOTFOUND', 'ECONNRESET', 'socket hang up'].some((retryableNetworkError) =>
(e as Error).message.includes(retryableNetworkError)
)
[
'ETIMEDOUT',
'ENOTFOUND',
'ECONNRESET',
'socket hang up',
'INVALID_QUERY_LOCATOR',
'<h1>Bad Message 400</h1><pre>reason: Bad Request</pre>',
].some((retryableNetworkError) => (e as Error).message.includes(retryableNetworkError))
) {
this.logger.debug('Network error on the request', e);
await Lifecycle.getInstance().emitWarning('Network error occurred. Continuing to poll.');
Expand Down
22 changes: 22 additions & 0 deletions test/client/metadataTransfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,28 @@ describe('MetadataTransfer', () => {
expect(checkStatus.callCount).to.equal(3);
});

it('should tolerate 2 known mdapi errors', async () => {
const { checkStatus } = operation.lifecycle;
checkStatus.onFirstCall().throws(new Error('<h1>Bad Message 400</h1><pre>reason: Bad Request</pre>'));
checkStatus.onSecondCall().throws(new Error('INVALID_QUERY_LOCATOR'));
checkStatus.onThirdCall().resolves({ done: true });

await operation.pollStatus();
expect(checkStatus.callCount).to.equal(3);
});

it('should tolerate known mdapi error', async () => {
const { checkStatus } = operation.lifecycle;
const networkError1 = new Error('foo');
networkError1.name = 'JsonParseError';
checkStatus.onFirstCall().throws(networkError1);
checkStatus.onSecondCall().throws(networkError1);
checkStatus.onThirdCall().resolves({ done: true });

await operation.pollStatus();
expect(checkStatus.callCount).to.equal(3);
});

it('should throw wrapped error if there are no error listeners', async () => {
const { checkStatus } = operation.lifecycle;
const originalError = new Error('whoops');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 206.5693120000069
"duration": 200.72280899999896
},
{
"name": "sourceToMdapi",
"duration": 4943.071838999982
"duration": 4991.547512999998
},
{
"name": "sourceToZip",
"duration": 4826.46210199999
"duration": 5128.423543000012
},
{
"name": "mdapiToSource",
"duration": 3256.713862000004
"duration": 3427.0605170000053
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 384.5527920000022
"duration": 423.05887099998654
},
{
"name": "sourceToMdapi",
"duration": 6970.504320000007
"duration": 7163.629501999996
},
{
"name": "sourceToZip",
"duration": 6130.4723740000045
"duration": 7302.745194999996
},
{
"name": "mdapiToSource",
"duration": 4920.01653100003
"duration": 4091.7455520000076
}
]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "componentSetCreate",
"duration": 681.8188979999977
"duration": 664.222689999995
},
{
"name": "sourceToMdapi",
"duration": 10472.678083999956
"duration": 11668.923317000008
},
{
"name": "sourceToZip",
"duration": 8984.845709999965
"duration": 9924.087503000017
},
{
"name": "mdapiToSource",
"duration": 10057.14215899998
"duration": 8384.765007000009
}
]