Skip to content

feat: display validated-async in version list and report #706

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
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions messages/package_version_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ Code Coverage Met

Validation Skipped

# validatedAsync

Validated Async

# releaseVersion

Release Version
Expand All @@ -149,3 +153,7 @@ Created By
# language

Language

# endToEndBuildDurationInSeconds

End To End Build Duration In Seconds
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@oclif/core": "^4",
"@salesforce/core": "^8.0.1",
"@salesforce/kit": "^3.1.6",
"@salesforce/packaging": "^4.0.3",
"@salesforce/packaging": "^4.1.0",
"@salesforce/sf-plugins-core": "^11.1.2",
"chalk": "^5.3.0"
},
Expand Down
3 changes: 3 additions & 0 deletions schemas/package-version-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
"ValidationSkipped": {
"type": "boolean"
},
"ValidatedAsync": {
"type": "boolean"
},
"ConvertedFromVersionId": {
"type": "string"
},
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 @@ -191,6 +191,9 @@
},
"AncestorId": {
"type": ["string", "null"]
},
"EndToEndBuildDurationInSeconds": {
"type": "number"
}
},
"required": ["HasMetadataRemoved", "Package2", "Version"]
Expand Down
3 changes: 3 additions & 0 deletions src/commands/package/version/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export type PackageVersionListDetails = Omit<
Alias: string;
IsOrgDependent: 'N/A' | 'Yes' | 'No';
CreatedBy: string;
ValidatedAsync?: boolean;
};

export type PackageVersionListCommandResult = PackageVersionListDetails[];
Expand Down Expand Up @@ -194,6 +195,7 @@ export class PackageVersionListCommand extends SfCommand<PackageVersionListComma
CodeCoverage: codeCoverage,
HasPassedCodeCoverageCheck: hasPassedCodeCoverageCheck as string | boolean,
ValidationSkipped: record.ValidationSkipped,
ValidatedAsync: record.ValidatedAsync,
AncestorId: record.AncestorId,
AncestorVersion: ancestorVersion as string,
Alias: AliasStr,
Expand Down Expand Up @@ -244,6 +246,7 @@ const getColumnData = (
IsPasswordProtected: { header: messages.getMessage('installKey') },
IsReleased: { header: 'Released' },
ValidationSkipped: { header: messages.getMessage('validationSkipped') },
ValidatedAsync: { header: messages.getMessage('validatedAsync') },
AncestorId: { header: 'Ancestor' },
AncestorVersion: { header: 'Ancestor Version' },
Branch: { header: messages.getMessage('packageBranch') },
Expand Down
9 changes: 9 additions & 0 deletions src/commands/package/version/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ export class PackageVersionReportCommand extends SfCommand<PackageVersionReportR
key: pvlMessages.getMessage('validationSkipped'),
value: record.ValidationSkipped,
},
{
key: pvlMessages.getMessage('validatedAsync'),
value: record.ValidatedAsync,
},
{ key: messages.getMessage('ancestorId'), value: record.AncestorId },
{ key: messages.getMessage('ancestorVersion'), value: record.AncestorVersion },
{
Expand Down Expand Up @@ -181,6 +185,11 @@ export class PackageVersionReportCommand extends SfCommand<PackageVersionReportR
}));
this.haveCodeCoverageData = displayCoverageRecords.length > 0;
}

displayRecords.push({
key: pvlMessages.getMessage('endToEndBuildDurationInSeconds'),
value: record.EndToEndBuildDurationInSeconds?.toFixed(1) ?? '',
});
}

// Always append code coverage column label ar the end
Expand Down
15 changes: 9 additions & 6 deletions test/commands/package/packageVersion.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,14 @@ describe('package:version:*', () => {
expect(output?.result[0]).to.have.keys(expectedVerboseKeys);
});
});

describe('package:version:list', () => {
it('should list package versions in dev hub - human readable results', () => {
const command = `package:version:list -v ${session.hubOrg.username}`;
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Ancestor\s+Ancestor Version\s+Branch/
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/
);
});

Expand All @@ -277,23 +278,23 @@ describe('package:version:*', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Ancestor\s+Ancestor Version\s+Branch/
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/
);
});
it('should list package versions created in the last 5 days', () => {
const command = `package:version:list -v ${session.hubOrg.username} --createdlastdays 5`;
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Ancestor\s+Ancestor Version\s+Branch/
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/
);
});
it('should list installed packages in dev hub - verbose human readable results', () => {
const command = `package:version:list -v ${session.hubOrg.username} --verbose`;
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Ancestor\s+Ancestor Version\s+Branch\s+Package Id\s+Installation URL\s+Package Version Id\s+Created Date\s+Last Modified Date\s+Tag\s+Description\s+Code Coverage\s+Code Coverage Met\s+Converted From Version Id\s+Org-Dependent\s+Unlocked Package\s+Release\s+Version\s+Build Duration in Seconds\s+Managed Metadata Removed\s+Created By/
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Package Id\s+Installation URL\s+Package Version Id\s+Created Date\s+Last Modified Date\s+Tag\s+Description\s+Code Coverage\s+Code Coverage Met\s+Converted From Version Id\s+Org-Dependent\s+Unlocked Package\s+Release\s+Version\s+Build Duration in Seconds\s+Managed Metadata Removed\s+Created By/
);
});

Expand All @@ -302,7 +303,7 @@ describe('package:version:*', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Ancestor\s+Ancestor Version\s+Branch\s+Package Id\s+Installation URL\s+Package Version Id\s+Created Date\s+Last Modified Date\s+Tag\s+Description\s+Code Coverage\s+Code Coverage Met\s+Converted From Version Id\s+Org-Dependent\s+Unlocked Package\s+Release\s+Version\s+Build Duration in Seconds\s+Managed Metadata Removed\s+Created By/
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Package Id\s+Installation URL\s+Package Version Id\s+Created Date\s+Last Modified Date\s+Tag\s+Description\s+Code Coverage\s+Code Coverage Met\s+Converted From Version Id\s+Org-Dependent\s+Unlocked Package\s+Release\s+Version\s+Build Duration in Seconds\s+Managed Metadata Removed\s+Created By/
);
expect(output).to.include('testing');
});
Expand Down Expand Up @@ -331,6 +332,7 @@ describe('package:version:*', () => {
'InstallUrl',
'CodeCoverage',
'ValidationSkipped',
'ValidatedAsync',
'AncestorId',
'AncestorVersion',
'Alias',
Expand Down Expand Up @@ -373,6 +375,7 @@ describe('package:version:*', () => {
'CodeCoverage',
'HasPassedCodeCoverageCheck',
'ValidationSkipped',
'ValidatedAsync',
'AncestorId',
'AncestorVersion',
'Alias',
Expand All @@ -395,7 +398,7 @@ describe('package:version:*', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Ancestor\s+Ancestor Version\s+Branch\s+Converted From Version Id/
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Converted From Version Id/
);
});
});
Expand Down
2 changes: 2 additions & 0 deletions test/commands/package/versionReport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const pkgVersionReportResultModified: PackageVersionReportResultModified = {
Tag: '',
ValidationSkipped: false,
Version: '0.0.0.0',
EndToEndBuildDurationInSeconds: 299.0,
};

const pkgVersionReportResult: PackageVersionReportResult = {
Expand Down Expand Up @@ -105,6 +106,7 @@ const pkgVersionReportResult: PackageVersionReportResult = {
Tag: '',
ValidationSkipped: false,
Version: '0.0.0.0',
EndToEndBuildDurationInSeconds: 299.0,
};

describe('package:version:report - tests', () => {
Expand Down
40 changes: 20 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1242,10 +1242,10 @@
"@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14"

"@jsforce/jsforce-node@^3.2.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@jsforce/jsforce-node/-/jsforce-node-3.2.0.tgz#4b104613fc9bb74e0e38d2c00936ea2b228ba73a"
integrity sha512-3GjWNgWs0HFajVhIhwvBPb0B45o500wTBNEBYxy8XjeeRra+qw8A9xUrfVU7TAGev8kXuKhjJwaTiSzThpEnew==
"@jsforce/jsforce-node@^3.2.0", "@jsforce/jsforce-node@^3.2.1":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@jsforce/jsforce-node/-/jsforce-node-3.2.1.tgz#00fab05919e0cbe91ae4d873377e56cfbc087b98"
integrity sha512-hjmZQbYVikm6ATmaErOp5NaKR2VofNZsrcGGHrdbGA+bAgpfg/+MA/HzRTb8BvYyPDq3RRc5A8Yk8gx9Vtcrxg==
dependencies:
"@sindresorhus/is" "^4"
"@types/node" "^18.15.3"
Expand Down Expand Up @@ -1428,12 +1428,12 @@
semver "^7.6.2"
ts-retry-promise "^0.8.1"

"@salesforce/core@^8.0.1", "@salesforce/core@^8.0.2":
version "8.0.2"
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.0.2.tgz#f2f31024f3d264c3c862700a42712c69fc7e1160"
integrity sha512-DSQ6iZJhc5HWWfSnn8e0ECxQaY+uQzoNlqLZnwWggkMPlaurlNIpSd8Td+prLL0sQ4YS/SmB68gLnfpd7U++tg==
"@salesforce/core@^8.0.1", "@salesforce/core@^8.0.3":
version "8.1.0"
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.1.0.tgz#8ee25acdacf9d70a6249907a2fe3503461f18766"
integrity sha512-oItr8cdeMe67glJN3dP1Gh/kasD0DUT6S6RfcLTH32wwuZNQAwMXNgBOCvlskr8nxPZ+YSSw7CVuqYMUmCtUXA==
dependencies:
"@jsforce/jsforce-node" "^3.2.0"
"@jsforce/jsforce-node" "^3.2.1"
"@salesforce/kit" "^3.1.6"
"@salesforce/schemas" "^1.9.0"
"@salesforce/ts-types" "^2.0.10"
Expand Down Expand Up @@ -1496,18 +1496,18 @@
dependencies:
"@salesforce/ts-types" "^2.0.10"

"@salesforce/packaging@^4.0.3":
version "4.0.3"
resolved "https://registry.yarnpkg.com/@salesforce/packaging/-/packaging-4.0.3.tgz#2419a410285bc87a64ff8d4c11c81a498ac8dc16"
integrity sha512-rASSaRkEgr7nXJixeeNAATHmTnOv9qPl7Sc0ylzhnjBDvBb6UedxiTxv97zJzINIV+hdyBDXqvwqmedoIXEc6A==
"@salesforce/packaging@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@salesforce/packaging/-/packaging-4.1.0.tgz#61b625c8c22c007b04e190a06a23eca03e9d34c6"
integrity sha512-fLIbpoP885fL1FgkM+5aHxAjXQlIBEBamHGHeqTF/BzXbK7Y2bo/Gqdj2FVIw6KACGnowRK83GJNfD961J0CsQ==
dependencies:
"@jsforce/jsforce-node" "^3.2.0"
"@salesforce/core" "^8.0.2"
"@salesforce/core" "^8.0.3"
"@salesforce/kit" "^3.1.6"
"@salesforce/schemas" "^1.9.0"
"@salesforce/source-deploy-retrieve" "^12.0.1"
"@salesforce/ts-types" "^2.0.9"
"@salesforce/types" "^1.1.0"
"@salesforce/ts-types" "^2.0.10"
"@salesforce/types" "^1.2.0"
fast-xml-parser "^4.4.0"
globby "^11"
graphology "^0.25.4"
Expand Down Expand Up @@ -1599,10 +1599,10 @@
resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-2.0.10.tgz#f2107a52b60be6c3fe712f4d40aafad48c6bebe0"
integrity sha512-ulGQ1oUGXrmSUi6NGbxZZ7ykSDv439x+WYZpkMgFLC8Dx0TxJXfUAJYeZh7eKO5xI/ob3iyvN+RBcBkp4KFN1w==

"@salesforce/types@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@salesforce/types/-/types-1.1.0.tgz#22d13c84c22c036e20188c54e679e1710d4ae398"
integrity sha512-nYxyX9cR9A+ltELXHDJNKTjOgGrLj3URVUpAfpPlmEMjTYXkitz/4bJchIsN2r1Ud2kBcxUYtjvPOvKBnP9eiQ==
"@salesforce/types@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@salesforce/types/-/types-1.2.0.tgz#58842732eebc718f10c48232ff39794698824049"
integrity sha512-HHey9SlkmElyNWBoo3DRQMDBkj9cAAwUItkGgzgXo4pCt6DdP1tEkB3QPHElE4KAHk8FVxHGoofs53gFZzEVZg==

"@sindresorhus/is@^4", "@sindresorhus/is@^4.0.0":
version "4.6.0"
Expand Down
Loading