Skip to content

Commit 29904cb

Browse files
feat: support all deploy workflows (#234)
* feat: support all deploy workflows * Quick deploy (#235) * feat: support all deploy workflows * feat: add validate and quick commands * chore: update schema and snapshot * chore: add back parallel testing * chore: add topic description * chore: remove .only * fix: interactive deploy * chore: code review * chore: add error codes to help * chore: add files * chore: update deps * chore: bump more deps * chore: remove resolution of sfdx-core * feat: update JSON and add --concise (#238) * feat: support all deploy workflows * feat: update JSON and add --concise * chore: update snapshots * chore: code review * chore: update metadataDeployer * fix: json output * Resume deploys (#239) * feat: add resume command * chore: code review * chore: extend TTL on deploy cache * chore: code review * chore: fix NUTs * Mdonnalley/report cancel (#243) * feat: support all deploy workflows * feat: add report and cancel commands * Messages for new "sf deploy" commands (#244) * messages for new "sf deploy" commands * messages for "sf deploy metadata quick" * messages for "sf deploy metadata report" * messages for "sf deploy metadata resume" * messages for "sf deploy metadata validate" * edit cache.md * edit deploy.async.md * udpate messages for 'sf deploy metadata' * chore: code review * chore: QA * chore: fix tests * chore: UX review * fix: custom config vars * chore: regenerate yarn.lock * chore: fix tests * chore: bump sfdx-core * chore: regenerate yarn.lock Co-authored-by: Juliet Shackell <[email protected]>
1 parent a5e440f commit 29904cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6834
-754
lines changed

command-snapshot.json

Lines changed: 115 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,116 @@
11
[
2-
{
3-
"command": "deploy",
4-
"plugin": "@salesforce/plugin-deploy-retrieve",
5-
"flags": ["interactive"],
6-
"alias": []
7-
},
8-
{
9-
"command": "deploy:metadata",
10-
"plugin": "@salesforce/plugin-deploy-retrieve",
11-
"flags": [
12-
"api-version",
13-
"dry-run",
14-
"ignore-errors",
15-
"ignore-warnings",
16-
"json",
17-
"manifest",
18-
"metadata",
19-
"source-dir",
20-
"target-org",
21-
"test-level",
22-
"tests",
23-
"verbose",
24-
"wait"
25-
],
26-
"alias": []
27-
},
28-
{
29-
"command": "retrieve:metadata",
30-
"plugin": "@salesforce/plugin-deploy-retrieve",
31-
"flags": ["api-version", "json", "manifest", "metadata", "package-name", "source-dir", "target-org", "wait"],
32-
"alias": []
33-
}
34-
]
2+
{
3+
"command": "deploy",
4+
"plugin": "@salesforce/plugin-deploy-retrieve",
5+
"flags": [
6+
"interactive"
7+
],
8+
"alias": []
9+
},
10+
{
11+
"command": "deploy:metadata",
12+
"plugin": "@salesforce/plugin-deploy-retrieve",
13+
"flags": [
14+
"api-version",
15+
"async",
16+
"concise",
17+
"dry-run",
18+
"ignore-errors",
19+
"ignore-warnings",
20+
"json",
21+
"manifest",
22+
"metadata",
23+
"source-dir",
24+
"target-org",
25+
"test-level",
26+
"tests",
27+
"verbose",
28+
"wait"
29+
],
30+
"alias": []
31+
},
32+
{
33+
"command": "deploy:metadata:cancel",
34+
"plugin": "@salesforce/plugin-deploy-retrieve",
35+
"flags": [
36+
"async",
37+
"job-id",
38+
"json",
39+
"use-most-recent",
40+
"wait"
41+
],
42+
"alias": []
43+
},
44+
{
45+
"command": "deploy:metadata:quick",
46+
"plugin": "@salesforce/plugin-deploy-retrieve",
47+
"flags": [
48+
"async",
49+
"concise",
50+
"job-id",
51+
"json",
52+
"target-org",
53+
"use-most-recent",
54+
"verbose",
55+
"wait"
56+
],
57+
"alias": []
58+
},
59+
{
60+
"command": "deploy:metadata:report",
61+
"plugin": "@salesforce/plugin-deploy-retrieve",
62+
"flags": [
63+
"job-id",
64+
"json",
65+
"use-most-recent"
66+
],
67+
"alias": []
68+
},
69+
{
70+
"command": "deploy:metadata:resume",
71+
"plugin": "@salesforce/plugin-deploy-retrieve",
72+
"flags": [
73+
"concise",
74+
"job-id",
75+
"json",
76+
"use-most-recent",
77+
"verbose",
78+
"wait"
79+
],
80+
"alias": []
81+
},
82+
{
83+
"command": "deploy:metadata:validate",
84+
"plugin": "@salesforce/plugin-deploy-retrieve",
85+
"flags": [
86+
"api-version",
87+
"async",
88+
"concise",
89+
"json",
90+
"manifest",
91+
"metadata",
92+
"source-dir",
93+
"target-org",
94+
"test-level",
95+
"tests",
96+
"verbose",
97+
"wait"
98+
],
99+
"alias": []
100+
},
101+
{
102+
"command": "retrieve:metadata",
103+
"plugin": "@salesforce/plugin-deploy-retrieve",
104+
"flags": [
105+
"api-version",
106+
"json",
107+
"manifest",
108+
"metadata",
109+
"package-name",
110+
"source-dir",
111+
"target-org",
112+
"wait"
113+
],
114+
"alias": []
115+
}
116+
]

messages/cache.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# error.InvalidJobId
2+
3+
No job found for ID: %s.
4+
5+
# error.NoRecentJobId
6+
7+
There are no recent job IDs available.

messages/config.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# error.invalidBooleanConfigValue
2+
3+
The config value can only be set to true or false
4+
5+
# org-metadata-rest-deploy
6+
7+
Whether deployments use the Metadata REST API (true) or SOAP API (false, default value).

messages/deploy.async.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# info.AsyncDeployQueued
2+
3+
Deploy has been queued.
4+
5+
# info.AsyncDeployCancelQueued
6+
7+
Deploy has been queued for cancellation.
8+
9+
# info.AsyncDeployCancel
10+
11+
Run "sf deploy metadata cancel --job-id %s" to cancel the deploy.
12+
13+
# info.AsyncDeployStatus
14+
15+
Run "sf deploy metadata report --job-id %s" to get the latest status.
16+
17+
# info.AsyncDeployResume
18+
19+
Run "sf deploy metadata resume --job-id %s" to resume watching the deploy.

messages/deploy.metadata.cancel.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# summary
2+
3+
Cancel a deploy operation.
4+
5+
# description
6+
7+
Use this command to cancel a deploy operation that hasn't yet completed in the org. Deploy operations include standard deploys, quick deploys, deploy validations, and deploy cancellations.
8+
9+
Run this command by either passing it a job ID or specifying the --use-most-recent flag to use the job ID of the most recent deploy operation.
10+
11+
# examples
12+
13+
- Cancel a deploy operation using a job ID:
14+
15+
<%= config.bin %> <%= command.id %> --job-id 0Af0x000017yLUFCA2
16+
17+
- Cancel the most recent deploy operation:
18+
19+
<%= config.bin %> <%= command.id %> --use-most-recent
20+
21+
# flags.job-id.summary
22+
23+
Job ID of the deploy operation you want to cancel.
24+
25+
# flags.job-id.description
26+
27+
These commands return a job ID if they time out or you specified the --async flag:
28+
29+
- sf deploy metadata
30+
- sf deploy metadata validate
31+
- sf deploy metadata quick
32+
- sf deploy metadata cancel
33+
34+
The job ID is valid for 10 days from when you started the deploy operation.
35+
36+
# flags.use-most-recent.summary
37+
38+
Use the job ID of the most recent deploy operation.
39+
40+
# flags.use-most-recent.description
41+
42+
For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less. If your most recent deploy operations was more than 3 days ago, this flag won't find a job ID.
43+
44+
# flags.wait.summary
45+
46+
Number of minutes to wait for the command to complete and display results.
47+
48+
# flags.wait.description
49+
50+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To resume watching the cancellation, run "sf deploy metadata resume". To check the status of the cancellation, run "sf deploy metadata report".
51+
52+
# flags.async.summary
53+
54+
Run the command asynchronously.
55+
56+
# flags.async.description
57+
58+
The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To resume watching the cancellation, run "sf deploy metadata resume". To check the status of the cancellation, run "sf deploy metadata report".
59+
60+
# error.CannotCancelDeploy
61+
62+
Can't cancel deploy because it's already completed.

messages/deploy.metadata.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ You must run this command from within a project.
88

99
This command doesn't support source-tracking. The source you deploy overwrites the corresponding metadata in your org. This command doesn’t attempt to merge your source with the versions in your org.
1010

11-
To run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue to use the CLI.
12-
1311
To deploy multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax applies to --manifest and --source-dir.
1412

1513
# examples
@@ -94,7 +92,7 @@ Number of minutes to wait for command to complete and display results.
9492

9593
# flags.wait.description
9694

97-
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
95+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and returns the job ID. To resume the deployment, run "sf deploy metadata resume". To check the status of the deployment, run "sf deploy metadata report".
9896

9997
# flags.manifest.summary
10098

@@ -136,6 +134,10 @@ Separate multiple test names with commas, and enclose the entire flag value in d
136134

137135
Show verbose output of the deploy result.
138136

137+
# flags.concise.summary
138+
139+
Show concise output of the deploy result.
140+
139141
# flags.api-version.summary
140142

141143
Target API version for the deploy.
@@ -144,6 +146,14 @@ Target API version for the deploy.
144146

145147
Use this flag to override the default API version, which is the latest version supported the CLI, with the API version of your package.xml file.
146148

149+
# flags.async.summary
150+
151+
Run the command asynchronously.
152+
153+
# flags.async.description
154+
155+
The command immediately returns the job ID and control of the terminal to you. This way, you can continue to use the CLI. To resume the deployment, run "sf deploy metadata resume". To check the status of the deployment, run "sf deploy metadata report".
156+
147157
# save.as.default
148158

149159
Save %s as default target-org?
@@ -161,6 +171,10 @@ The target-org found in the configuration is expired. The user terminated the de
161171

162172
You must specify tests using the --tests flag if the --test-level flag is set to RunSpecifiedTests.
163173

174+
# error.ClientTimeout
175+
176+
The client has timed out. Use sf deploy metadata resume to resume watching this deploy.
177+
164178
# warning.TargetOrgIsExpired
165179

166180
The target-org, "%s", is expired. Do you want to pick another org?

messages/deploy.metadata.quick.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# summary
2+
3+
Quickly deploy a validated deployment to an org.
4+
5+
# description
6+
7+
Before you run this command, first create a validated deployment with the "sf deploy metadata validate" command, which returns a job ID. Validated deployments haven't been deployed to the org yet; you deploy them with this command. Either pass the job ID to this command or use the --use-most-recent flag to use the job ID of the most recently validated deployment. For the quick deploy to succeed, the associated validated deployment must also have succeeded.
8+
9+
Executing this quick deploy command takes less time than a standard deploy because it skips running Apex tests. These tests were previously run as part of the validation. Validating first and then running a quick deploy is useful if the deployment to your production org take several hours and you don’t want to risk a failed deploy.
10+
11+
This command doesn't support source-tracking. The source you deploy overwrites the corresponding metadata in your org. This command doesn’t attempt to merge your source with the versions in your org.
12+
13+
# examples
14+
15+
- Run a quick deploy to your default org using a job ID:
16+
17+
<%= config.bin %> <%= command.id %> --job-id 0Af0x000017yLUFCA2
18+
19+
- Asynchronously run a quick deploy of the most recently validated deployment to an org with alias "my-prod-org":
20+
21+
<%= config.bin %> <%= command.id %> --async --use-most-recent --target-org my-prod-org
22+
23+
# flags.job-id.summary
24+
25+
Job ID of the deployment you want to quick deploy.
26+
27+
# flags.job-id.description
28+
29+
The job ID is valid for 10 days from when you started the validation.
30+
31+
# flags.use-most-recent.summary
32+
33+
Use the job ID of the most recently validated deployment.
34+
35+
# flags.use-most-recent.description
36+
37+
For performance reasons, this flag uses only job IDs that were validated in the past 3 days or less. If your most recent deployment validation was more than 3 days ago, this flag won't find a job ID.
38+
39+
# flags.wait.summary
40+
41+
Number of minutes to wait for the command to complete and display results.
42+
43+
# flags.wait.description
44+
45+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To resume watching the deploy, run "sf deploy metadata resume". To check the status of the deploy, run "sf deploy metadata report".
46+
47+
# flags.verbose.summary
48+
49+
Show verbose output of the deploy result.
50+
51+
# flags.concise.summary
52+
53+
Show concise output of the deploy result.
54+
55+
# flags.async.summary
56+
57+
Run the command asynchronously.
58+
59+
# flags.async.description
60+
61+
The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To resume watching the deploy, run "sf deploy metadata resume". To check the status of the deploy, run "sf deploy metadata report".
62+
63+
# flags.target-org.summary
64+
65+
Login username or alias for the target org.
66+
67+
# flags.target-org.description
68+
69+
Overrides your default org.
70+
71+
# error.CannotQuickDeploy
72+
73+
Job ID can't be used for quick deployment. Possible reasons include the deployment hasn't been validated or the validation expired because you ran it more than 10 days ago.
74+
75+
# error.QuickDeployFailure
76+
77+
Deployment %s exited with status code: %s.
78+
79+
# info.QuickDeploySuccess
80+
81+
Successfully deployed (%s).

0 commit comments

Comments
 (0)