Skip to content

Commit

Permalink
Always use project deploy start --dry-run for deployment validation…
Browse files Browse the repository at this point in the history
…, until command `project deploy validate` works with --ignore-warnings & NoTestRun (#796)
  • Loading branch information
nvuillam authored Sep 23, 2024
1 parent f191d7b commit d6cad4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

Note: Can be used with `sfdx plugins:install sfdx-hardis@beta` and docker image `hardisgroupcom/sfdx-hardis@beta`

## [5.0.1] 2024-09-23

- Always use `project deploy start --dry-run` for deployment validation, until command `project deploy validate` works with --ignore-warnings & NoTestRun

## [5.0.0] 2024-09-23

### Refactoring explanations
Expand Down
8 changes: 5 additions & 3 deletions src/common/utils/deployUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,12 @@ export async function smartDeploy(
const branchConfig = await getConfig('branch');
const deployCommand =
`sf project deploy` +
(check && testlevel !== 'NoTestRun' ? ' validate' : ' start') +
(check && testlevel === 'NoTestRun' ? ' --dry-run' : '') + // validate with NoTestRun does not work, so use --dry-run
// (check && testlevel !== 'NoTestRun' ? ' validate' : ' start') + // Not until validate command is correct and accepts ignore-warnings
' start' +
// (check && testlevel === 'NoTestRun' ? ' --dry-run' : '') + // validate with NoTestRun does not work, so use --dry-run
(check ? ' --dry-run' : '') +
` --manifest "${deployment.packageXmlFile}"` +
(check === false ? ' --ignore-warnings' : '') + // So it does not fail in for objectTranslations stuff for example
' --ignore-warnings' + // So it does not fail in for objectTranslations stuff for example
` --test-level ${testlevel}` +
(options.testClasses && testlevel !== 'NoTestRun' ? ` --tests ${options.testClasses}` : '') +
(options.preDestructiveChanges ? ` --pre-destructive-changes ${options.preDestructiveChanges}` : '') +
Expand Down

0 comments on commit d6cad4f

Please sign in to comment.