Skip to content

Commit

Permalink
Wr/deploy recent validation (#46)
Browse files Browse the repository at this point in the history
* fix: add initial rest vs soap options

* fix: add the validateddeployrequestid flag option

* fix: update message

* fix: resolve conflicts

Co-authored-by: Steve Hetzel <[email protected]>
  • Loading branch information
WillieRuemmele and shetzel authored Apr 5, 2021
1 parent 1ccaba2 commit 928be88
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 47 deletions.
1 change: 1 addition & 0 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"manifest",
"metadata",
"runtests",
"soapdeploy",
"sourcepath",
"targetusername",
"testlevel",
Expand Down
3 changes: 2 additions & 1 deletion messages/deploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"runTests": "tests to run if --testlevel RunSpecifiedTests",
"ignoreErrors": "ignore any errors and do not roll back deployment",
"ignoreWarnings": "whether a warning will allow a deployment to complete successfully",
"validateDeployRequestId": "request ID of the validated deployment to run a Quick Deploy"
"validateDeployRequestId": "request ID of the validated deployment to run a Quick Deploy",
"soapDeploy": "deploy metadata with SOAP API instead of REST API"
},
"checkOnlySuccess": "\nSuccessfully validated the deployment"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@oclif/config": "^1",
"@salesforce/command": "^3.1.0",
"@salesforce/core": "^2.20.5",
"@salesforce/core": "^2.20.8",
"@salesforce/source-deploy-retrieve": "1.1.21",
"chalk": "^4.1.0",
"tslib": "^2"
Expand Down
19 changes: 13 additions & 6 deletions src/commands/force/source/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { flags, FlagsConfig } from '@salesforce/command';
import { Lifecycle, Messages } from '@salesforce/core';
import { DeployResult } from '@salesforce/source-deploy-retrieve';
import { Duration } from '@salesforce/kit';
import { asString, asArray, getBoolean } from '@salesforce/ts-types';
import { asString, asArray, getBoolean, JsonCollection } from '@salesforce/ts-types';
import * as chalk from 'chalk';
import { SourceCommand } from '../../../sourceCommand';

Expand All @@ -28,6 +28,10 @@ export class Deploy extends SourceCommand {
char: 'c',
description: messages.getMessage('flags.checkonly'),
}),
soapdeploy: flags.boolean({
default: false,
description: messages.getMessage('flags.soapDeploy'),
}),
wait: flags.minutes({
char: 'w',
default: Duration.minutes(SourceCommand.DEFAULT_SRC_WAIT_MINUTES),
Expand Down Expand Up @@ -88,13 +92,16 @@ export class Deploy extends SourceCommand {
};
protected readonly lifecycleEventNames = ['predeploy', 'postdeploy'];

public async run(): Promise<DeployResult> {
if (this.flags.validatedeployrequestid) {
// TODO: return this.doDeployRecentValidation();
throw Error('NOT IMPLEMENTED YET');
public async run(): Promise<DeployResult | JsonCollection> {
if (this.flags.validateddeployrequestid) {
const conn = this.org.getConnection();
return conn.deployRecentValidation({
id: this.flags.validateddeployrequestid as string,
rest: !this.flags.soapdeploy,
});
}
const hookEmitter = Lifecycle.getInstance();

const hookEmitter = Lifecycle.getInstance();
const cs = await this.createComponentSet({
sourcepath: asArray<string>(this.flags.sourcepath),
manifest: asString(this.flags.manifest),
Expand Down
78 changes: 39 additions & 39 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@

"@salesforce/[email protected]":
version "0.1.21"
resolved "https://registry.yarnpkg.com/@salesforce/apex-node/-/apex-node-0.1.21.tgz#684766f05a896a5c0d7fdc282eb71000f17aeed2"
resolved "https://registry.npmjs.org/@salesforce/apex-node/-/apex-node-0.1.21.tgz#684766f05a896a5c0d7fdc282eb71000f17aeed2"
integrity sha512-fKMrfDIB6Vn1lP5LCg+FUlVMhuIpnKVq8OTca8/W2nQf6W+KrqVctpDRNXEMxK2Jd25uGcoGA+vc+IM6AH+Dqw==
dependencies:
"@salesforce/core" "2.13.0"
Expand Down Expand Up @@ -616,10 +616,10 @@
mkdirp "1.0.4"
sfdx-faye "^1.0.9"

"@salesforce/core@^2.15.2", "@salesforce/core@^2.16.3", "@salesforce/core@^2.2.0", "@salesforce/core@^2.20.3", "@salesforce/core@^2.20.5", "@salesforce/core@^2.6.0":
version "2.20.5"
resolved "https://registry.npmjs.org/@salesforce/core/-/core-2.20.5.tgz#043d4aa6fb7ffc5270fc69fbec08aa1a52a2f2b7"
integrity sha512-hB4o4TuOGJo01rLmx84nf6KFGizDqLo5bmQ8bFlMZw5xKeQaP1Jc74se6hj+6eI5Nx331EvbD+YHphsuLbaJjQ==
"@salesforce/core@^2.15.2", "@salesforce/core@^2.16.3", "@salesforce/core@^2.2.0", "@salesforce/core@^2.20.3", "@salesforce/core@^2.20.8", "@salesforce/core@^2.6.0":
version "2.20.8"
resolved "https://registry.npmjs.org/@salesforce/core/-/core-2.20.8.tgz#7767c2fc19c7663a803e9d0092f102dabdc23a0d"
integrity sha512-7bhpj95SS7EDtKOwAnpoBu4zreooI2PUKbIQPCfK2yx1Tl/sm4j5FrE44wl33j3QA0GUwk93VSj6RNNDHB9VLw==
dependencies:
"@salesforce/bunyan" "^2.0.0"
"@salesforce/kit" "^1.4.3"
Expand Down Expand Up @@ -692,7 +692,7 @@

"@salesforce/plugin-apex@^0.1.18":
version "0.1.21"
resolved "https://registry.yarnpkg.com/@salesforce/plugin-apex/-/plugin-apex-0.1.21.tgz#ee71324ef98f070c301192bcf458b318873a3b25"
resolved "https://registry.npmjs.org/@salesforce/plugin-apex/-/plugin-apex-0.1.21.tgz#ee71324ef98f070c301192bcf458b318873a3b25"
integrity sha512-z0jr/hk+rkf4GLxS4E566qoZiRTs0llPjCxtbAef52JASMZ8v43B+UHrDT1xtn9QceHywUmRQzc5ilpzltEhnQ==
dependencies:
"@oclif/command" "^1"
Expand Down Expand Up @@ -754,7 +754,7 @@

"@salesforce/[email protected]":
version "1.3.5"
resolved "https://registry.yarnpkg.com/@salesforce/ts-sinon/-/ts-sinon-1.3.5.tgz#23ed0d956657bf71aec413d0c0ff79b7666a7ad7"
resolved "https://registry.npmjs.org/@salesforce/ts-sinon/-/ts-sinon-1.3.5.tgz#23ed0d956657bf71aec413d0c0ff79b7666a7ad7"
integrity sha512-Zp92SW5IrxAman3G61jhxDiJX+SrvYtfiNKhXi/nGKNk5Utbq0O2KfbjPomqk4vVvhUheZpnHUdN/y/XaxRsoA==
dependencies:
"@salesforce/ts-types" "^1.5.5"
Expand Down Expand Up @@ -821,9 +821,9 @@
integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==

"@types/chai@*", "@types/chai@^4.2.11":
version "4.2.15"
resolved "https://registry.npmjs.org/@types/chai/-/chai-4.2.15.tgz#b7a6d263c2cecf44b6de9a051cf496249b154553"
integrity sha512-rYff6FI+ZTKAPkJUoyz7Udq3GaoDZnxYDEvdEdFZASiA7PoErltHezDishqQiSDWrGxvxmplH304jyzQmjp0AQ==
version "4.2.16"
resolved "https://registry.npmjs.org/@types/chai/-/chai-4.2.16.tgz#f09cc36e18d28274f942e7201147cce34d97e8c8"
integrity sha512-vI5iOAsez9+roLS3M3+Xx7w+WRuDtSmF8bQkrbcIJ2sC1PcDgVoA0WGpa+bIrJ+y8zqY2oi//fUctkxtIcXJCw==

"@types/debug@^4.1.5":
version "4.1.5"
Expand Down Expand Up @@ -1542,9 +1542,9 @@ camelcase@^6.0.0:
integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==

caniuse-lite@^1.0.30001181:
version "1.0.30001205"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz#d79bf6a6fb13196b4bb46e5143a22ca0242e0ef8"
integrity sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og==
version "1.0.30001207"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001207.tgz#364d47d35a3007e528f69adb6fecb07c2bb2cc50"
integrity sha512-UPQZdmAsyp2qfCTiMU/zqGSWOYaY9F9LL61V8f+8MrubsaDGpaHD9HRV/EWZGULZn0Hxu48SKzI5DgFwTvHuYw==

cardinal@^2.1.1:
version "2.1.1"
Expand Down Expand Up @@ -2336,9 +2336,9 @@ [email protected]:
safe-buffer "^5.0.1"

electron-to-chromium@^1.3.649:
version "1.3.705"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.705.tgz#9729956782ce44cd93bdb4197818cff71f7d5e9d"
integrity sha512-agtrL5vLSOIK89sE/YSzAgqCw76eZ60gf3J7Tid5RfLbSp5H4nWL28/dIV+H+ZhNNi1JNiaF62jffwYsAyXc0g==
version "1.3.707"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.707.tgz#71386d0ceca6727835c33ba31f507f6824d18c35"
integrity sha512-BqddgxNPrcWnbDdJw7SzXVzPmp+oiyjVrc7tkQVaznPGSS9SKZatw6qxoP857M+HbOyyqJQwYQtsuFIMSTNSZA==

"emoji-regex@>=6.0.0 <=6.1.1":
version "6.1.1"
Expand Down Expand Up @@ -3422,9 +3422,9 @@ [email protected]:
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==

highlight.js@^10.0.0:
version "10.7.1"
resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.1.tgz#a8ec4152db24ea630c90927d6cae2a45f8ecb955"
integrity sha512-S6G97tHGqJ/U8DsXcEdnACbirtbx58Bx9CzIVeYli8OuswCfYI/LsXH2EiGcoGio1KAC3x4mmUwulOllJ2ZyRA==
version "10.7.2"
resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.2.tgz#89319b861edc66c48854ed1e6da21ea89f847360"
integrity sha512-oFLl873u4usRM9K63j4ME9u3etNF0PLiJhSQ8rdfuL51Wn3zkD6drf9ZW0dOzjnZI22YYG24z30JcmfCZjMgYg==

homedir-polyfill@^1.0.1:
version "1.0.3"
Expand Down Expand Up @@ -3708,9 +3708,9 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2:
kind-of "^6.0.2"

is-docker@^2.0.0:
version "2.1.1"
resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156"
integrity sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==
version "2.2.0"
resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.0.tgz#b037c8815281edaad6c2562648a5f5f18839d5f7"
integrity sha512-K4GwB4i/HzhAzwP/XSlspzRdFTI9N8OxJOyOU7Y5Rz+p+WBokXWVWblaJeBkggthmoSV0OoGTH5thJNvplpkvQ==

is-extendable@^0.1.0, is-extendable@^0.1.1:
version "0.1.1"
Expand Down Expand Up @@ -4146,9 +4146,9 @@ jsprim@^1.2.2:
verror "1.10.0"

just-extend@^4.0.2:
version "4.1.1"
resolved "https://registry.npmjs.org/just-extend/-/just-extend-4.1.1.tgz#158f1fdb01f128c411dc8b286a7b4837b3545282"
integrity sha512-aWgeGFW67BP3e5181Ep1Fv2v8z//iBJfrvyTnq8wG86vEESwmonn1zPBJ0VfmT9CJq2FIT0VsETtrNFm2a+SHA==
version "4.2.1"
resolved "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz#ef5e589afb61e5d66b24eca749409a8939a8c744"
integrity sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==

jwa@^1.4.1:
version "1.4.1"
Expand Down Expand Up @@ -4243,9 +4243,9 @@ listenercount@~1.0.1:
integrity sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc=

listr2@^3.2.2:
version "3.4.4"
resolved "https://registry.npmjs.org/listr2/-/listr2-3.4.4.tgz#5bb5e0107cc9a8787dcfb5d302c88cbddcdba248"
integrity sha512-okQwtieCHDX5erlxcEn2xwNfVQhV+/YiD+U0v+6DQamXnknE7mc6B5fopHl96v1PuZjTpaoChctf96PB6K4XRg==
version "3.5.0"
resolved "https://registry.npmjs.org/listr2/-/listr2-3.5.0.tgz#09353bbf76b4f97de0b6abf099db2aa3f0ae1ef2"
integrity sha512-97a1ZegjnsGIKfU2PtoE/RFrbYTb7bWb5wzq8ikFOVgOwjCjkJhAaJ+lNQEH25YvrzzKRS+522WkR4OZ9mfhdA==
dependencies:
chalk "^4.1.0"
cli-truncate "^2.1.0"
Expand Down Expand Up @@ -4586,17 +4586,17 @@ micromatch@^4.0.2:
braces "^3.0.1"
picomatch "^2.0.5"

mime-db@1.46.0:
version "1.46.0"
resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz#6267748a7f799594de3cbc8cde91def349661cee"
integrity sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==
mime-db@1.47.0:
version "1.47.0"
resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c"
integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==

mime-types@^2.1.12, mime-types@~2.1.19:
version "2.1.29"
resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz#1d4ab77da64b91f5f72489df29236563754bb1b2"
integrity sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==
version "2.1.30"
resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d"
integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==
dependencies:
mime-db "1.46.0"
mime-db "1.47.0"

[email protected]:
version "2.4.6"
Expand Down Expand Up @@ -6894,9 +6894,9 @@ y18n@^4.0.0:
integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==

y18n@^5.0.5:
version "5.0.5"
resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18"
integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==
version "5.0.6"
resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.6.tgz#8236b05cfc5af6a409f41326a4847c68989bb04f"
integrity sha512-PlVX4Y0lDTN6E2V4ES2tEdyvXkeKzxa8c/vo0pxPr/TqbztddTP0yn7zZylIyiAuxerqj0Q5GhpJ1YJCP8LaZQ==

yallist@^4.0.0:
version "4.0.0"
Expand Down

0 comments on commit 928be88

Please sign in to comment.