Skip to content

Commit

Permalink
fix: add back missing long parameter descriptions for some force:sour…
Browse files Browse the repository at this point in the history
…ce commands (#241)

* fix: add parameter long descriptions back for retrieve

* update messages file

* help: add long descs to retrieve.ts

* add long descs to convert.json

* fix: add long desc to delete.json

* add long descs to delete.ts

* add long desc to cancel.json

* add long desc to cancel.ts

* add long desc to report.ts

* add long desc to report.json

* fix syntax

* fix syntax

* style: formatting of messages json

Co-authored-by: mshanemc <[email protected]>
  • Loading branch information
jshackell-sfdc and mshanemc authored Oct 5, 2021
1 parent 3fdd815 commit d87671b
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 6 deletions.
3 changes: 3 additions & 0 deletions messages/cancel.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"flags": {
"wait": "wait time for command to finish in minutes",
"jobid": "job ID of the deployment you want to cancel; defaults to your most recent CLI deployment if not specified"
},
"flagsLong": {
"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. "
}
}
10 changes: 10 additions & 0 deletions messages/convert.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
"sourcepath": "comma-separated list of paths to the local source files to convert",
"metadata": "comma-separated list of metadata component names to convert"
},
"flagsLong": {
"manifest": [
"The complete path to the manifest (package.xml) file that specifies the metadata types to convert.",
"If you specify this parameter, don’t specify --metadata or --sourcepath."
],
"sourcepath": [
"A comma-separated list of paths to the local source files to convert. 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).",
"If you specify this parameter, don’t specify --manifest or --metadata."
]
},
"success": "Source was successfully converted to Metadata API format and written to the location: %s",
"convertFailed": "Failed to convert source"
}
31 changes: 27 additions & 4 deletions messages/delete.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,33 @@
"checkonly": "validate delete command but do not delete from the org or delete files locally",
"testLevel": "deployment testing level",
"runTests": "tests to run if --testlevel RunSpecifiedTests",
"verbose": "verbose output of delete result",

"checkonlyLong": "Validates the deleted metadata and runs all Apex tests, but prevents the deletion from being saved to the org. \nIf 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 deletion (validation). This kind of change isn’t supported for test deletions to avoid the risk of data loss or corruption. If a change that isn’t supported for test deletions is included in a deletion package, the test deletion fails and issues an error.\nIf your deletion 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 deletion to another test Sandbox. A full deletion includes a validation of the changes as part of the deletion process.\nNote: A Metadata API deletion that includes Master-Detail relationships deletes all detail records in the Recycle Bin in the following cases.\n1. For a deletion with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before proceeding to delete the Master-Detail field, or the deletion fails. During the deletion, detail records are permanently deleted from the Recycle Bin and cannot be recovered.\n2. For a deletion 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 deletion to succeed. However, a successful deletion permanently deletes any detail records in the Recycle Bin.",
"sourcepathLong": "A comma-separated list of paths to the local metadata to delete. The supplied paths can be a single file (in which case the operation is applied to only one file) or a folder (in which case the operation is applied to all metadata types in the directory and its sub-directories).\nIf you specify this parameter, don’t specify --manifest or --metadata."
"verbose": "verbose output of delete result"
},
"flagsLong": {
"checkonly": [
"Validates the deleted metadata and runs all Apex tests, but prevents the deletion from being saved to the org. ",
"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 deletion (validation). This kind of change isn’t supported for test deletions to avoid the risk of data loss or corruption. If a change that isn’t supported for test deletions is included in a deletion package, the test deletion fails and issues an error.",
"If your deletion 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 deletion to another test Sandbox. A full deletion includes a validation of the changes as part of the deletion process.",
"Note: A Metadata API deletion that includes Master-Detail relationships deletes all detail records in the Recycle Bin in the following cases.",
"1. For a deletion with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before proceeding to delete the Master-Detail field, or the deletion fails. During the deletion, detail records are permanently deleted from the Recycle Bin and cannot be recovered.",
"2. For a deletion 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 deletion to succeed. However, a successful deletion permanently deletes any detail records in the Recycle Bin."
],
"metadata": [
"A comma-separated list of names of metadata components to delete from your project and your org.",
"If you specify this parameter, don’t specify --sourcepath."
],
"sourcepath": [
"A comma-separated list of paths to the local metadata to delete. The supplied paths can be a single file (in which case the operation is applied to only one file) or a folder (in which case the operation is applied to all metadata types in the directory and its sub-directories).",
"If you specify this parameter, don’t specify --metadata."
],
"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.",
"testLevel": [
"Specifies which level of deployment tests to run. Valid values are:",
"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.",
"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.",
"RunAllTestsInOrg—All tests in your org are run, including tests of managed packages.",
"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."
]
},
"prompt": "This operation will delete the following files on your computer and in your org: \n%s\n\nAre you sure you want to proceed (y/n)?"
}
4 changes: 4 additions & 0 deletions messages/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
"wait": "wait time for command to finish in minutes",
"verbose": "verbose output of deploy result"
},
"flagsLong": {
"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. ",
"jobid": "The job ID (asyncId) of the deployment you want to check. If not specified, the default value is the ID of the most recent metadata deployment you ran using Salesforce CLI. Use with -w to resume waiting."
},
"mdapiDeployFailed": "The metadata deploy operation failed."
}
15 changes: 15 additions & 0 deletions messages/retrieve.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
"packagename": "a comma-separated list of packages to retrieve",
"verbose": "verbose output of retrieve result"
},
"flagsLong": {
"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.",
"manifest": [
"The complete path for the manifest (package.xml) file that specifies the components to retrieve.",
"If you specify this parameter, don’t specify --metadata or --sourcepath."
],
"metadata": [
"A comma-separated list of names of metadata components to retrieve from the org.",
"If you specify this parameter, don’t specify --manifest or --sourcepath."
],
"sourcePath": [
"A comma-separated list of file paths for source to retrieve from the org. 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 source files in the directory and its sub-directories).",
"If you specify this parameter, don’t specify --manifest or --metadata."
]
},
"SourceRetrieveError": "Could not retrieve files in the sourcepath%s",
"retrieveTimeout": "Your retrieve request did not complete within the specified wait time [%s minutes]. Try again with a longer wait time.",
"retrievedSourceHeader": "Retrieved Source",
Expand Down
2 changes: 2 additions & 0 deletions src/commands/force/source/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ export class Convert extends SourceCommand {
manifest: flags.string({
char: 'x',
description: messages.getMessage('flags.manifest'),
longDescription: messages.getMessage('flagsLong.manifest'),
}),
sourcepath: flags.array({
char: 'p',
description: messages.getMessage('flags.sourcepath'),
longDescription: messages.getMessage('flagsLong.sourcepath'),
exclusive: ['manifest', 'metadata'],
}),
metadata: flags.array({
Expand Down
7 changes: 5 additions & 2 deletions src/commands/force/source/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ export class Delete extends DeployCommand {
checkonly: flags.boolean({
char: 'c',
description: messages.getMessage('flags.checkonly'),
longDescription: messages.getMessage('flags.checkonlyLong'),
longDescription: messages.getMessage('flagsLong.checkonly'),
}),
wait: flags.minutes({
char: 'w',
default: Duration.minutes(Delete.DEFAULT_SRC_WAIT_MINUTES),
min: Duration.minutes(1),
description: messages.getMessage('flags.wait'),
longDescription: messages.getMessage('flagsLong.wait'),
}),
testlevel: flags.enum({
char: 'l',
description: messages.getMessage('flags.testLevel'),
longDescription: messages.getMessage('flagsLong.testLevel'),
options: ['NoTestRun', 'RunLocalTests', 'RunAllTestsInOrg'],
default: 'NoTestRun',
}),
Expand All @@ -55,12 +57,13 @@ export class Delete extends DeployCommand {
metadata: flags.array({
char: 'm',
description: messages.getMessage('flags.metadata'),
longDescription: messages.getMessage('flagsLong.metadata'),
exclusive: ['manifest', 'sourcepath'],
}),
sourcepath: flags.array({
char: 'p',
description: messages.getMessage('flags.sourcepath'),
longDescription: messages.getMessage('flags.sourcepathLong'),
longDescription: messages.getMessage('flagsLong.sourcepath'),
exclusive: ['manifest', 'metadata'],
}),
verbose: flags.builtin({
Expand Down
1 change: 1 addition & 0 deletions src/commands/force/source/deploy/cancel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class Cancel extends DeployCommand {
default: Duration.minutes(DeployCommand.DEFAULT_SRC_WAIT_MINUTES),
min: Duration.minutes(1),
description: messages.getMessage('flags.wait'),
longDescription: messages.getMessage('flagsLong.wait'),
}),
jobid: flags.id({
char: 'i',
Expand Down
2 changes: 2 additions & 0 deletions src/commands/force/source/deploy/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ export class Report extends DeployCommand {
default: Duration.minutes(DeployCommand.DEFAULT_SRC_WAIT_MINUTES),
min: Duration.minutes(1),
description: messages.getMessage('flags.wait'),
longDescription: messages.getMessage('flagsLong.wait'),
}),
jobid: flags.id({
char: 'i',
description: messages.getMessage('flags.jobid'),
longDescription: messages.getMessage('flagsLong.jobid'),
}),
verbose: flags.builtin({
description: messages.getMessage('flags.verbose'),
Expand Down
4 changes: 4 additions & 0 deletions src/commands/force/source/retrieve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,26 @@ export class Retrieve extends SourceCommand {
sourcepath: flags.array({
char: 'p',
description: messages.getMessage('flags.sourcePath'),
longDescription: messages.getMessage('flagsLong.sourcePath'),
exclusive: ['manifest', 'metadata'],
}),
wait: flags.minutes({
char: 'w',
default: Duration.minutes(SourceCommand.DEFAULT_SRC_WAIT_MINUTES),
min: Duration.minutes(1),
description: messages.getMessage('flags.wait'),
longDescription: messages.getMessage('flagsLong.wait'),
}),
manifest: flags.filepath({
char: 'x',
description: messages.getMessage('flags.manifest'),
longDescription: messages.getMessage('flagsLong.manifest'),
exclusive: ['metadata', 'sourcepath'],
}),
metadata: flags.array({
char: 'm',
description: messages.getMessage('flags.metadata'),
longDescription: messages.getMessage('flagsLong.metadata'),
exclusive: ['manifest', 'sourcepath'],
}),
packagenames: flags.array({
Expand Down

0 comments on commit d87671b

Please sign in to comment.