When force:source:deploy is used against a scratch org sfdx loses context for what has been previously deployed because the command explicitly deletes the .sfdx/orgs/{username}/sourcePathInfos.json file. This causes all of the metadata to be pushed on the next deployment. Our full push takes >10 minutes and this can be a significant burden.
In #109 we have run into a hard limit for using the force:source:push functionality and are trying to pre-deliver items like static resources in chunks to alleviate some of the pressure on force:source:push. We were hoping that force:source:deploy could be used but were disappointed that it neither tracks the push against the state tracking but also destroys all other state tracking.
Offending line:
salesforce-alm\dist\lib\source\sourceDeployApi.js:72
this.orgApi.getSourcePathInfos().delete();
Would expect this to be wrapped with conditional behavior for when the target is a scratch org.
Take a DX project, use force:source:push to delivery metadata. Notice that the associated sourcePathInfos.json file exists in the org tracking directory.
Use force:source:deploy to deliver any metadata to the org, note that the file is now missing.
Use force:source:push again and it will re-deploy all of the previously deployed metadata.
Ideally, force:source:deploy when used against a scratch org would count that as a partial push and update the local state tracking accordingly so that a force:source:push wouldn't ignore the files previously explicitly pushed.
Using force:source:deploy removes all existing state tracking against the org.
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.8.1-8f830784cc win32-x64 node-v10.15.3
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-commands 1.2.2 (core)
@oclif/plugin-help 2.1.6 (core)
@oclif/plugin-not-found 1.2.2 (core)
@oclif/plugin-plugins 1.7.8 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.2 (core)
analytics 1.1.2 (core)
generator 1.1.0 (core)
salesforcedx 45.16.0 (core)
鈹溾攢 force-language-services 45.12.0 (core)
鈹斺攢 salesforce-alm 45.18.0 (core)
sfdx-cli 7.8.1 (core)
sfdx-typegen 0.6.0 (link) C:\Users\aheber\dev\sfdx-typegen
OS and version:
Windows 10
EDIT:
Currently, have a ticket on our backlog to fix this issue. Thank you for giving us more details on the issue you are seeing. I'll report back when we have fixed it.
This is a feature request as it is currently working as designed
Any chance it could be fast-tracked? :-)
This is a larger issue about how Push and Pull work with deploy and retrieve. We will be doing a spike on how to clean up this experience. The team is currently focused on other features and improvements and I can not give you a timeline on when we will pick up this work.
Most helpful comment
EDIT:
Currently, have a ticket on our backlog to fix this issue. Thank you for giving us more details on the issue you are seeing. I'll report back when we have fixed it.
This is a feature request as it is currently working as designed