We have a large project that we took over and we are in the process of modularising the source into separate packages. At this point we're not quite ready with the metadata sorting to actually create Unlocked Packages so instead we also have a CI script in place to do a git-diff and deploy only change metadata using source:deploy --sourepath notation. This deployment will automatically split into separate deploy operations for each individual package defined in the project json (docs).

When actually deploying, this seems to be fine as long as dependencies are correctly managed.

  1. package 1 deploy + run tests
  2. package 2 deploy + run tests
  3. ...

But in the context of a validation deployment (--checkonly --testlevel RunLocalTests) it tries to do the same thing, but falls on an (perhaps) obvious hurdle

  1. package 1 validate + run tests (ok)
  2. package 2 validate (fail - metadata from package 1 deployment is missing)

I've not managed to find any mention of validations with regards to the deploy command or what the correct way to do this should be. Are we just trying to do something that will never be possible?

Tried to read through some of the feedback on the feature on GitHub but no luck so far.

1 Answer 1


If I got that right, not installing the package 1 is causing your issues.

Assuming my above sentence is correct, only putting package 1 and package 2 in the same validation would solve your problem without installing anything on an org.

If you're not willing to do that, you would have to provide an org where yourdirectly install the dependencies. E.g. you have a dependency org which has always the latest state of package 1. So whenever package 1 gets an update, run a deployment on this org. For validations of package 2 you could fire then against this org.

As soon as you start to have the packages ready, you won't face this issue anymore, since dependencies are automatically taken into the org then. (Though other problems will be popping up, but that's not business of this question :D)

  • So basically I'd need N-1 environments, right.
    – alesremta
    Commented Nov 2, 2020 at 13:07
  • At least, yes. Though N environments would be cool for a full integration box.
    – Hyperzwerg
    Commented Nov 3, 2020 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .