Upgrading multiple packages at once

I see a lot of people pushing a code base of “Happy Soup” of packages. However, there is a common dependency management use-case that I haven’t seen a solution for.

Deployments that requirement multiple packages to be updated at once.

Take for example the following setup:

Package A 1.0.0

global class Foo {
   global static void doFoo() {}
}

Package B 1.0.0

global class Bar {
   global static void doBar() {
      A.Foo.doFoo();
   }
}

Now, lets say we need to update Foo.doFoo so it accepts a parameter:

global static void doFoo(String msg) {}

We’ll also need to update doBar:

  global static void doBar() {
      A.Foo.doFoo('ello dingus');
   }

And release a new version (2.0.0) for each package.

So how do we get these updates into our org? As far as I know, there isn’t a way to deploy both packages in the same request (maybe I’m wrong?).

And we can’t first publish Package A 2.0.0 because it is not compatible with Package B 1.0.0.

Is there a solution (other than just outright deleting Package B)?

Answer

On our product roadmap, we have plans to support installing and upgrading multiple packages in a single transaction.

Until that is available, would this multi-step process work for you?

1) Release Package A ver 1.1.0 that has both the methods – global static void doFoo() and global static void doFoo(String msg).

2) Release Package B ver 1.1.0 where doBar() invokes doFoo(String msg).

3) Release Package A ver 1.2.0 where you remove global static void doFoo().

4) In the installed org, install Package A ver 1.1.0, then Package B ver 1.1.0 and then Package A 1.2.0

Attribution
Source : Link , Question Author : NSjonas , Answer Author : Dileep

Leave a Comment