Skip to content

Commit

Permalink
Merge branch 'main' into prerelease/beta
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 7, 2024
2 parents 7d558b6 + a4d3848 commit 6d092eb
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 111 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [3.12.17](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/3.12.16...3.12.17) (2024-10-05)

### Bug Fixes

- **deps:** bump @salesforce/source-deploy-retrieve from 12.7.3 to 12.7.4 ([174b993](https://github.com/salesforcecli/plugin-deploy-retrieve/commit/174b993cb595a6d69a610c6548eb18a55e48925f))

## [3.12.16](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/3.12.15...3.12.16) (2024-10-02)

### Bug Fixes

- fix generated code coverage result percent ([#1175](https://github.com/salesforcecli/plugin-deploy-retrieve/issues/1175)) ([d4cdac1](https://github.com/salesforcecli/plugin-deploy-retrieve/commit/d4cdac1bbc321ed334955f335a7f85f6e81aacb8))

## [3.12.15](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/3.12.14...3.12.15) (2024-10-01)

### Bug Fixes

- bump SDR [skip-validate-pr] ([582b2d1](https://github.com/salesforcecli/plugin-deploy-retrieve/commit/582b2d1d3ed2ccf1849ee28037a57c6c823de0b3))

## [3.12.14](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/3.12.13...3.12.14) (2024-09-28)

### Bug Fixes
Expand Down
74 changes: 40 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,29 @@ sf plugins

<!-- commands -->

- [`sf project convert mdapi`](#sf-project-convert-mdapi)
- [`sf project convert source`](#sf-project-convert-source)
- [`sf project convert source-behavior`](#sf-project-convert-source-behavior)
- [`sf project delete source`](#sf-project-delete-source)
- [`sf project delete tracking`](#sf-project-delete-tracking)
- [`sf project deploy cancel`](#sf-project-deploy-cancel)
- [`sf project deploy preview`](#sf-project-deploy-preview)
- [`sf project deploy quick`](#sf-project-deploy-quick)
- [`sf project deploy report`](#sf-project-deploy-report)
- [`sf project deploy resume`](#sf-project-deploy-resume)
- [`sf project deploy start`](#sf-project-deploy-start)
- [`sf project deploy validate`](#sf-project-deploy-validate)
- [`sf project generate manifest`](#sf-project-generate-manifest)
- [`sf project list ignored`](#sf-project-list-ignored)
- [`sf project reset tracking`](#sf-project-reset-tracking)
- [`sf project retrieve preview`](#sf-project-retrieve-preview)
- [`sf project retrieve start`](#sf-project-retrieve-start)
- [plugin-deploy-retrieve](#plugin-deploy-retrieve)
- [Install](#install)
- [Contributing](#contributing)
- [CLA](#cla)
- [Build](#build)
- [Commands](#commands)
- [`sf project convert mdapi`](#sf-project-convert-mdapi)
- [`sf project convert source`](#sf-project-convert-source)
- [`sf project convert source-behavior`](#sf-project-convert-source-behavior)
- [`sf project delete source`](#sf-project-delete-source)
- [`sf project delete tracking`](#sf-project-delete-tracking)
- [`sf project deploy cancel`](#sf-project-deploy-cancel)
- [`sf project deploy preview`](#sf-project-deploy-preview)
- [`sf project deploy quick`](#sf-project-deploy-quick)
- [`sf project deploy report`](#sf-project-deploy-report)
- [`sf project deploy resume`](#sf-project-deploy-resume)
- [`sf project deploy start`](#sf-project-deploy-start)
- [`sf project deploy validate`](#sf-project-deploy-validate)
- [`sf project generate manifest`](#sf-project-generate-manifest)
- [`sf project list ignored`](#sf-project-list-ignored)
- [`sf project reset tracking`](#sf-project-reset-tracking)
- [`sf project retrieve preview`](#sf-project-retrieve-preview)
- [`sf project retrieve start`](#sf-project-retrieve-start)

## `sf project convert mdapi`

Expand Down Expand Up @@ -141,7 +147,7 @@ FLAG DESCRIPTIONS
If you specify this parameter, don’t specify --metadata or --source-dir.
```

_See code: [src/commands/project/convert/mdapi.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/convert/mdapi.ts)_
_See code: [src/commands/project/convert/mdapi.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/convert/mdapi.ts)_

## `sf project convert source`

Expand Down Expand Up @@ -214,7 +220,7 @@ FLAG DESCRIPTIONS
Override the api version used for api requests made by this command
```

_See code: [src/commands/project/convert/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/convert/source.ts)_
_See code: [src/commands/project/convert/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/convert/source.ts)_

## `sf project convert source-behavior`

Expand Down Expand Up @@ -272,7 +278,7 @@ EXAMPLES
$ sf project convert source-behavior --behavior decomposePermissionSetBeta --dry-run --preserve-temp-dir
```

_See code: [src/commands/project/convert/source-behavior.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/convert/source-behavior.ts)_
_See code: [src/commands/project/convert/source-behavior.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/convert/source-behavior.ts)_

## `sf project delete source`

Expand Down Expand Up @@ -412,7 +418,7 @@ FLAG DESCRIPTIONS
- Separate the test names with spaces: --tests Test1 Test2 "Test With Space"
```

_See code: [src/commands/project/delete/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/delete/source.ts)_
_See code: [src/commands/project/delete/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/delete/source.ts)_

## `sf project delete tracking`

Expand Down Expand Up @@ -449,7 +455,7 @@ EXAMPLES
$ sf project delete tracking --target-org my-scratch
```

_See code: [src/commands/project/delete/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/delete/tracking.ts)_
_See code: [src/commands/project/delete/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/delete/tracking.ts)_

## `sf project deploy cancel`

Expand Down Expand Up @@ -521,7 +527,7 @@ FLAG DESCRIPTIONS
project deploy report".
```

_See code: [src/commands/project/deploy/cancel.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/deploy/cancel.ts)_
_See code: [src/commands/project/deploy/cancel.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/deploy/cancel.ts)_

## `sf project deploy preview`

Expand Down Expand Up @@ -604,7 +610,7 @@ FLAG DESCRIPTIONS
All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
```

_See code: [src/commands/project/deploy/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/deploy/preview.ts)_
_See code: [src/commands/project/deploy/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/deploy/preview.ts)_

## `sf project deploy quick`

Expand Down Expand Up @@ -688,7 +694,7 @@ FLAG DESCRIPTIONS
deploy report".
```

_See code: [src/commands/project/deploy/quick.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/deploy/quick.ts)_
_See code: [src/commands/project/deploy/quick.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/deploy/quick.ts)_

## `sf project deploy report`

Expand Down Expand Up @@ -780,7 +786,7 @@ FLAG DESCRIPTIONS
--coverage-formatters lcov --coverage-formatters clover
```

_See code: [src/commands/project/deploy/report.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/deploy/report.ts)_
_See code: [src/commands/project/deploy/report.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/deploy/report.ts)_

## `sf project deploy resume`

Expand Down Expand Up @@ -865,7 +871,7 @@ FLAG DESCRIPTIONS
--coverage-formatters lcov --coverage-formatters clover
```

_See code: [src/commands/project/deploy/resume.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/deploy/resume.ts)_
_See code: [src/commands/project/deploy/resume.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/deploy/resume.ts)_

## `sf project deploy start`

Expand Down Expand Up @@ -1101,7 +1107,7 @@ FLAG DESCRIPTIONS
--coverage-formatters lcov --coverage-formatters clover
```

_See code: [src/commands/project/deploy/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/deploy/start.ts)_
_See code: [src/commands/project/deploy/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/deploy/start.ts)_

## `sf project deploy validate`

Expand Down Expand Up @@ -1274,7 +1280,7 @@ FLAG DESCRIPTIONS
--coverage-formatters lcov --coverage-formatters clover
```

_See code: [src/commands/project/deploy/validate.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/deploy/validate.ts)_
_See code: [src/commands/project/deploy/validate.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/deploy/validate.ts)_

## `sf project generate manifest`

Expand Down Expand Up @@ -1351,7 +1357,7 @@ EXAMPLES
$ sf project generate manifest --from-org [email protected] --include-packages unlocked
```

_See code: [src/commands/project/generate/manifest.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/generate/manifest.ts)_
_See code: [src/commands/project/generate/manifest.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/generate/manifest.ts)_

## `sf project list ignored`

Expand Down Expand Up @@ -1393,7 +1399,7 @@ EXAMPLES
$ sf project list ignored --source-dir package.xml
```

_See code: [src/commands/project/list/ignored.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/list/ignored.ts)_
_See code: [src/commands/project/list/ignored.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/list/ignored.ts)_

## `sf project reset tracking`

Expand Down Expand Up @@ -1442,7 +1448,7 @@ EXAMPLES
$ sf project reset tracking --revision 30
```

_See code: [src/commands/project/reset/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/reset/tracking.ts)_
_See code: [src/commands/project/reset/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/reset/tracking.ts)_

## `sf project retrieve preview`

Expand Down Expand Up @@ -1496,7 +1502,7 @@ FLAG DESCRIPTIONS
production orgs.
```

_See code: [src/commands/project/retrieve/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/retrieve/preview.ts)_
_See code: [src/commands/project/retrieve/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/retrieve/preview.ts)_

## `sf project retrieve start`

Expand Down Expand Up @@ -1665,6 +1671,6 @@ FLAG DESCRIPTIONS
If you specify this parameter, don’t specify --metadata or --source-dir.
```

_See code: [src/commands/project/retrieve/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.15-dev.0/src/commands/project/retrieve/start.ts)_
_See code: [src/commands/project/retrieve/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.12.17/src/commands/project/retrieve/start.ts)_

<!-- commandsstop -->
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/plugin-deploy-retrieve",
"description": "deploy and retrieve commands for sf",
"version": "3.12.15-dev.0",
"version": "3.12.17",
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
Expand All @@ -12,21 +12,21 @@
"@salesforce/kit": "^3.2.3",
"@salesforce/plugin-info": "^3.4.9",
"@salesforce/sf-plugins-core": "^11.3.2",
"@salesforce/source-deploy-retrieve": "^12.6.3",
"@salesforce/source-deploy-retrieve": "^12.7.4",
"@salesforce/source-tracking": "^7.1.16",
"@salesforce/ts-types": "^2.0.12",
"ansis": "^3.3.2"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.2.15",
"@oclif/plugin-command-snapshot": "^5.2.17",
"@salesforce/cli-plugins-testkit": "^5.3.32",
"@salesforce/dev-scripts": "^10.2.10",
"@salesforce/plugin-command-reference": "^3.1.26",
"@salesforce/plugin-command-reference": "^3.1.27",
"@salesforce/schemas": "^1.9.0",
"@salesforce/source-testkit": "^2.2.57",
"@salesforce/ts-sinon": "^1.4.24",
"cross-env": "^7.0.3",
"eslint-plugin-sf-plugin": "^1.20.6",
"eslint-plugin-sf-plugin": "^1.20.8",
"oclif": "^4.14.27",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
Expand Down
4 changes: 2 additions & 2 deletions src/utils/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export const mapTestResults = <T extends Failures | Successes>(testResults: T[])
}));

export const generateCoveredLines = (cov: CodeCoverage): [number[], number[]] => {
const [lineCount, uncoveredLineCount] = getCoverageNumbers(cov);
const [lineCount] = getCoverageNumbers(cov);
const uncoveredLines = ensureArray(cov.locationsNotCovered).map((location) => parseInt(location.line, 10));
const minLineNumber = uncoveredLines.length ? Math.min(...uncoveredLines) : 1;
const lines = [...Array(lineCount + uncoveredLineCount).keys()].map((i) => i + minLineNumber);
const lines = [...Array(lineCount).keys()].map((i) => i + minLineNumber);
const coveredLines = lines.filter((line) => !uncoveredLines.includes(line));
return [uncoveredLines, coveredLines];
};
Expand Down
5 changes: 4 additions & 1 deletion test/utils/coverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { expect } from 'chai';
import { ApexTestResultOutcome } from '@salesforce/apex-node';
import { StandardColors } from '@salesforce/sf-plugins-core';
import { coverageOutput, getCoveragePct, mapTestResults } from '../../src/utils/coverage.js';
import { coverageOutput, generateCoveredLines, getCoveragePct, mapTestResults } from '../../src/utils/coverage.js';

// methods are mutating the object instead of returning new ones
function getSampleTestResult() {
Expand Down Expand Up @@ -373,6 +373,9 @@ describe('coverage utils', () => {
it('1 uncovered of 4', () => {
expect(getCoveragePct(getSampleTestResult().codeCoverage[0])).equal(75);
});
it('will generate covered lines correctly', () => {
expect(generateCoveredLines(getSampleTestResult().codeCoverage[0])).to.deep.equal([[12], [13, 14, 15]]);
});
it('rounds 3 uncovered out of 44 to the nearest integer', () => {
expect(getCoveragePct(getSampleTestResult().codeCoverage[1])).equal(93);
});
Expand Down
Loading

0 comments on commit 6d092eb

Please sign in to comment.