Skip to content

Commit 4202058

Browse files
help: put back the long param descriptions for force:source:deploy (#181)
* fix: put back long parameter descriptions * fix: add back the param long descriptions * put all long descriptions in flagsLong object as per Shane's review * use new flagsLong object
1 parent 6687142 commit 4202058

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

messages/deploy.json

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"description": "deploy source to an org Use this command to deploy source (metadata that’s in source format) to an org.\nTo take advantage of change tracking with scratch orgs, use \"sfdx force:source:push\".\nTo deploy metadata that’s in metadata format, use \"sfdx force:mdapi:deploy\".\n\nThe source you deploy overwrites the corresponding metadata in your org. This command does not attempt to merge your source with the versions in your org.\n\nTo run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue to use the CLI.\nTo check the status of the job, use force:source:deploy:report.\n\nIf the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose the entire list in one set of double quotes.\n",
2+
"description": "deploy source to an org\nUse this command to deploy source (metadata that’s in source format) to an org.\nTo take advantage of change tracking with scratch orgs, use \"sfdx force:source:push\".\nTo deploy metadata that’s in metadata format, use \"sfdx force:mdapi:deploy\".\n\nThe source you deploy overwrites the corresponding metadata in your org. This command does not attempt to merge your source with the versions in your org.\n\nTo run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue to use the CLI.\nTo check the status of the job, use force:source:deploy:report.\n\nIf the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose the entire list in one set of double quotes.\n",
33
"examples": [
44
"To deploy the source files in a directory:\n\t $ sfdx force:source:deploy -p path/to/source",
55
"To deploy a specific Apex class and the objects whose source is in a directory: \n\t$ sfdx force:source:deploy -p \"path/to/apex/classes/MyClass.cls,path/to/source/objects\"",
@@ -27,6 +27,48 @@
2727
"validateDeployRequestId": "deploy request ID of the validated deployment to run a Quick Deploy",
2828
"soapDeploy": "deploy metadata with SOAP API instead of REST API"
2929
},
30+
"flagsLong": {
31+
"sourcePath": [
32+
"A comma-separated list of paths to the local source files to deploy. The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder (in which case the operation is applied to all metadata types in the directory and its sub-directories).",
33+
"If you specify this parameter, don’t specify --manifest or --metadata."
34+
],
35+
"manifest": [
36+
"The complete path for the manifest (package.xml) file that specifies the components to deploy. All child components are included.",
37+
"If you specify this parameter, don’t specify --metadata or --sourcepath."
38+
],
39+
"metadata": [
40+
"A comma-separated list of names of metadata components to deploy to the org.",
41+
"If you specify this parameter, don’t specify --manifest or --sourcepath."
42+
],
43+
"wait": "Number of minutes to wait for the command to complete and display results to the terminal window. If the command continues to run after the wait period, the CLI returns control of the terminal window to you. ",
44+
"checkonly": [
45+
"Validates the deployed metadata and runs all Apex tests, but prevents the deployment from being saved to the org.",
46+
"If you change a field type from Master-Detail to Lookup or vice versa, that change isn’t supported when using the --checkonly parameter to test a deployment (validation). This kind of change isn’t supported for test deployments to avoid the risk of data loss or corruption. If a change that isn’t supported for test deployments is included in a deployment package, the test deployment fails and issues an error.",
47+
"If your deployment package changes a field type from Master-Detail to Lookup or vice versa, you can still validate the changes prior to deploying to Production by performing a full deployment to another test Sandbox. A full deployment includes a validation of the changes as part of the deployment process.",
48+
"Note: A Metadata API deployment that includes Master-Detail relationships deletes all detail records in the Recycle Bin in the following cases.",
49+
"1. For a deployment with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before proceeding to deploy the Master-Detail field, or the deployment fails. During the deployment, detail records are permanently deleted from the Recycle Bin and cannot be recovered.",
50+
"2. For a deployment that converts a Lookup field relationship to a Master-Detail relationship, detail records must reference a master record or be soft-deleted (sent to the Recycle Bin) for the deployment to succeed. However, a successful deployment permanently deletes any detail records in the Recycle Bin."
51+
],
52+
"testLevel": [
53+
"Specifies which level of deployment tests to run. Valid values are:",
54+
" NoTestRun—No tests are run. This test level applies only to deployments to development environments, such as sandbox, Developer Edition, or trial orgs. This test level is the default for development environments.",
55+
" RunSpecifiedTests—Runs only the tests that you specify in the --runtests option. Code coverage requirements differ from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75% code coverage for each class and trigger in the deployment package. This coverage is computed for each class and trigger individually and is different than the overall coverage percentage.",
56+
" RunLocalTests—All tests in your org are run, except the ones that originate from installed managed packages. This test level is the default for production deployments that include Apex classes or triggers.",
57+
" RunAllTestsInOrg—All tests in your org are run, including tests of managed packages.",
58+
"If you don’t specify a test level, the default behavior depends on the contents of your deployment package. For more information, see “Running Tests in a Deployment” in the Metadata API Developer Guide."
59+
],
60+
"runTests": "Lists the Apex classes containing the deployment tests to run. Use this parameter when you set --testlevel to RunSpecifiedTests.",
61+
"ignoreErrors": "Ignores the deploy errors, and continues with the deploy operation. The default is false. Keep this parameter set to false when deploying to a production org. If set to true, components without errors are deployed, and components with errors are skipped.",
62+
"ignoreWarnings": "If a warning occurs and ignoreWarnings is set to true, the success field in DeployMessage is true. When ignoreWarnings is set to false, success is set to false, and the warning is treated like an error.",
63+
"validateDeployRequestId": [
64+
"Specifies the ID of a package with recently validated components to run a Quick Deploy. Deploying a validation helps you shorten your deployment time because tests aren’t rerun. If you have a recent successful validation, you can deploy the validated components without running tests. A validation doesn’t save any components in the org. You use a validation only to check the success or failure messages that you would receive with an actual deployment. To validate your components, add the -c | --checkonly flag when you run \"sfdx force:mdapi:deploy\". This flag sets the checkOnly=\"true\" parameter for your deployment. Before deploying a recent validation, ensure that the following requirements are met:",
65+
" 1. The components have been validated successfully for the target environment within the last 10 days.",
66+
" 2. As part of the validation, Apex tests in the target org have passed.",
67+
" 3. Code coverage requirements are met.",
68+
" - If all tests in the org or all local tests are run, overall code coverage is at least 75%, and Apex triggers have some coverage.",
69+
" - If specific tests are run with the RunSpecifiedTests test level, each class and trigger that was deployed is covered by at least 75% individually."
70+
]
71+
},
3072
"MissingRequiredParam": "Missing one of the following parameters: %s",
3173
"checkOnlySuccess": "Successfully validated the deployment. %s components deployed and %s tests run.\nUse the --verbose parameter to see detailed output.",
3274
"MissingDeployId": "No deploy ID was provided or found in deploy history",

src/commands/force/source/deploy.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export class Deploy extends DeployCommand {
3535
checkonly: flags.boolean({
3636
char: 'c',
3737
description: messages.getMessage('flags.checkonly'),
38+
longDescription: messages.getMessage('flagsLong.checkonly'),
3839
}),
3940
soapdeploy: flags.boolean({
4041
default: false,
@@ -45,29 +46,35 @@ export class Deploy extends DeployCommand {
4546
default: Duration.minutes(Deploy.DEFAULT_SRC_WAIT_MINUTES),
4647
min: Duration.minutes(0), // wait=0 means deploy is asynchronous
4748
description: messages.getMessage('flags.wait'),
49+
longDescription: messages.getMessage('flagsLong.wait'),
4850
}),
4951
testlevel: flags.enum({
5052
char: 'l',
5153
description: messages.getMessage('flags.testLevel'),
54+
longDescription: messages.getMessage('flagsLong.testLevel'),
5255
options: ['NoTestRun', 'RunSpecifiedTests', 'RunLocalTests', 'RunAllTestsInOrg'],
5356
default: 'NoTestRun',
5457
}),
5558
runtests: flags.array({
5659
char: 'r',
5760
description: messages.getMessage('flags.runTests'),
61+
longDescription: messages.getMessage('flagsLong.runTests'),
5862
default: [],
5963
}),
6064
ignoreerrors: flags.boolean({
6165
char: 'o',
6266
description: messages.getMessage('flags.ignoreErrors'),
67+
longDescription: messages.getMessage('flagsLong.ignoreErrors'),
6368
}),
6469
ignorewarnings: flags.boolean({
6570
char: 'g',
6671
description: messages.getMessage('flags.ignoreWarnings'),
72+
longDescription: messages.getMessage('flagsLong.ignoreWarnings'),
6773
}),
6874
validateddeployrequestid: flags.id({
6975
char: 'q',
7076
description: messages.getMessage('flags.validateDeployRequestId'),
77+
longDescription: messages.getMessage('flagsLong.validateDeployRequestId'),
7178
exclusive: [
7279
'manifest',
7380
'metadata',
@@ -85,16 +92,19 @@ export class Deploy extends DeployCommand {
8592
metadata: flags.array({
8693
char: 'm',
8794
description: messages.getMessage('flags.metadata'),
95+
longDescription: messages.getMessage('flagsLong.metadata'),
8896
exclusive: ['manifest', 'sourcepath'],
8997
}),
9098
sourcepath: flags.array({
9199
char: 'p',
92100
description: messages.getMessage('flags.sourcePath'),
101+
longDescription: messages.getMessage('flagsLong.sourcePath'),
93102
exclusive: ['manifest', 'metadata'],
94103
}),
95104
manifest: flags.filepath({
96105
char: 'x',
97106
description: messages.getMessage('flags.manifest'),
107+
longDescription: messages.getMessage('flagsLong.manifest'),
98108
exclusive: ['metadata', 'sourcepath'],
99109
}),
100110
};

0 commit comments

Comments
 (0)