check for functions on org before creating compute env #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07AH000000LicIYAS/view
Prior to this change, if you tried to create a compute environment associated with an org that did not have functions enabled, the API request would fail with an "Instance Not Found" error message. This is not helpful or informative, and proved to be a massive footgun for basically everyone who tried to use the CLI.
To remedy this, we now verify that the org being passed DOES have functions enabled before trying to create the compute environment. If it does not have functions enabled, we error out and display a helpful error message with instructions telling them what to do.
How to test
sfdx generate:project -n my_projectcd my_projectsfdx force:org:create -f config/project-scratch-def.json -a feature-scratch-orgsfdx env:create:compute -o feature-scratch-org