dxatscale / sfpowerscripts

A build system for modular development in Salesforce

Home Page:https://dxatscale.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing branch name property for unlocked packages.

michallachowski opened this issue · comments

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

This is related to PR #1397.

commented

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

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.

commented

@michallachowski I am closing this, as its supported