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/levenshtein-missing-types #1374

Merged
merged 6 commits into from
Jul 29, 2024
Merged

Conversation

mshanemc
Copy link
Contributor

@mshanemc mshanemc commented Jul 24, 2024

nuts require salesforcecli/plugin-source#1251 and salesforcecli/plugin-deploy-retrieve#1103

What does this PR do?

nicer error messages for unresolvable types.

Error (RegistryError): Missing metadata type definition in registry for id 'Worflow'.

Try this:

Did you mean one of the following types? [Workflow]

Confirm the metadata type name is correct. Validate against the registry at:
<https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json>

If the type is not listed in the registry, check that it has Metadata API support via the Metadata Coverage Report:
<https://developer.salesforce.com/docs/metadata-coverage>

If the type is available via Metadata API but not in the registry

- Open an issue <https://github.com/forcedotcom/cli/issues>
- Add the type via PR. Instructions: <https://github.com/forcedotcom/source-deploy-retrieve/blob/main/contributing/metadata.md>


shares a bunch of logic with suffix-levenshtein, so that's all now in one place.

What issues does this PR fix or reference?

@W-16324102@

@mshanemc mshanemc requested a review from a team as a code owner July 24, 2024 18:03
@WillieRuemmele
Copy link
Member

Does the ComponentSetBuilder.build not need the catch anymore? It was just moved down a level to the RegistryAccess itself?

@mshanemc
Copy link
Contributor Author

Does the ComponentSetBuilder.build not need the catch anymore? It was just moved down a level to the RegistryAccess itself?

yeah, it was intercepting only that one error (where something was missing from the registry) and re-throwing all others. Now that the RegistryAccess returns a nicer error, there was nothing left to catch.

@WillieRuemmele
Copy link
Member

QA Notes


✅ :

➜  dreamhouse-lwc git:(main)  hub:(GLOBAL - DevHub) scratch:([email protected])
 ➜  sf project deploy start -m Foox
Error (SfError): The specified metadata type is unsupported: [foox]

➜  dreamhouse-lwc git:(main)  hub:(GLOBAL - DevHub) scratch:([email protected])
 ➜  ../../oss/plugin-deploy-retrieve/bin/run.js project deploy start -m Foox
Error (RegistryError): Missing metadata type definition in registry for id 'Foox'.

Try this:

Did you mean one of the following types? [Flow,Form]

Confirm the metadata type name is correct. Validate against the registry at:
<https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json>

If the type is not listed in the registry, check that it has Metadata API support via the Metadata Coverage Report:
<https://developer.salesforce.com/docs/metadata-coverage>

If the type is available via Metadata API but not in the registry

- Open an issue <https://github.com/forcedotcom/cli/issues>
- Add the type via PR. Instructions: <https://github.com/forcedotcom/source-deploy-retrieve/blob/main/contributing/metadata.md>

@WillieRuemmele WillieRuemmele merged commit a66f50d into main Jul 29, 2024
74 checks passed
@WillieRuemmele WillieRuemmele deleted the sm/levenshtein-missing-types branch July 29, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants