diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d99c810..bec463de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# [2.16.0](https://github.com/salesforcecli/plugin-packaging/compare/2.15.4...2.16.0) (2025-06-13) + +### Features + +- adding code coverage option description to the convert command ([ebd51da](https://github.com/salesforcecli/plugin-packaging/commit/ebd51da9d6607d0bbbe10edcf37fec5924f7b7f8)) +- adding code coverage option linking with packaging ([542cc69](https://github.com/salesforcecli/plugin-packaging/commit/542cc694738f62f89939d156654d5dcffe7b4937)) +- adding code coverage option to the convert command ([0574be5](https://github.com/salesforcecli/plugin-packaging/commit/0574be591647c9fa8da31d44a734f41a3396fbaa)) +- adding code coverage option to the convert command with snapshot ([07959d1](https://github.com/salesforcecli/plugin-packaging/commit/07959d18345974793d6dd4e6287c80511d337fb3)) +- adding code coverage option to the convert command with snapshot and tests ([a6cb4d4](https://github.com/salesforcecli/plugin-packaging/commit/a6cb4d4370f64cfeb110c17f8b4fecc146b47298)) + ## [2.15.4](https://github.com/salesforcecli/plugin-packaging/compare/2.15.3...2.15.4) (2025-06-10) ### Bug Fixes diff --git a/README.md b/README.md index 9bcbf889..4597f4fe 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,12 @@ Convert a managed-released first-generation managed package into a second-genera ``` USAGE $ sf package convert -v -p [--json] [--flags-dir ] [--api-version ] [-k ] [-f - ] [-x] [-w ] [-m ] [--verbose] [-a ] + ] [-x] [-w ] [-m ] [--verbose] [-a ] [-c] FLAGS -a, --patch-version= Specific released patch version to be converted. + -c, --code-coverage Calculate and store the code coverage percentage by running the packaged Apex tests + included in this package version. -f, --definition-file= Path to a definition file that contains features and org preferences that the metadata of the package version depends on. -k, --installation-key= Installation key for key-protected package. @@ -99,6 +101,9 @@ DESCRIPTION To protect the contents of your package and to prevent unauthorized installation of your package, specify the --installation-key flag. + To promote a package version to released, you must use the --code-coverage parameter. The package must also meet the + code coverage requirements. + To list package version creation requests in the org, run "sf package version create list". ALIASES @@ -119,6 +124,14 @@ FLAG DESCRIPTIONS Specify a released patch version as major.minor.patch to convert to a second-generation managed package version. + -c, --code-coverage + + Calculate and store the code coverage percentage by running the packaged Apex tests included in this package + version. + + Before you can promote and release a managed package version, the Apex code must meet a minimum 75% code coverage + requirement. + -f, --definition-file= Path to a definition file that contains features and org preferences that the metadata of the package version @@ -140,7 +153,7 @@ FLAG DESCRIPTIONS --installation-key-bypass flag is required. ``` -_See code: [src/commands/package/convert.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/convert.ts)_ +_See code: [src/commands/package/convert.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/convert.ts)_ ## `sf package create` @@ -219,7 +232,7 @@ FLAG DESCRIPTIONS Org-Dependent Unlocked Packages" in the Salesforce DX Developer Guide. ``` -_See code: [src/commands/package/create.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/create.ts)_ +_See code: [src/commands/package/create.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/create.ts)_ ## `sf package delete` @@ -261,7 +274,7 @@ EXAMPLES $ sf package delete --package 0Ho... --target-dev-hub devhub@example.com ``` -_See code: [src/commands/package/delete.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/delete.ts)_ +_See code: [src/commands/package/delete.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/delete.ts)_ ## `sf package install` @@ -360,7 +373,7 @@ FLAG DESCRIPTIONS - Delete: Delete all removed components that can be safely deleted, and deprecate the other components. ``` -_See code: [src/commands/package/install.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/install.ts)_ +_See code: [src/commands/package/install.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/install.ts)_ ## `sf package install report` @@ -393,7 +406,7 @@ EXAMPLES $ sf package install report --request-id 0Hf... --target-org me@example.com ``` -_See code: [src/commands/package/install/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/install/report.ts)_ +_See code: [src/commands/package/install/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/install/report.ts)_ ## `sf package installed list` @@ -425,7 +438,7 @@ EXAMPLES $ sf package installed list --target-org me@example.com ``` -_See code: [src/commands/package/installed/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/installed/list.ts)_ +_See code: [src/commands/package/installed/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/installed/list.ts)_ ## `sf package list` @@ -463,7 +476,7 @@ EXAMPLES $ sf package list --target-dev-hub devhub@example.com --verbose ``` -_See code: [src/commands/package/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/list.ts)_ +_See code: [src/commands/package/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/list.ts)_ ## `sf package push-upgrade abort` @@ -503,7 +516,7 @@ EXAMPLES $ sf package push-upgrade abort --push-request-id 0DV... --target-dev-hub devhub@example.com ``` -_See code: [src/commands/package/push-upgrade/abort.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/push-upgrade/abort.ts)_ +_See code: [src/commands/package/push-upgrade/abort.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/push-upgrade/abort.ts)_ ## `sf package push-upgrade list` @@ -562,7 +575,7 @@ EXAMPLES $ sf package push-upgrade list --package 033xyz –-status Failed ``` -_See code: [src/commands/package/push-upgrade/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/push-upgrade/list.ts)_ +_See code: [src/commands/package/push-upgrade/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/push-upgrade/list.ts)_ ## `sf package push-upgrade report` @@ -604,7 +617,7 @@ EXAMPLES $ sf package push-upgrade report --push-request-id 0DV... --target-dev-hub devhub@example.com ``` -_See code: [src/commands/package/push-upgrade/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/push-upgrade/report.ts)_ +_See code: [src/commands/package/push-upgrade/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/push-upgrade/report.ts)_ ## `sf package push-upgrade schedule` @@ -686,7 +699,7 @@ FLAG DESCRIPTIONS Overrides the value of the target-dev-hub configuration variable, if set. ``` -_See code: [src/commands/package/push-upgrade/schedule.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/push-upgrade/schedule.ts)_ +_See code: [src/commands/package/push-upgrade/schedule.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/push-upgrade/schedule.ts)_ ## `sf package uninstall` @@ -734,7 +747,7 @@ EXAMPLES $ sf package uninstall --package "Undesirable Package Alias" ``` -_See code: [src/commands/package/uninstall.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/uninstall.ts)_ +_See code: [src/commands/package/uninstall.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/uninstall.ts)_ ## `sf package uninstall report` @@ -767,7 +780,7 @@ EXAMPLES $ sf package uninstall report --request-id 06y... --target-org me@example.com ``` -_See code: [src/commands/package/uninstall/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/uninstall/report.ts)_ +_See code: [src/commands/package/uninstall/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/uninstall/report.ts)_ ## `sf package update` @@ -822,7 +835,7 @@ FLAG DESCRIPTIONS associated with your package. ``` -_See code: [src/commands/package/update.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/update.ts)_ +_See code: [src/commands/package/update.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/update.ts)_ ## `sf package version create` @@ -997,7 +1010,7 @@ FLAG DESCRIPTIONS periods of no output from commands. ``` -_See code: [src/commands/package/version/create.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/create.ts)_ +_See code: [src/commands/package/version/create.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/create.ts)_ ## `sf package version create list` @@ -1058,7 +1071,7 @@ EXAMPLES $ sf package version create list --created-last-days 0 --status Success ``` -_See code: [src/commands/package/version/create/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/create/list.ts)_ +_See code: [src/commands/package/version/create/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/create/list.ts)_ ## `sf package version create report` @@ -1101,7 +1114,7 @@ EXAMPLES $ sf package version create report --package-create-request-id 08c... --target-dev-hub devhub@example.com ``` -_See code: [src/commands/package/version/create/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/create/report.ts)_ +_See code: [src/commands/package/version/create/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/create/report.ts)_ ## `sf package version delete` @@ -1142,7 +1155,7 @@ EXAMPLES $ sf package version delete --package 04t... --target-org devhub@example.com ``` -_See code: [src/commands/package/version/delete.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/delete.ts)_ +_See code: [src/commands/package/version/delete.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/delete.ts)_ ## `sf package version displayancestry` @@ -1202,7 +1215,7 @@ FLAG DESCRIPTIONS You can use the DOT code output in graph visualization software to create tree visualizations. ``` -_See code: [src/commands/package/version/displayancestry.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/displayancestry.ts)_ +_See code: [src/commands/package/version/displayancestry.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/displayancestry.ts)_ ## `sf package version list` @@ -1278,7 +1291,7 @@ EXAMPLES $ sf package version list --packages exp-mgr,exp-mgr-util --released --modified-last-days 0 ``` -_See code: [src/commands/package/version/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/list.ts)_ +_See code: [src/commands/package/version/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/list.ts)_ ## `sf package version promote` @@ -1322,7 +1335,7 @@ EXAMPLES $ sf package version promote --package "Awesome Package Alias" ``` -_See code: [src/commands/package/version/promote.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/promote.ts)_ +_See code: [src/commands/package/version/promote.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/promote.ts)_ ## `sf package version report` @@ -1362,7 +1375,7 @@ EXAMPLES $ sf package version report --package "Your Package Alias" --target-dev-hub devhub@example.com ``` -_See code: [src/commands/package/version/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/report.ts)_ +_See code: [src/commands/package/version/report.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/report.ts)_ ## `sf package version update` @@ -1415,7 +1428,7 @@ EXAMPLES $ sf package version update --package 04t... --version-description "New Package Version Description" ``` -_See code: [src/commands/package/version/update.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package/version/update.ts)_ +_See code: [src/commands/package/version/update.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package/version/update.ts)_ ## `sf package1 version create` @@ -1482,7 +1495,7 @@ FLAG DESCRIPTIONS subscribers. ``` -_See code: [src/commands/package1/version/create.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package1/version/create.ts)_ +_See code: [src/commands/package1/version/create.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package1/version/create.ts)_ ## `sf package1 version create get` @@ -1515,7 +1528,7 @@ EXAMPLES $ sf package1 version create get --request-id 0HD... --target-org myorg@example.com ``` -_See code: [src/commands/package1/version/create/get.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package1/version/create/get.ts)_ +_See code: [src/commands/package1/version/create/get.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package1/version/create/get.ts)_ ## `sf package1 version display` @@ -1549,7 +1562,7 @@ EXAMPLES $ sf package1 version display --package-version-id 04t... --target-org myorg@example.com ``` -_See code: [src/commands/package1/version/display.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package1/version/display.ts)_ +_See code: [src/commands/package1/version/display.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package1/version/display.ts)_ ## `sf package1 version list` @@ -1587,6 +1600,6 @@ FLAG DESCRIPTIONS If not specified, shows all versions for all packages (managed and unmanaged) in the org. ``` -_See code: [src/commands/package1/version/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.15.4/src/commands/package1/version/list.ts)_ +_See code: [src/commands/package1/version/list.ts](https://github.com/salesforcecli/plugin-packaging/blob/2.16.0/src/commands/package1/version/list.ts)_ diff --git a/command-snapshot.json b/command-snapshot.json index a3d0563a..01cfe009 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -63,6 +63,14 @@ "flags": ["api-version", "description", "flags-dir", "json", "loglevel", "name", "target-dev-hub"], "plugin": "@salesforce/plugin-packaging" }, + { + "alias": [], + "command": "package:bundle:delete", + "flagAliases": ["apiversion", "noprompt", "target-hub-org", "targetdevhubusername"], + "flagChars": ["b", "n", "v"], + "flags": ["api-version", "bundle", "flags-dir", "json", "loglevel", "no-prompt", "target-dev-hub"], + "plugin": "@salesforce/plugin-packaging" + }, { "alias": [], "command": "package:bundle:install", @@ -97,14 +105,6 @@ "flags": ["api-version", "flags-dir", "json", "loglevel", "package-install-request-id", "target-org", "verbose"], "plugin": "@salesforce/plugin-packaging" }, - { - "alias": [], - "command": "package:bundle:delete", - "flagAliases": ["apiversion", "noprompt", "target-hub-org", "targetdevhubusername"], - "flagChars": ["b", "n", "v"], - "flags": ["api-version", "bundle", "flags-dir", "json", "loglevel", "no-prompt", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, { "alias": [], "command": "package:bundle:list", @@ -187,10 +187,11 @@ "target-hub-org", "targetdevhubusername" ], - "flagChars": ["a", "f", "k", "m", "p", "s", "v", "w", "x"], + "flagChars": ["a", "c", "f", "k", "m", "p", "s", "v", "w", "x"], "flags": [ "api-version", "build-instance", + "code-coverage", "definition-file", "flags-dir", "installation-key", diff --git a/messages/package_convert.md b/messages/package_convert.md index e74213a0..e136123c 100644 --- a/messages/package_convert.md +++ b/messages/package_convert.md @@ -12,6 +12,8 @@ To retrieve details about a package version create request, including status and To protect the contents of your package and to prevent unauthorized installation of your package, specify the --installation-key flag. +To promote a package version to released, you must use the --code-coverage parameter. The package must also meet the code coverage requirements. + To list package version creation requests in the org, run "<%= config.bin %> package version create list". # examples @@ -66,7 +68,7 @@ Display verbose command output. # in-progress -Request in progress. Will wait a total of %s more seconds before timing out. Current Status='%s'. +Request in progress. Will wait a total of %s more seconds before timing out. Current Status='%s'. # flags.seed-metadata.summary @@ -83,3 +85,11 @@ Specific released patch version to be converted. # flags.patch-version.description Specify a released patch version as major.minor.patch to convert to a second-generation managed package version. + +# flags.code-coverage.summary + +Calculate and store the code coverage percentage by running the packaged Apex tests included in this package version. + +# flags.code-coverage.description + +Before you can promote and release a managed package version, the Apex code must meet a minimum 75% code coverage requirement. diff --git a/package.json b/package.json index 87047b3c..170312e4 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "@salesforce/plugin-packaging", "description": "SF plugin that support Salesforce Packaging Platform", - "version": "2.15.4", + "version": "2.16.0", "author": "Salesforce", "bugs": "https://github.com/forcedotcom/cli/issues", "dependencies": { "@oclif/core": "^4", "@salesforce/core": "^8.12.0", "@salesforce/kit": "^3.2.3", - "@salesforce/packaging": "^4.6.0", + "@salesforce/packaging": "^4.7.0", "@salesforce/sf-plugins-core": "^12.2.2", "chalk": "^5.4.1" }, diff --git a/src/commands/package/bundle/create.ts b/src/commands/package/bundle/create.ts index dcf0e6a3..4f4fba5e 100644 --- a/src/commands/package/bundle/create.ts +++ b/src/commands/package/bundle/create.ts @@ -15,6 +15,8 @@ const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'bundle_c export type BundleCreate = { Id: string }; export class PackageBundlesCreate extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/delete.ts b/src/commands/package/bundle/delete.ts index cdfbeabf..69c508a9 100644 --- a/src/commands/package/bundle/delete.ts +++ b/src/commands/package/bundle/delete.ts @@ -14,6 +14,8 @@ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_bundle_delete'); export class PackageBundleDeleteCommand extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/install.ts b/src/commands/package/bundle/install.ts index bd8f2cab..6ef79416 100644 --- a/src/commands/package/bundle/install.ts +++ b/src/commands/package/bundle/install.ts @@ -22,6 +22,8 @@ const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'bundle_i export type BundleInstall = BundleSObjects.PkgBundleVersionInstallReqResult; export class PackageBundlesInstall extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/install/list.ts b/src/commands/package/bundle/install/list.ts index 0847e943..ce136f1f 100644 --- a/src/commands/package/bundle/install/list.ts +++ b/src/commands/package/bundle/install/list.ts @@ -18,6 +18,8 @@ type Status = BundleSObjects.PkgBundleVersionInstallReqStatus; export type PackageBundleInstallRequestResults = BundleSObjects.PkgBundleVersionInstallReqResult[]; export class PackageBundleInstallListCommand extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/install/report.ts b/src/commands/package/bundle/install/report.ts index 0a8762dc..9f08aa0b 100644 --- a/src/commands/package/bundle/install/report.ts +++ b/src/commands/package/bundle/install/report.ts @@ -18,6 +18,8 @@ const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'bundle_i export type ReportCommandResult = BundleSObjects.PkgBundleVersionInstallReqResult[]; export class PackageBundleInstallReportCommand extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/list.ts b/src/commands/package/bundle/list.ts index db552ad6..eb27bfbb 100644 --- a/src/commands/package/bundle/list.ts +++ b/src/commands/package/bundle/list.ts @@ -20,6 +20,8 @@ export type BundleListCommandResult = BundleSObjects.Bundle; export type BundleListCommandResults = BundleListCommandResult[]; export class BundleListCommand extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly examples = messages.getMessages('examples'); public static readonly flags = { diff --git a/src/commands/package/bundle/version/create.ts b/src/commands/package/bundle/version/create.ts index a8037283..ba7d5ffe 100644 --- a/src/commands/package/bundle/version/create.ts +++ b/src/commands/package/bundle/version/create.ts @@ -22,6 +22,8 @@ const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'bundle_v export type BundleVersionCreate = BundleSObjects.PackageBundleVersionCreateRequestResult; export class PackageBundlesCreate extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/version/create/list.ts b/src/commands/package/bundle/version/create/list.ts index 6c37a50c..46d75b26 100644 --- a/src/commands/package/bundle/version/create/list.ts +++ b/src/commands/package/bundle/version/create/list.ts @@ -23,6 +23,8 @@ type Status = BundleSObjects.PkgBundleVersionCreateReqStatus; export type PackageBundleVersionCreateRequestResults = BundleSObjects.PackageBundleVersionCreateRequestResult[]; export class PackageBundleVersionCreateListCommand extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/version/create/report.ts b/src/commands/package/bundle/version/create/report.ts index cb822c71..c5b7455c 100644 --- a/src/commands/package/bundle/version/create/report.ts +++ b/src/commands/package/bundle/version/create/report.ts @@ -18,6 +18,8 @@ const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'bundle_v export type ReportCommandResult = BundleSObjects.PackageBundleVersionCreateRequestResult[]; export class PackageBundleVersionCreateReportCommand extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/version/list.ts b/src/commands/package/bundle/version/list.ts index ef716567..cdf050d1 100644 --- a/src/commands/package/bundle/version/list.ts +++ b/src/commands/package/bundle/version/list.ts @@ -17,6 +17,8 @@ const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'bundle_v export type PackageBundleVersionResults = BundleSObjects.BundleVersion[]; export class PackageBundleVersionListCommand extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/commands/package/bundle/version/report.ts b/src/commands/package/bundle/version/report.ts index 1bb22265..099a43d3 100644 --- a/src/commands/package/bundle/version/report.ts +++ b/src/commands/package/bundle/version/report.ts @@ -18,6 +18,8 @@ export type BundleVersionReportResult = BundleSObjects.BundleVersion & { }; export class PackageBundleVersionReportCommand extends SfCommand { + public static readonly hidden = true; + public static state = 'beta'; public static readonly summary = messages.getMessage('summary'); public static readonly examples = messages.getMessages('examples'); public static readonly flags = { diff --git a/src/commands/package/convert.ts b/src/commands/package/convert.ts index 83863b6e..5ced38dc 100644 --- a/src/commands/package/convert.ts +++ b/src/commands/package/convert.ts @@ -90,6 +90,12 @@ export class PackageConvert extends SfCommand deprecateAliases: true, aliases: ['patchversion'], }), + 'code-coverage': Flags.boolean({ + char: 'c', + summary: messages.getMessage('flags.code-coverage.summary'), + description: messages.getMessage('flags.code-coverage.description'), + default: false, + }), }; public async run(): Promise { @@ -131,6 +137,7 @@ export class PackageConvert extends SfCommand buildInstance: flags['build-instance'] as string, seedMetadata: flags['seed-metadata'] as string, patchversion: flags['patch-version'] as string, + codecoverage: flags['code-coverage'] as boolean, }, project ); diff --git a/test/commands/package/packageConvert.test.ts b/test/commands/package/packageConvert.test.ts index cc2db204..3107dab2 100644 --- a/test/commands/package/packageConvert.test.ts +++ b/test/commands/package/packageConvert.test.ts @@ -7,7 +7,12 @@ import { expect } from 'chai'; import { MockTestOrgData, TestContext } from '@salesforce/core/testSetup'; import { Config } from '@oclif/core'; -import { Package, PackageVersionCreateRequestResult, PackagingSObjects } from '@salesforce/packaging'; +import { + Package, + PackageVersionCreateRequestResult, + PackagingSObjects, + type ConvertPackageOptions, +} from '@salesforce/packaging'; import sinon from 'sinon'; import { PackageConvert } from '../../../src/commands/package/convert.js'; import Package2VersionStatus = PackagingSObjects.Package2VersionStatus; @@ -80,8 +85,10 @@ describe('package:convert', () => { ); stubSpinner(cmd); const result = await cmd.run(); - expect(spinnerStartStub.called).to.be.true; + // Check that codecoverage was passed as false + const callArgs = convertStub.getCall(0).args[2] as ConvertPackageOptions; + expect(callArgs.codecoverage).to.equal(false); expect(result).to.deep.equal(pvc); }); it('starts package version create request (success)', async () => { @@ -109,11 +116,14 @@ describe('package:convert', () => { convertStub.restore(); convertStub = $$.SANDBOX.stub(Package, 'convert').resolves(pvc); const cmd = new PackageConvert( - ['-p', CONVERTED_FROM_PACKAGE_ID, '--installation-key', INSTALL_KEY, '-v', 'test@user.com'], + ['-p', CONVERTED_FROM_PACKAGE_ID, '--installation-key', INSTALL_KEY, '-v', 'test@user.com', '-c'], config ); stubSpinner(cmd); const result = await cmd.run(); + // Check that codecoverage was passed as true + const callArgs = convertStub.getCall(0).args[2] as ConvertPackageOptions; + expect(callArgs.codecoverage).to.equal(true); expect(result).to.deep.equal(pvc); }); it('starts package version create request (error)', async () => { diff --git a/yarn.lock b/yarn.lock index 4f4a4d12..30276d8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1742,10 +1742,10 @@ dependencies: "@salesforce/ts-types" "^2.0.12" -"@salesforce/packaging@^4.6.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@salesforce/packaging/-/packaging-4.6.0.tgz#ae30f6593da66d32b451c879d1eec23dcf664161" - integrity sha512-DAt37E6C0KeVbkIZEiplN6vmqQ5NB58TSYAk6LjX6+ZbvSV4lnBc4mSCDcErmqCn5mWW3fdPvxL8FlyYhmpL4g== +"@salesforce/packaging@^4.7.0": + version "4.7.0" + resolved "https://registry.yarnpkg.com/@salesforce/packaging/-/packaging-4.7.0.tgz#550d450486cf28edd7f5c7c76e6bce6e4d76d4e0" + integrity sha512-fYwE0oChQ7MBqeAbi2vq3NZBe2qw0nsXbXdNwgl2ybREDE2RLqWRIB75OGxEa9ARQNrdWOVE7sR81cGLyCIupg== dependencies: "@jsforce/jsforce-node" "^3.6.5" "@salesforce/core" "^8.11.1"