Skip to content

W-17369132: feat: reflect feat change to use Package2Version instead of MetadataP… #984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@
{
"alias": [],
"command": "package:version:retrieve",
"flagAliases": ["apiversion", "targetusername", "u"],
"flagChars": ["d", "o", "p"],
"flags": ["api-version", "flags-dir", "json", "loglevel", "output-dir", "package", "target-org"],
"flagAliases": ["apiversion", "targetdevhubusername"],
"flagChars": ["d", "p", "v"],
"flags": ["api-version", "flags-dir", "json", "loglevel", "output-dir", "package", "target-dev-hub"],
"plugin": "@salesforce/plugin-packaging"
},
{
Expand Down
2 changes: 1 addition & 1 deletion messages/package_pushupgrade_schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Filename of the CSV file that contains the list of subscriber org IDs that need

# flags.org-file.description

The file must contain one org per line. The org ID must be the only value in each row.
The file must contain one org per line. The org ID must be the only value in each row.
All listed orgs must have a package version installed in their org that is lower than the package version you specified for the --package flag.

# flags.org-list.summary
Expand Down
10 changes: 3 additions & 7 deletions messages/package_version_retrieve.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# summary

Retrieve package metadata for a specified package version.
Retrieve package metadata for a specified package version. Package metadata can be retrieved for converted second-generation managed package versions only.

# description

Retrieving a package version downloads the metadata into the directory you specify.

You can retrieve metadata for a second- or first-generation managed package, or an unlocked package.

Specify the subscriber package version ID (starts with 04t) and the path to an empty directory when you run this command.

# examples

- Retrieve package metadata for a subscriber package version ID (starts with 04t) into my-folder/ within your Salesforce DX project directory:

<%= config.bin %> <%= command.id %> --package 04t... --output-dir my-folder –-target-org my-scratch
- Retrieve package metadata for a converted subscriber package version ID (starts with 04t) into my-folder/ within your Salesforce DX project directory:

If you omit --target-org, this command runs against your default org.
<%= config.bin %> <%= command.id %> --package 04t... --output-dir my-folder –-target-dev-hub my-devhub

# flags.package.summary

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@oclif/core": "^4",
"@salesforce/core": "^8.12.0",
"@salesforce/core": "^8.15.0",
"@salesforce/kit": "^3.2.3",
"@salesforce/packaging": "^4.7.0",
"@salesforce/packaging": "^4.8.0",
"@salesforce/sf-plugins-core": "^12.2.2",
"chalk": "^5.4.1"
},
Expand Down
3 changes: 3 additions & 0 deletions schemas/package-version-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@
"TotalSizeOfMetadataFiles": {
"type": "number"
},
"DeveloperUsePkgZip": {
"type": "string"
},
"SubscriberPackageVersion": {
"type": "object",
"properties": {
Expand Down
7 changes: 3 additions & 4 deletions src/commands/package/version/retrieve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Flags,
loglevel,
orgApiVersionFlagWithDeprecations,
requiredOrgFlagWithDeprecations,
requiredHubFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core/messages';
Expand All @@ -28,15 +28,14 @@ export type FileDownloadEntry = {
export type PackageVersionRetrieveCommandResult = FileDownloadEntry[];

export class PackageVersionRetrieveCommand extends SfCommand<PackageVersionRetrieveCommandResult> {
public static readonly hidden = true;
public static readonly summary = messages.getMessage('summary');
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static readonly requiresProject = true;
public static readonly flags = {
loglevel,
'api-version': orgApiVersionFlagWithDeprecations,
'target-org': requiredOrgFlagWithDeprecations,
'target-dev-hub': requiredHubFlagWithDeprecations,
package: Flags.string({
char: 'p',
summary: messages.getMessage('flags.package.summary'),
Expand All @@ -51,7 +50,7 @@ export class PackageVersionRetrieveCommand extends SfCommand<PackageVersionRetri

public async run(): Promise<PackageVersionRetrieveCommandResult> {
const { flags } = await this.parse(PackageVersionRetrieveCommand);
const connection = flags['target-org'].getConnection(flags['api-version']);
const connection = flags['target-dev-hub'].getConnection(flags['api-version']);
const options = {
subscriberPackageVersionId: flags.package ?? '',
destinationFolder: flags['output-dir'],
Expand Down
2 changes: 1 addition & 1 deletion test/commands/package/packageVersionRetrieve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('package:version:retrieve - tests', () => {
describe('package:version:retrieve', () => {
it('should display retrieved files', async () => {
downloadStub.resolves(pkgVersionRetrieveSuccessResult);
const cmd = new PackageVersionRetrieveCommand(['-p', myPackageVersion04t, '-o', '[email protected]'], config);
const cmd = new PackageVersionRetrieveCommand(['-p', myPackageVersion04t, '-v', '[email protected]'], config);
const res = await cmd.run();
expect(res).to.deep.equal(expectedRetrievedComponents);
});
Expand Down
Loading
Loading