1

In my ORG I didn't add to repository the default folders like so

enter image description here

It was done like the following image:

enter image description here

That is, the root files starts in src/ folder instead of force-app/main/default/*

It brings some issues and rework. All the time that I retrieve some metadata from the some sandbox, the command "Retrieve Source in Manifest ORG" creates another folder based on force-app/main/default/*. Take a look at the green folder.

It happens when I am trying to retrieve by using the manifest file:

enter image description here

I have already added this structure in the sfdx-project.json file in the following way:

{
  "packageDirectories": [
    {
      "path": "repo/src",
      "default": true
    }
  ],
  "name": "ORGDEVTEAM",
  "namespace": "",
  "sfdcLoginUrl": "https://mydomain.lightning.force.com/",
  "sourceApiVersion": "52.0"
}

It works! It allows me deploying and retrieving the files by right-clicking and selecting the appropriate command, but when I am using the approach of retrieving by using the manifest package.xml, it creates a new structure folder outside of repo/src folder.

How to avoid that?

1 Answer 1

1

The format that you are using is outdated.

The previous format does not support new innovations like below

  • Ability to use Source Tracking
  • No more need to maintain package.xml in Source folder
  • Create 2GP packages from the Source folder
  • Ability to break Custom Object metadata into manageable format

You can read more here.

Hence I suggest you move to source format using sfdx force:mdapi:convert -r mdapi-source/original-package

You can preserve the source control git history using technique listed here.

3
  • humm....in fact, the provided structure comes from a legacy project. When you said it is outdated it means that this represenation that is in my repo comes from the previous approach of DX Project Structure? So, it's better to adapt the repo to the updated approach so these problems go away? right? thanks! Oct 10, 2021 at 0:06
  • 1
    @OlavoAlexandrino Yes! Correct, stay on latest format to make use of innovations. Oct 10, 2021 at 0:56
  • It makes sense, I was trying to keep the old format. Thanks for clarification ! Oct 10, 2021 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.