1

I have gone trough the documentation about first and second generation packages to figure If our current package is a second generation package. I read the comparisons: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp_comparison.htm. I have read the following:Difference between Unlocked vs Second Generation Managed Package

Still I am not quite convinced about our package.

  • We use the cli
  • We upgrade our release number
  • We do retrieve our updated code from a sandbox en deploy this to a full sandbox
  • To release on production we need to promote te package

I created a case at Salesforce to help out with this. The answer was since we are not spinning any packaging or patch org it is a second generation package, but this does not seem like a legitimate answer or maybe I am wrong?

  1. Is there any sfdx command I can run to get the info which generation the package is or a command that for example only exist for 2nd generation packaging?

  2. Is there a command to figure out to which dev hub org the package is connected (I think we know which dev hub but want to confirm this from the package)?

Thanks in advance.

1 Answer 1

3

First generation managed packages are not listed when using sfdx package commands since they are not associated with a dev hub.

To see what 2GP packages you have, use:

sfdx force:package:list

To identify the dev hub for those packages, you simply need to use:

sfdx force:org:list

and look out for the entry that has "(D)" listed against it in the first column, like:

=== Orgs
     ALIAS           USERNAME                                       ORG ID              CONNECTED STATUS
───  ──────────────  ─────────────────────────────────────────────  ──────────────────  ─────────────────────
(D)  DevHub          [email protected]                        00Dj000000xxxxxEA2  Connected

This nicely has the org ID listed.

This works because sfdx force:package:list functions against a specified dev hub, either using the default, or via the --targetdevhubusername parameter, as covered in the documentation.

You must log in to answer this question.

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