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

fix: add a better error message with invalid manifests #740

Merged
merged 3 commits into from
Oct 25, 2022

Conversation

shetzel
Copy link
Contributor

@shetzel shetzel commented Oct 18, 2022

What does this PR do?

throw an error during manifest parsing when a metadata type appears invalid, indicating a bad manifest file.

What issues does this PR fix or reference?

@W-11927256@

Functionality Before

"Cannot read property 'toLowerCase' of undefined"
forcedotcom/cli#1187

Functionality After

Invalid types definition in manifest file: package.xml
Found: ""

Testing:
Create a manifest file with an empty <types></types> definition inside and run sfdx force:source:retrieve -x package.xml

@shetzel shetzel requested review from a team as code owners October 18, 2022 18:19
@mshanemc
Copy link
Contributor

QA:

✅ got the error on both retrieve and deploy with a bad manifest

➜  qa-manifest-error ../../plugin-source/bin/dev force:source:retrieve -x mdapiOut/package.xml
ERROR running force:source:retrieve:  Invalid types definition in manifest file: mdapiOut/package.xml
Found: ""
Preparing retrieve request... done
➜  qa-manifest-error ../../plugin-source/bin/dev force:source:deploy -x mdapiOut/package.xml
ERROR running force:source:deploy:  Invalid types definition in manifest file: mdapiOut/package.xml
Found: ""

@mshanemc mshanemc merged commit 8458c58 into main Oct 25, 2022
@mshanemc mshanemc deleted the sh/manifest-parse-bug branch October 25, 2022 15:17
@gbutt-tr
Copy link

gbutt-tr commented Nov 3, 2022

I believe this change may be causing an error to get thrown when an empty static resource folder is pushed. Should I create an issue for this, or is it expected behavior?

The only file i have in the reactBundle folder is an empty .git-keep file.

*** Pushing with SOAP API v54.0 ***
DEPLOY PROGRESS | ████████████████████████████████████████ | 3205/3205 Components
ERROR running force:source:push:  force-app/main/default/staticresources/reactBundle.resource-meta.xml: Expected source files for type 'StaticResource'
CLIError: timed out
    at Object.error (/opt/homebrew/Cellar/nvm/0.39.1_1/versions/node/v16.15.0/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/errors/index.js:28:15)
    at /opt/homebrew/Cellar/nvm/0.39.1_1/versions/node/v16.15.0/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/cli-ux/index.js:25:66
    at runNextTicks (node:internal/process/task_queues:61:5)
    at processTimers (node:internal/timers:499:9)
    at async flush (/opt/homebrew/Cellar/nvm/0.39.1_1/versions/node/v16.15.0/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/cli-ux/index.js:124:9) {
  oclif: { exit: 2 },
  code: undefined
}
Updating source tracking... done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants