2

We are trying to split our huge monolithic 1st generation package into smaller chunks of 2gp packages sharing the same namespace. There are a lot of challenges and tough decisions to make here.

But in the first phase we are trying to split it into chunks with not more than 10,000 components each, and have something buildable as fast as possible to set up our CI process. After that we are planning to start moving components between packages in more reasonable way on a case by case basis, checking every night via CI pipelines if nothing has been broken over last day.

Following this approach, it seems for us like there are some artifacts which should be present (partially duplicated) into two or more packages. E.g. profiles (since they provide access to classes and aura components), objects (since they may have overrides referring to flexi pages and aura components) etc.

The question here: is it allowed to include same artifact into more than one package within the same namespace? We need then all those 2gp packages to be installed into the same org. What would be the behaviour in such case - would duplicates override each other or complement?

Any help would be appreciated.

  • 1
    I would expect that you cannot and that you need to deal with this by changing your approach. For example, use permission sets, per 2GP, that must be combined to give the full effect of the original profile. However, I haven't tried it and want to see an actually informed answer :D – Phil W Jun 17 at 8:53
1

You are not allowed to have duplicate metadata in multiple packages. However, this is more granular than you may think. For example, you can have Custom Object A in Package A, and then have a Custom Field B on Custom Object A in Package B, assuming Package B depends on Package A. It is not recommended that you use Profiles in this case, but instead Permission Sets. I don't have a package I can test with, but we've been discouraged from using Profiles for some time now. Consider migrating to Permission Sets while you're updating your packaging.

| improve this answer | |

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.