2GP: Package upgrade from patch to next minor version

I have a package version and I’ve created a patch with some hotfixes which I packaged as (updated the patch version). During packaging of the ancestor version specified is version All of the versions are released – in order for package ancestry to work.

The question I have is the following. What do I need to specify as the ancestor for version once more code changes are merged and a decision to package it is made?
Do I specify or What if I have another patch release version afterwards?

Will it be possible to upgrade from to if they both share the same ancestor, i.e.

Edit: The documentation specifies: ->

No. To upgrade to, package version must be the specified ancestor, or the specified ancestor must be a descendent of

Would this mean that in my example the common ancestor should be and this would allow the package upgrade?


Scenario 1 – as your ancestor for the next minor release i.e

Let’s consider the scenario if you specify as your ancestor for the next minor release i.e

In this scenario if you have a subscriber org on you will have to install the and then since you specified the ancestor as

The above is definitely not one would want if you plan to merge your patch into the next minor release.

Scenario 2 – as your ancestor for the next minor release i.e

In this you can upgrade your org with package to the next minor or update the org which has the patch because had the ancestor as

So yes is the common ancestor here.

In all normal cases if you plan a new minor release I would keep the previous major.minor as the ancestors.

Let’s say you plan further patches (, you can specify ancestors as the previous patch versions for patches.

I suggest you look into Semantic Versioning to better understand when to go for patch vs Minor release vs Major

Source : Link , Question Author : mcekol , Answer Author : Mohith Shrivastava

Leave a Comment