dxatscale / sfpowerscripts

A build system for modular development in Salesforce
https://dxatscale.io
MIT License
213 stars 98 forks source link

Missing branch name property for unlocked packages. #1398

Closed michallachowski closed 1 year ago

michallachowski commented 1 year ago

When running orchestrator:quickbuild and orchestrator:build commands it's possible to specify --branch parameter, which should be used to set up this property on unlocked packages. However, the current implementation ignores it - all packages are created with no "branch" property populated.

Steps to reproduce:

  1. Build any unlocked package by running e.g. sfpowerscripts orchestrator:quickbuild --devhubalias [ORG_USERNAME] --branch "feature-branch"
  2. Use an id of created package to see package version report: sfdx package:version:report --json --verbose --package [PACKAGE_VERSION_ID]

Expected result is to see "Branch": "feature-branch", in the report. Current result is "Branch": null,, which is incorrect.

By fixing this bug, it will be possible to create package versions with branch name specified, so then we can refer such packages e.g. in dependency list of other packages: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_unlocked_pkg_use_branches.htm

michallachowski commented 1 year ago

This is related to PR #1397.

azlam-abdulsalam commented 1 year ago

@zhebinliu Can you shed some light on this, Is the DR available?

zhebinliu commented 1 year ago

The branch attribute of each package is read from the sfdx-project.json file. You can specify the package branch in this way: { path: 'packages/core', package: 'core', default: false, versionName: 'core-1.0.0', versionNumber: '1.0.0.NEXT', branch: 'xxxx' } by doing this, you will have the flexibility to specify which package you want to build as a branched package. so instead of building everything with that branch, we are only building those packages that have that branch specified in the project config file.

azlam-abdulsalam commented 1 year ago

@michallachowski I am closing this, as its supported