Skip to content

Commit 8b5b50f

Browse files
authored
Sm/registry-completeness-bug (#582)
* fix: registry completeness test bug (use internal coverage report) * feat: new metadata types * feat: found more types * chore: update for contention on `.policy` suffix * chore: adding types for SDR * style: comment about apiVersion vs. coverage url * chore: adding types for SDR * fix: better env error for slack notifications * refactor: env check at the end
1 parent acba423 commit 8b5b50f

File tree

11 files changed

+274
-67
lines changed

11 files changed

+274
-67
lines changed

METADATA_SUPPORT.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This list compares metadata types found in Salesforce v54 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 421/465 supported metadata types.
7+
Currently, there are 442/465 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

@@ -22,11 +22,11 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
2222
|ActionLinkGroupTemplate|||
2323
|ActionPlanTemplate|||
2424
|ActionsSettings|||
25-
|ActivationPlatform||Not supported, but support could be added|
25+
|ActivationPlatform|||
2626
|ActivitiesSettings|||
2727
|AddressSettings|||
2828
|AdvAccountForecastSet|||
29-
|AdvAcctForecastDimSource||Not supported, but support could be added|
29+
|AdvAcctForecastDimSource|||
3030
|AdvAcctForecastPeriodGroup|||
3131
|AnalyticSnapshot|||
3232
|AnalyticsDataServicesSettings|||
@@ -43,8 +43,8 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
4343
|AppExperienceSettings|||
4444
|AppMenu|||
4545
|ApplicationRecordTypeConfig|||
46-
|ApplicationSubtypeDefinition||Not supported, but support could be added|
47-
|AppointmentAssignmentPolicy||Not supported, but support could be added|
46+
|ApplicationSubtypeDefinition|||
47+
|AppointmentAssignmentPolicy|||
4848
|AppointmentSchedulingPolicy|||
4949
|ApprovalProcess|||
5050
|ArchiveSettings|||
@@ -76,7 +76,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
7676
|BusinessHoursSettings|||
7777
|BusinessProcess|||
7878
|BusinessProcessGroup|||
79-
|BusinessProcessTypeDefinition||Not supported, but support could be added|
79+
|BusinessProcessTypeDefinition|||
8080
|CMSConnectSource|||
8181
|CallCenter|||
8282
|CallCenterRoutingMap|||
@@ -85,7 +85,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
8585
|CampaignSettings|||
8686
|CanvasMetadata|||
8787
|CareBenefitVerifySettings|||
88-
|CareLimitType||Not supported, but support could be added|
88+
|CareLimitType|||
8989
|CareProviderSearchConfig|||
9090
|CareRequestConfiguration|||
9191
|CareSystemFieldMapping|||
@@ -139,7 +139,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
139139
|Dashboard|||
140140
|DashboardFolder|||
141141
|DataCategoryGroup|||
142-
|DataConnectorIngestApi||Not supported, but support could be added|
142+
|DataConnectorIngestApi|||
143143
|DataConnectorS3|||
144144
|DataDotComSettings|||
145145
|DataMapping|||
@@ -148,7 +148,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
148148
|DataMappingSchema|||
149149
|DataSource|||
150150
|DataSourceObject|||
151-
|DataSourceTenant||Not supported, but support could be added|
151+
|DataSourceTenant|||
152152
|DataStreamDefinition|||
153153
|DecisionTable|||
154154
|DecisionTableDatasetLink|||
@@ -166,8 +166,8 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
166166
|DocumentType|||
167167
|DuplicateRule|||
168168
|EACSettings|||
169-
|ESignatureConfig||Not supported, but support could be added|
170-
|ESignatureEnvelopeConfig||Not supported, but support could be added|
169+
|ESignatureConfig|||
170+
|ESignatureEnvelopeConfig|||
171171
|EclairGeoData|||
172172
|EinsteinAgentSettings|||
173173
|EinsteinAssistantSettings|||
@@ -198,8 +198,8 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
198198
|EventSettings|||
199199
|ExperienceBundle|||
200200
|ExperienceBundleSettings|||
201-
|ExplainabilityActionDefinition||Not supported, but support could be added|
202-
|ExplainabilityActionVersion||Not supported, but support could be added|
201+
|ExplainabilityActionDefinition|||
202+
|ExplainabilityActionVersion|||
203203
|ExternalAIModel||Not supported, but support could be added|
204204
|ExternalCredential||Not supported, but support could be added|
205205
|ExternalDataConnector|||
@@ -253,7 +253,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
253253
|IndustriesSettings|||
254254
|InstalledPackage|⚠️|Supports deploy/retrieve but not source tracking|
255255
|InterestTaggingSettings|||
256-
|InternalDataConnector||Not supported, but support could be added|
256+
|InternalDataConnector|||
257257
|InventorySettings|||
258258
|InvocableActionSettings|||
259259
|IoTSettings|||
@@ -295,11 +295,11 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
295295
|MktCalcInsightObjectDef|||
296296
|MktDataTranObject|||
297297
|MlDomain|||
298-
|MobSecurityCertPinConfig||Not supported, but support could be added|
298+
|MobSecurityCertPinConfig|||
299299
|MobileApplicationDetail|||
300-
|MobileSecurityAssignment||Not supported, but support could be added|
301-
|MobileSecurityPolicy||Not supported, but support could be added|
302-
|MobileSecurityPolicySet||Not supported, but support could be added|
300+
|MobileSecurityAssignment|||
301+
|MobileSecurityPolicy|||
302+
|MobileSecurityPolicySet|||
303303
|MobileSettings|||
304304
|ModerationRule|||
305305
|MutingPermissionSet|||
@@ -321,7 +321,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
321321
|OmniChannelSettings|||
322322
|OmniDataTransform|||
323323
|OmniIntegrationProcedure|||
324-
|OmniInteractionAccessConfig||Not supported, but support could be added|
324+
|OmniInteractionAccessConfig|||
325325
|OmniInteractionConfig|||
326326
|OmniScript|||
327327
|OmniUiCard|||
@@ -356,7 +356,7 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
356356
|PresenceDeclineReason|||
357357
|PresenceUserConfig|||
358358
|PrivacySettings|||
359-
|ProductAttributeSet||Not supported, but support could be added|
359+
|ProductAttributeSet|||
360360
|ProductSettings|||
361361
|Profile|||
362362
|ProfilePasswordPolicy|||
@@ -371,8 +371,8 @@ To contribute a new metadata type, please see the [Contributing Metadata Types t
371371
|RecommendationBuilderSettings|||
372372
|RecommendationStrategy|||
373373
|RecordActionDeployment|||
374-
|RecordAlertCategory||Not supported, but support could be added|
375-
|RecordAlertDataSource||Not supported, but support could be added|
374+
|RecordAlertCategory|||
375+
|RecordAlertDataSource|||
376376
|RecordPageSettings|||
377377
|RecordType|||
378378
|RedirectWhitelistUrl|||
@@ -483,15 +483,19 @@ v55 introduces the following new types. Here's their current level of support
483483

484484
|Metadata Type|Support|Notes|
485485
|:---|:---|:---|
486+
|AssessmentQuestion||Not supported, but support could be added|
486487
|BotTemplate||Not supported, but support could be added|
488+
|ConvReasonReportSegment||Not supported, but support could be added|
487489
|Experience|undefined|undefined|
490+
|ExperienceMetadataResource|undefined|undefined|
491+
|ExperienceSpace|undefined|undefined|
488492
|ExternalDataSrcDescriptor||Not supported, but support could be added|
489493
|ExternalDataTranField||Not supported, but support could be added|
490494
|ExternalDataTranObject||Not supported, but support could be added|
491495
|FavoriteTransferDestination||Not supported, but support could be added|
492496
|IndustriesAutomotiveSettings|||
493-
|IndustriesMfgServiceSettings|||
494497
|InvLatePymntRiskCalcSettings|||
498+
|MarketingAppExtAction||Not supported, but support could be added|
495499
|PaymentsManagementEnabledSettings|||
496500
|RegisteredExternalService||Not supported, but support could be added|
497501
|StreamingAppDataConnector||Not supported, but support could be added|
@@ -516,6 +520,7 @@ v55 introduces the following new types. Here's their current level of support
516520
- FormSection
517521
- Portal
518522
- EmbeddedServiceFieldService
523+
- FlowTest
519524
- EventType
520525
- EventSubscription
521526
- EventDelivery

contributing/metadata.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ To simplify modifying the registry, there's a script.
1515

1616
> Note: The script depends on being able to create an org that will have your type. If you have a working org, but your type isn't compatible with scratch org, you can [use an existing org](#use-an-existing-org)
1717
18+
> Note: The script will use your default dev hub. If you don't have one, set one up. If you want to use a different hub, update your default.
19+
1820
The script will:
1921

2022
1. Look for missing types (similar to the completeness test)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"pretest": "sf-compile-test",
9999
"repl": "node --inspect ./scripts/repl.js",
100100
"test": "sf-test",
101-
"test:registry": "nyc mocha ./test/registry/registryCompleteness.test.ts",
101+
"test:registry": "mocha ./test/registry/registryCompleteness.test.ts",
102102
"update-registry": "npx ts-node scripts/update-registry/update2.ts",
103103
"update-supported-metadata": "npx ts-node scripts/update-registry/update-supported-metadata.ts"
104104
},

scripts/update-registry/preview.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import got from 'got';
22
import { getMissingTypes } from '../../test/utils/getMissingTypes';
33
import { registry } from '../../src';
4-
import {getCurrentApiVersion, getCoverage} from './shared'
4+
import { getCurrentApiVersion, getCoverage } from '../../src/registry/coverage';
55

66
(async () => {
77
const currentApiVersion = await getCurrentApiVersion();
8-
const nextCoverage = await getCoverage(currentApiVersion + 1)
8+
const nextCoverage = await getCoverage(currentApiVersion + 1);
99

1010
const missingTypes = getMissingTypes(nextCoverage, registry).map((type) => type[0]);
1111

@@ -44,6 +44,9 @@ import {getCurrentApiVersion, getCoverage} from './shared'
4444
},
4545
],
4646
};
47+
if (!process.env.DEFAULT_SLACK_WEBHOOK) {
48+
throw new Error('DEFAULT_SLACK_WEBHOOK is not set in the environment');
49+
}
4750
try {
4851
await got.post(process.env.DEFAULT_SLACK_WEBHOOK, {
4952
json,

scripts/update-registry/shared.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

scripts/update-registry/update-supported-metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CoverageObject } from '../../src/registry/types';
2-
import { getCurrentApiVersion, getCoverage } from './shared';
2+
import { getCurrentApiVersion, getCoverage } from '../../src/registry/coverage';
33
import { registry as untypedRegistry } from '../../src';
44
import { MetadataRegistry } from '../../src';
55
import * as shell from 'shelljs';

scripts/update-registry/update2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as deepmerge from 'deepmerge';
77
import { CoverageObject, CoverageObjectType } from '../../src/registry/types';
88
import { AnyJson } from '@salesforce/ts-types';
99
import { getMissingTypes } from '../../test/utils/getMissingTypes';
10-
import { getCurrentApiVersion, getCoverage } from './shared';
10+
import { getCurrentApiVersion, getCoverage } from '../../src/registry/coverage';
1111

1212
export const registry = fs.readJsonSync('./src/registry/metadataRegistry.json') as unknown as MetadataRegistry;
1313
export let metadataCoverage: CoverageObject;

src/registry/coverage.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2020, salesforce.com, inc.
3+
* All rights reserved.
4+
* Licensed under the BSD 3-Clause license.
5+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
import got from 'got';
8+
import { CoverageObject } from '../../src/registry/types';
9+
10+
export const getCurrentApiVersion = async (): Promise<number> => {
11+
return (
12+
JSON.parse((await got('https://mdcoverage.secure.force.com/services/apexrest/report')).body) as {
13+
versions: { selected: number };
14+
}
15+
).versions.selected;
16+
};
17+
18+
export const getCoverage = async (apiVersion: number): Promise<CoverageObject> =>
19+
JSON.parse(
20+
// this is a constant offset between each apiVersion and the url.
21+
// ex: v55=na46, v54=na45, etc.
22+
(await got(`https://na${apiVersion - 9}.test1.pc-rnd.salesforce.com/mdcoverage/api.jsp`)).body
23+
) as CoverageObject;

0 commit comments

Comments
 (0)