1

I have created one unlocked package for deployment purpose.Now I am adding new components to the package and doing versioning. How can I check the which version contains what metadata.

EX. suppose my 1st added class "ABC" to package and did versioning. Version number 1.1 contains "ABC". Again I have removed that class from package and added different class "XYZ" to the package and did versioning. The version number is 1.2

How can I track this thing if I have done n number of versioning on the same package?

| improve this question | | | | |
  • 1
    Surely your VCS is the source of truth over version content? Every time you create a release, set the version in the package meta, commit the updates to your VCS and tag the VCS with that version as needed. – Phil W Feb 4 at 10:36
  • Thanks for your reply. Is there any thing available in UI level? – Ananga Feb 4 at 11:06
  • 3
    Not that I know of. For 2nd generation packaging it is your VCS (e.g. git) that is the source of truth, not some Salesforce org. With 2GP there is no "packaging org" like there is with 1GP. – Phil W Feb 4 at 11:40
1

You have to take care about yourself to create a corresponding branch or tag in your VCS whenever you create a new package version.

I would also recommend to use the --tag resp. --branch parameters to reflect your current snapshot in VCS when using the force:package:version:create command. These information are visible when executing sfdx force:package:version:list against your packaging org - so you can see which branch/tag to checkout for each package version.


Just another solution you can try to receive already packaged metadata components:

  1. run sfdx force:package:version:list -v [packaging org alias]
  2. get the package version id you are interested in (starting with 04t)
  3. install the package in a sandbox/scratch org with sfdx force:package:install --package 04t... -u [org alias to install]
  4. retrieve the packaged metadata components with sfdx force:mdapi:retrieve --singlepackage --retrievetargetdir [dir to store export] --packagenames [your package name] -u [org alias where package is installed]
  5. unzip your export and convert source into source tracking format sfdx force:source:convert -r [your source path] -d [destination path]

Now you should have all metadata components from the package in the same format as you packaged it once

| 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.