"Retrieve Source From Org" doesn't update originating source file
See original GitHub issueSummary
βRetrieve Source From Orgβ doesnβt update originating source file when run from a single file outside the default directory.
It works as expected when refreshed from manifest.
Steps To Reproduce:
> create project with manifest
- attach to some sandbox with apex code
- clear everything but apex classes from package.xml
- Right click on manifest,
> retrieve source from org
- Create the following directory structure:
force-app/other/classes
- Move all the files from
force-app/main/default/classes
toforce-app/other/classes
. (Optionally delete theforce-app/main/default/classes
folder when done) - Right click on manifest,
> retrieve source from org
Expected: the second time the source is retrieved
(step 7), the files under force-app/other/classes
will have been updated.
Result: β
Retrieve Single File
- navigate to any
.cls
class underforce-app/other/classes
- right click ->
retrieve source from org
Expected: The file you ran the command against on would be refreshed. EG: force-app/other/classes/Foo.cls
Result: β
The retrieved code will instead be placed in the default project directory: force-app/main/default/classes
Additional information
LOG:
=== Retrieved Source
FULL NAME TYPE PROJECT PATH
ββββββββββββββββββββββ βββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ABTestingTriggerHelper ApexClass force-app/other/classes/ABTestingTriggerHelper.cls
ABTestingTriggerHelper ApexClass force-app/other/classes/ABTestingTriggerHelper.cls-meta.xml
23:12:47.72 sfdx force:source:retrieve --sourcepath /Users/jamesbond/Documents/clients/bug-repo/force-app/other/classes/ABTestingTriggerHelper.cls ended with exit code 0
VS Code Version: Version 1.33.1 (1.33.1)
SFDX CLI Version: sfdx-cli/7.5.0-e6ca93eee8 darwin-x64 node-v10.15.3
OS and version: osx 10.14.4
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:23 (6 by maintainers)
Top Results From Across the Web
VSCode SFDX: Retrieve Source from Org failing
I created a new project with the command: SFDX: Create Project with Manifest . Then right-click on the package.xml file in the manifestΒ ......
Read more >source Commands | Salesforce CLI Command Reference
Retrieve source from an org . List local changes and/or changes in a scratch org.
Read more >SFDX: Retrieve Source from Org failed to run Salesforce
If you are trying to retrieve source from salesforce org but keep getting the error-SFDX: Retrieve Source from Org failed to run. follow...
Read more >"SFDX: Deploy Source to Org" function missing - Stack Overflow
Try with sfdx force:source:push . If you need single file there's still source-ish deploy command (will warn you if you're overwriting somethingΒ ...
Read more >Managing Import Profiles - Ex Libris Knowledge Center
If you choose to create MARC 21 XML files (for your source), ... was loaded with a different originating system will not change...
Read more >Top Related Medium Post
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shetzel just rang through my reproduction steps in the original post and it friggin work as expected now!
π Finally, we can start using different folder structures
@ChuckJonas - great question/callout! Sorry, I wasnβt clear in my post. As part of the mpd support for
source:deploy
andsource:retrieve
(and push/pull for that matter) the file mapping was changed so that this usecase should now be supported whether multiple package directories are used or not. Youβre absolutely right that this usecase isnβt about mpd but about proper file mapping.If the canary release doesnβt fix this usecase please mention me and Iβll make sure it does. This should definitely work and Iβm sorry itβs taken this long to get it fixed.