Skip to content

Add multiple paths property under packageDirectories in sfdx-project.json for MPD and packages over 10,000 files #1507

@jmccotter

Description

@jmccotter

Is your feature request related to a problem? Please describe.
I would like to use packageDirectories with pushPackageDirectoriesSequentially to deploy our source in our core package which is over the 10,000 file limit in 2-3 batches. Our current package directory, which predates SFDX, MPD, etc, is broken up into dozens of modules. Because there are many directories and we only need to break up the directories deployed into two or three batches, the packageDirectories command does not work well for our case. In order to use it in its current state, we have to create a new layer of directories purely for representing the batches which is creating a directory structure based on only the push command rather than our business domain.

What are you trying to do
I would instead like to be able to specify multiple paths under one package directory like you can do with force:source:deploy -p

Describe the solution you'd like
Instead of an sfdx-project.json packageDirectories like this where we create a new folder layer:

{
  ...
  "packageDirectories": [
    {
      "path": "src/Namespace/folder-just-for-SFDX-1",
      "default": true
    },
    {
      "path": "src/Namespace/folder-just-for-SFDX-2",
    },
    {
      "path": "src/Namespace/folder-just-for-SFDX-3",
    }
  ],
  "pushPackageDirectoriesSequentially": true
}

We need to do something like this to replace our current scripts. You could use the existing path property with some logic to differentiate between a single path and list or create a new paths or batchedPaths property or something to indicate the difference:

{
  ...
  "packageDirectories": [
    {
      "paths": ["src/Namespace/domain1", "src/Namespace/domain2", "src/Namespace/domain3"]
      "default": true
    },
    {
      "paths": ["src/Namespace/domain4", "src/Namespace/domain5", "src/Namespace/domain6"]
    },
    {
      "paths": ["src/Namespace/domain7", "src/Namespace/domain8", "src/Namespace/domain9"]
    }
  ],
  "pushPackageDirectoriesSequentially": true
}

Describe alternatives you've considered

  • We currently have to do a batch push script using forceignore with the legacy push command to get source tracking to work for development. We use a batch deploy script for CI and cases where we don't need source tracking. The push script isn't ideal since the legacy commands will eventually be discontinued, but the script does not work with the new source tracking and our metadata. I've been working on trying to isolate which files are behaving differently with the new push vs the legacy push causing the issue before submitting an issue for that.
  • We could try to use the new deploy command with new source tracking but that would still require creating a script to run the deploy command with the appropriate paths and our own JSON of the paths in each batch. Ideally, that is why we'd like this change to work with the functionality already created without rearranging our directory structure so devs can just run push. Then SFDX via the sfdx-project.json file handles that config and logic.
  • We are also in the process of breaking up the monolithic repo to likely move some code out to another package at some point. However it was monolithic because it has existed for longer than SFDX. That work is likely a year or more out to finish and possibly partially dependent on figuring out the issues with 2GP so it could be even further out. For now, we still need a way to address deploying packages with over 10,000 files.

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIssue or pull request for a new feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions