@salesforce/plugin-devops-center 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -37
- package/lib/commands/devops/pipeline/create.d.ts +1 -0
- package/lib/commands/devops/pipeline/create.js +20 -3
- package/lib/commands/devops/pipeline/create.js.map +1 -1
- package/lib/commands/devops/promote.d.ts +8 -0
- package/lib/commands/devops/promote.js +31 -1
- package/lib/commands/devops/promote.js.map +1 -1
- package/lib/commands/devops/promotion/validate.js +16 -3
- package/lib/commands/devops/promotion/validate.js.map +1 -1
- package/lib/commands/devops/stage/branch/add.d.ts +15 -0
- package/lib/commands/devops/stage/branch/add.js +48 -1
- package/lib/commands/devops/stage/branch/add.js.map +1 -1
- package/lib/commands/devops/stage/environment/add.d.ts +15 -0
- package/lib/commands/devops/stage/environment/add.js +51 -1
- package/lib/commands/devops/stage/environment/add.js.map +1 -1
- package/lib/commands/devops/work-item/create.js +1 -0
- package/lib/commands/devops/work-item/create.js.map +1 -1
- package/lib/commands/devops/work-item/list.js +2 -1
- package/lib/commands/devops/work-item/list.js.map +1 -1
- package/lib/utils/addStageBranch.d.ts +20 -0
- package/lib/utils/addStageBranch.js +33 -0
- package/lib/utils/addStageBranch.js.map +1 -1
- package/lib/utils/addStageEnvironment.d.ts +21 -0
- package/lib/utils/addStageEnvironment.js +34 -0
- package/lib/utils/addStageEnvironment.js.map +1 -1
- package/lib/utils/createPipeline.d.ts +6 -0
- package/lib/utils/createPipeline.js +41 -1
- package/lib/utils/createPipeline.js.map +1 -1
- package/lib/utils/createWorkItem.js +22 -18
- package/lib/utils/createWorkItem.js.map +1 -1
- package/lib/utils/promoteStage.d.ts +20 -0
- package/lib/utils/promoteStage.js +25 -0
- package/lib/utils/promoteStage.js.map +1 -1
- package/lib/utils/updateWorkItem.d.ts +22 -2
- package/lib/utils/updateWorkItem.js +98 -20
- package/lib/utils/updateWorkItem.js.map +1 -1
- package/lib/utils/workItems.js +7 -4
- package/lib/utils/workItems.js.map +1 -1
- package/messages/devops.pipeline.create.md +8 -0
- package/messages/devops.promote.md +12 -0
- package/messages/devops.stage.branch.add.md +17 -1
- package/messages/devops.stage.environment.add.md +16 -0
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +29 -3
- package/package.json +3 -3
- package/schemas/devops-pipeline-create.json +19 -0
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ Create a DevOps Center pipeline.
|
|
|
96
96
|
USAGE
|
|
97
97
|
$ sf devops pipeline create -o <value> -n <value> -r <value> [--json] [--flags-dir <value>] [--api-version <value>]
|
|
98
98
|
[--repo-type github|bitbucket] [--create-repo] [--repo-owner <value>] [--bitbucket-workspace <value>]
|
|
99
|
-
[--bitbucket-project-key <value>] [-s <value>...]
|
|
99
|
+
[--bitbucket-project-key <value>] [-s <value>...] [--project-id <value>...]
|
|
100
100
|
|
|
101
101
|
FLAGS
|
|
102
102
|
-n, --name=<value> (required) Name of the pipeline.
|
|
@@ -111,6 +111,8 @@ FLAGS
|
|
|
111
111
|
--bitbucket-workspace=<value> Bitbucket workspace that will own the repository. Required when creating a
|
|
112
112
|
Bitbucket repository using '--create-repo'.
|
|
113
113
|
--create-repo Create a repository if it doesn't exist.
|
|
114
|
+
--project-id=<value>... ID of a project to associate with the pipeline. Repeat the flag to associate
|
|
115
|
+
multiple projects.
|
|
114
116
|
--repo-owner=<value> Owner (organization or user) of the GitHub repository. Required when creating a
|
|
115
117
|
GitHub repository using '--create-repo'.
|
|
116
118
|
--repo-type=<option> Type of the source code repository. Required when creating a repository using
|
|
@@ -152,9 +154,14 @@ EXAMPLES
|
|
|
152
154
|
|
|
153
155
|
$ sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" --repo \
|
|
154
156
|
https://github.com/myorg/myrepo --stage Dev --stage QA --stage Prod
|
|
157
|
+
|
|
158
|
+
Create a pipeline and associate one or more projects with it:
|
|
159
|
+
|
|
160
|
+
$ sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" --repo \
|
|
161
|
+
https://github.com/myorg/myrepo --project-id 0Hn000000000001 --project-id 0Hn000000000002
|
|
155
162
|
```
|
|
156
163
|
|
|
157
|
-
_See code: [src/commands/devops/pipeline/create.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
164
|
+
_See code: [src/commands/devops/pipeline/create.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/create.ts)_
|
|
158
165
|
|
|
159
166
|
## `sf devops pipeline get`
|
|
160
167
|
|
|
@@ -186,7 +193,7 @@ EXAMPLES
|
|
|
186
193
|
$ sf devops pipeline get --target-org my-devops-org --pipeline-id 0Do000000000001
|
|
187
194
|
```
|
|
188
195
|
|
|
189
|
-
_See code: [src/commands/devops/pipeline/get.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
196
|
+
_See code: [src/commands/devops/pipeline/get.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/get.ts)_
|
|
190
197
|
|
|
191
198
|
## `sf devops pipeline list`
|
|
192
199
|
|
|
@@ -217,7 +224,7 @@ EXAMPLES
|
|
|
217
224
|
$ sf devops pipeline list --target-org my-devops-org
|
|
218
225
|
```
|
|
219
226
|
|
|
220
|
-
_See code: [src/commands/devops/pipeline/list.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
227
|
+
_See code: [src/commands/devops/pipeline/list.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/list.ts)_
|
|
221
228
|
|
|
222
229
|
## `sf devops pipeline project add`
|
|
223
230
|
|
|
@@ -251,7 +258,7 @@ EXAMPLES
|
|
|
251
258
|
0Hn000000000001
|
|
252
259
|
```
|
|
253
260
|
|
|
254
|
-
_See code: [src/commands/devops/pipeline/project/add.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
261
|
+
_See code: [src/commands/devops/pipeline/project/add.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/project/add.ts)_
|
|
255
262
|
|
|
256
263
|
## `sf devops pipeline project delete`
|
|
257
264
|
|
|
@@ -285,7 +292,7 @@ EXAMPLES
|
|
|
285
292
|
0Hn000000000001
|
|
286
293
|
```
|
|
287
294
|
|
|
288
|
-
_See code: [src/commands/devops/pipeline/project/delete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
295
|
+
_See code: [src/commands/devops/pipeline/project/delete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/project/delete.ts)_
|
|
289
296
|
|
|
290
297
|
## `sf devops pipeline stage add`
|
|
291
298
|
|
|
@@ -326,7 +333,7 @@ EXAMPLES
|
|
|
326
333
|
--next-stage-id 0Xc000000000003
|
|
327
334
|
```
|
|
328
335
|
|
|
329
|
-
_See code: [src/commands/devops/pipeline/stage/add.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
336
|
+
_See code: [src/commands/devops/pipeline/stage/add.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/stage/add.ts)_
|
|
330
337
|
|
|
331
338
|
## `sf devops pipeline stage delete`
|
|
332
339
|
|
|
@@ -361,7 +368,7 @@ EXAMPLES
|
|
|
361
368
|
0Xc000000000002
|
|
362
369
|
```
|
|
363
370
|
|
|
364
|
-
_See code: [src/commands/devops/pipeline/stage/delete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
371
|
+
_See code: [src/commands/devops/pipeline/stage/delete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/stage/delete.ts)_
|
|
365
372
|
|
|
366
373
|
## `sf devops pipeline stage update`
|
|
367
374
|
|
|
@@ -394,7 +401,7 @@ EXAMPLES
|
|
|
394
401
|
$ sf devops pipeline stage update --target-org my-devops-org --stage-id 1QV000000000001 --name "Integration"
|
|
395
402
|
```
|
|
396
403
|
|
|
397
|
-
_See code: [src/commands/devops/pipeline/stage/update.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
404
|
+
_See code: [src/commands/devops/pipeline/stage/update.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/stage/update.ts)_
|
|
398
405
|
|
|
399
406
|
## `sf devops pipeline update`
|
|
400
407
|
|
|
@@ -438,7 +445,7 @@ EXAMPLES
|
|
|
438
445
|
Pipeline"
|
|
439
446
|
```
|
|
440
447
|
|
|
441
|
-
_See code: [src/commands/devops/pipeline/update.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
448
|
+
_See code: [src/commands/devops/pipeline/update.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/pipeline/update.ts)_
|
|
442
449
|
|
|
443
450
|
## `sf devops project create`
|
|
444
451
|
|
|
@@ -475,7 +482,7 @@ EXAMPLES
|
|
|
475
482
|
update"
|
|
476
483
|
```
|
|
477
484
|
|
|
478
|
-
_See code: [src/commands/devops/project/create.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
485
|
+
_See code: [src/commands/devops/project/create.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/project/create.ts)_
|
|
479
486
|
|
|
480
487
|
## `sf devops project list`
|
|
481
488
|
|
|
@@ -510,7 +517,7 @@ EXAMPLES
|
|
|
510
517
|
$ sf devops project list --target-org devops-center@example.com
|
|
511
518
|
```
|
|
512
519
|
|
|
513
|
-
_See code: [src/commands/devops/project/list.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
520
|
+
_See code: [src/commands/devops/project/list.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/project/list.ts)_
|
|
514
521
|
|
|
515
522
|
## `sf devops project update`
|
|
516
523
|
|
|
@@ -560,7 +567,7 @@ EXAMPLES
|
|
|
560
567
|
--description "Archived" --no-is-active
|
|
561
568
|
```
|
|
562
569
|
|
|
563
|
-
_See code: [src/commands/devops/project/update.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
570
|
+
_See code: [src/commands/devops/project/update.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/project/update.ts)_
|
|
564
571
|
|
|
565
572
|
## `sf devops promote`
|
|
566
573
|
|
|
@@ -570,7 +577,7 @@ Promote work items or a pipeline stage to a target pipeline stage.
|
|
|
570
577
|
USAGE
|
|
571
578
|
$ sf devops promote -o <value> -t <value> [--json] [--flags-dir <value>] [--api-version <value>] [-i <value>... |
|
|
572
579
|
-s <value>] [-a] [-l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg] [--tests <value>...]
|
|
573
|
-
[--skip-validation]
|
|
580
|
+
[--skip-validation] [--force]
|
|
574
581
|
|
|
575
582
|
FLAGS
|
|
576
583
|
-a, --deploy-all Deploy all metadata in the branch to the stage's org.
|
|
@@ -583,6 +590,8 @@ FLAGS
|
|
|
583
590
|
exclusive with --work-item-id.
|
|
584
591
|
-t, --target-stage-id=<value> (required) ID of the pipeline stage to promote to.
|
|
585
592
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
593
|
+
--force Submit the promotion even if another promotion to the same target stage is already in
|
|
594
|
+
progress. By default, the command blocks to avoid creating duplicate promotions.
|
|
586
595
|
--skip-validation Skip pre-promote validation. By default, promotion is validated before proceeding to
|
|
587
596
|
prevent promoting work items without an associated PR. Use this flag to bypass
|
|
588
597
|
validation.
|
|
@@ -660,7 +669,7 @@ FLAG DESCRIPTIONS
|
|
|
660
669
|
spaces.
|
|
661
670
|
```
|
|
662
671
|
|
|
663
|
-
_See code: [src/commands/devops/promote.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
672
|
+
_See code: [src/commands/devops/promote.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/promote.ts)_
|
|
664
673
|
|
|
665
674
|
## `sf devops promotion complete`
|
|
666
675
|
|
|
@@ -743,7 +752,7 @@ FLAG DESCRIPTIONS
|
|
|
743
752
|
spaces.
|
|
744
753
|
```
|
|
745
754
|
|
|
746
|
-
_See code: [src/commands/devops/promotion/complete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
755
|
+
_See code: [src/commands/devops/promotion/complete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/promotion/complete.ts)_
|
|
747
756
|
|
|
748
757
|
## `sf devops promotion validate`
|
|
749
758
|
|
|
@@ -784,7 +793,7 @@ EXAMPLES
|
|
|
784
793
|
1fk000000000001 --work-item-id 1fk000000000002
|
|
785
794
|
```
|
|
786
795
|
|
|
787
|
-
_See code: [src/commands/devops/promotion/validate.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
796
|
+
_See code: [src/commands/devops/promotion/validate.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/promotion/validate.ts)_
|
|
788
797
|
|
|
789
798
|
## `sf devops request status`
|
|
790
799
|
|
|
@@ -815,7 +824,7 @@ EXAMPLES
|
|
|
815
824
|
$ sf devops request status --target-org my-devops-org --request-token a0B000000000001
|
|
816
825
|
```
|
|
817
826
|
|
|
818
|
-
_See code: [src/commands/devops/request/status.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
827
|
+
_See code: [src/commands/devops/request/status.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/request/status.ts)_
|
|
819
828
|
|
|
820
829
|
## `sf devops review create`
|
|
821
830
|
|
|
@@ -852,7 +861,7 @@ EXAMPLES
|
|
|
852
861
|
$ sf devops review create --target-org my-devops-org --work-item-id 0Wx000000000001
|
|
853
862
|
```
|
|
854
863
|
|
|
855
|
-
_See code: [src/commands/devops/review/create.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
864
|
+
_See code: [src/commands/devops/review/create.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/review/create.ts)_
|
|
856
865
|
|
|
857
866
|
## `sf devops stage branch add`
|
|
858
867
|
|
|
@@ -861,7 +870,7 @@ Add a source code repository branch to a pipeline stage.
|
|
|
861
870
|
```
|
|
862
871
|
USAGE
|
|
863
872
|
$ sf devops stage branch add -o <value> --pipeline-id <value> --stage-id <value> -b <value> [--json] [--flags-dir <value>]
|
|
864
|
-
[--api-version <value>] [--create-vcs-branch]
|
|
873
|
+
[--api-version <value>] [--create-vcs-branch] [--force]
|
|
865
874
|
|
|
866
875
|
FLAGS
|
|
867
876
|
-b, --branch-name=<value> (required) Name of the repository branch to assign to the stage.
|
|
@@ -869,6 +878,9 @@ FLAGS
|
|
|
869
878
|
configuration variable is already set.
|
|
870
879
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
871
880
|
--create-vcs-branch Create the branch in the remote repository if it doesn't already exist.
|
|
881
|
+
--force Replace the stage's existing branch. By default, the command blocks if the stage already
|
|
882
|
+
has a branch to avoid orphaning it. With this flag, the new branch is associated and the
|
|
883
|
+
previous branch record is removed if no other stage references it.
|
|
872
884
|
--pipeline-id=<value> (required) ID of the pipeline that contains the stage.
|
|
873
885
|
--stage-id=<value> (required) ID of the pipeline stage to associate the branch with.
|
|
874
886
|
|
|
@@ -880,8 +892,8 @@ DESCRIPTION
|
|
|
880
892
|
Add a source code repository branch to a pipeline stage.
|
|
881
893
|
|
|
882
894
|
By default, the branch must exist in the repository. Use --create-vcs-branch to create a branch if it doesn't exist.
|
|
883
|
-
Each pipeline stage supports only one branch.
|
|
884
|
-
|
|
895
|
+
Each pipeline stage supports only one branch. If the stage already has a branch, the command blocks so the existing
|
|
896
|
+
branch isn't orphaned; pass --force to replace it.
|
|
885
897
|
|
|
886
898
|
EXAMPLES
|
|
887
899
|
Add an existing branch to a stage:
|
|
@@ -895,7 +907,7 @@ EXAMPLES
|
|
|
895
907
|
--branch-name integration --create-vcs-branch
|
|
896
908
|
```
|
|
897
909
|
|
|
898
|
-
_See code: [src/commands/devops/stage/branch/add.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
910
|
+
_See code: [src/commands/devops/stage/branch/add.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/stage/branch/add.ts)_
|
|
899
911
|
|
|
900
912
|
## `sf devops stage branch delete`
|
|
901
913
|
|
|
@@ -933,7 +945,7 @@ EXAMPLES
|
|
|
933
945
|
0Xp000000000001
|
|
934
946
|
```
|
|
935
947
|
|
|
936
|
-
_See code: [src/commands/devops/stage/branch/delete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
948
|
+
_See code: [src/commands/devops/stage/branch/delete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/stage/branch/delete.ts)_
|
|
937
949
|
|
|
938
950
|
## `sf devops stage environment add`
|
|
939
951
|
|
|
@@ -942,13 +954,17 @@ Add a Salesforce environment to a pipeline stage.
|
|
|
942
954
|
```
|
|
943
955
|
USAGE
|
|
944
956
|
$ sf devops stage environment add -o <value> --pipeline-id <value> --stage-id <value> -e <value> --org-type Production|Sandbox
|
|
945
|
-
[--json] [--flags-dir <value>] [--api-version <value>] [--no-browser]
|
|
957
|
+
[--json] [--flags-dir <value>] [--api-version <value>] [--no-browser] [--force]
|
|
946
958
|
|
|
947
959
|
FLAGS
|
|
948
960
|
-e, --environment-name=<value> (required) Name of the environment.
|
|
949
961
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
950
962
|
configuration variable is already set.
|
|
951
963
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
964
|
+
--force Replace the stage's existing environment. By default, the command blocks if the stage
|
|
965
|
+
already has an environment to avoid orphaning it. With this flag, the new environment
|
|
966
|
+
is added first and the previous one is removed only after the new environment is
|
|
967
|
+
associated successfully.
|
|
952
968
|
--no-browser Don't auto-open the browser for OAuth authentication. The redirect URL is printed for
|
|
953
969
|
manual use.
|
|
954
970
|
--org-type=<option> (required) Type of the Salesforce org. Valid values: Production, Sandbox.
|
|
@@ -973,7 +989,7 @@ EXAMPLES
|
|
|
973
989
|
Production_Org --org-type Production
|
|
974
990
|
```
|
|
975
991
|
|
|
976
|
-
_See code: [src/commands/devops/stage/environment/add.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
992
|
+
_See code: [src/commands/devops/stage/environment/add.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/stage/environment/add.ts)_
|
|
977
993
|
|
|
978
994
|
## `sf devops stage environment delete`
|
|
979
995
|
|
|
@@ -1007,7 +1023,7 @@ EXAMPLES
|
|
|
1007
1023
|
0Xe000000000001
|
|
1008
1024
|
```
|
|
1009
1025
|
|
|
1010
|
-
_See code: [src/commands/devops/stage/environment/delete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1026
|
+
_See code: [src/commands/devops/stage/environment/delete.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/stage/environment/delete.ts)_
|
|
1011
1027
|
|
|
1012
1028
|
## `sf devops work-item combine`
|
|
1013
1029
|
|
|
@@ -1056,7 +1072,7 @@ FLAG DESCRIPTIONS
|
|
|
1056
1072
|
are merged into the parent's branch during promotion.
|
|
1057
1073
|
```
|
|
1058
1074
|
|
|
1059
|
-
_See code: [src/commands/devops/work-item/combine.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1075
|
+
_See code: [src/commands/devops/work-item/combine.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/work-item/combine.ts)_
|
|
1060
1076
|
|
|
1061
1077
|
## `sf devops work-item create`
|
|
1062
1078
|
|
|
@@ -1097,7 +1113,7 @@ EXAMPLES
|
|
|
1097
1113
|
--description "Implement dark mode toggle in settings page"
|
|
1098
1114
|
```
|
|
1099
1115
|
|
|
1100
|
-
_See code: [src/commands/devops/work-item/create.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1116
|
+
_See code: [src/commands/devops/work-item/create.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/work-item/create.ts)_
|
|
1101
1117
|
|
|
1102
1118
|
## `sf devops work-item list`
|
|
1103
1119
|
|
|
@@ -1133,7 +1149,7 @@ EXAMPLES
|
|
|
1133
1149
|
$ sf devops work-item list --target-org my-devops-org --project-id 1Qg000000000001 --json
|
|
1134
1150
|
```
|
|
1135
1151
|
|
|
1136
|
-
_See code: [src/commands/devops/work-item/list.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1152
|
+
_See code: [src/commands/devops/work-item/list.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/work-item/list.ts)_
|
|
1137
1153
|
|
|
1138
1154
|
## `sf devops work-item prepare`
|
|
1139
1155
|
|
|
@@ -1174,7 +1190,7 @@ EXAMPLES
|
|
|
1174
1190
|
--target-stage-id 05S000000000002
|
|
1175
1191
|
```
|
|
1176
1192
|
|
|
1177
|
-
_See code: [src/commands/devops/work-item/prepare.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1193
|
+
_See code: [src/commands/devops/work-item/prepare.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/work-item/prepare.ts)_
|
|
1178
1194
|
|
|
1179
1195
|
## `sf devops work-item update`
|
|
1180
1196
|
|
|
@@ -1221,7 +1237,7 @@ EXAMPLES
|
|
|
1221
1237
|
--description "Users can't log in on mobile" --status "In Progress"
|
|
1222
1238
|
```
|
|
1223
1239
|
|
|
1224
|
-
_See code: [src/commands/devops/work-item/update.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1240
|
+
_See code: [src/commands/devops/work-item/update.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/devops/work-item/update.ts)_
|
|
1225
1241
|
|
|
1226
1242
|
## `sf project deploy pipeline quick`
|
|
1227
1243
|
|
|
@@ -1295,7 +1311,7 @@ FLAG DESCRIPTIONS
|
|
|
1295
1311
|
"sf project deploy pipeline report".
|
|
1296
1312
|
```
|
|
1297
1313
|
|
|
1298
|
-
_See code: [src/commands/project/deploy/pipeline/quick.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1314
|
+
_See code: [src/commands/project/deploy/pipeline/quick.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/project/deploy/pipeline/quick.ts)_
|
|
1299
1315
|
|
|
1300
1316
|
## `sf project deploy pipeline report`
|
|
1301
1317
|
|
|
@@ -1343,7 +1359,7 @@ FLAG DESCRIPTIONS
|
|
|
1343
1359
|
your most recent operation was longer than 3 days ago, this flag won't find the job ID.
|
|
1344
1360
|
```
|
|
1345
1361
|
|
|
1346
|
-
_See code: [src/commands/project/deploy/pipeline/report.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1362
|
+
_See code: [src/commands/project/deploy/pipeline/report.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/project/deploy/pipeline/report.ts)_
|
|
1347
1363
|
|
|
1348
1364
|
## `sf project deploy pipeline resume`
|
|
1349
1365
|
|
|
@@ -1410,7 +1426,7 @@ FLAG DESCRIPTIONS
|
|
|
1410
1426
|
returns the job ID. To check the status of the operation, run "sf project deploy pipeline report".
|
|
1411
1427
|
```
|
|
1412
1428
|
|
|
1413
|
-
_See code: [src/commands/project/deploy/pipeline/resume.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1429
|
+
_See code: [src/commands/project/deploy/pipeline/resume.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/project/deploy/pipeline/resume.ts)_
|
|
1414
1430
|
|
|
1415
1431
|
## `sf project deploy pipeline start`
|
|
1416
1432
|
|
|
@@ -1510,7 +1526,7 @@ FLAG DESCRIPTIONS
|
|
|
1510
1526
|
"sf project deploy pipeline report".
|
|
1511
1527
|
```
|
|
1512
1528
|
|
|
1513
|
-
_See code: [src/commands/project/deploy/pipeline/start.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1529
|
+
_See code: [src/commands/project/deploy/pipeline/start.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/project/deploy/pipeline/start.ts)_
|
|
1514
1530
|
|
|
1515
1531
|
## `sf project deploy pipeline validate`
|
|
1516
1532
|
|
|
@@ -1610,7 +1626,7 @@ FLAG DESCRIPTIONS
|
|
|
1610
1626
|
"sf project deploy pipeline report".
|
|
1611
1627
|
```
|
|
1612
1628
|
|
|
1613
|
-
_See code: [src/commands/project/deploy/pipeline/validate.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.
|
|
1629
|
+
_See code: [src/commands/project/deploy/pipeline/validate.ts](https://github.com/salesforcecli/plugin-devops-center/blob/2.3.0/src/commands/project/deploy/pipeline/validate.ts)_
|
|
1614
1630
|
|
|
1615
1631
|
<!-- commandsstop -->
|
|
1616
1632
|
|
|
@@ -16,6 +16,7 @@ export default class DevopsPipelineCreate extends SfCommand<CreatePipelineResult
|
|
|
16
16
|
'bitbucket-workspace': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
'bitbucket-project-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
18
|
stage: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'project-id': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
};
|
|
20
21
|
run(): Promise<CreatePipelineResult>;
|
|
21
22
|
private resolveRepoType;
|
|
@@ -59,6 +59,11 @@ export default class DevopsPipelineCreate extends SfCommand {
|
|
|
59
59
|
char: 's',
|
|
60
60
|
multiple: true,
|
|
61
61
|
}),
|
|
62
|
+
'project-id': Flags.salesforceId({
|
|
63
|
+
summary: messages.getMessage('flags.project-id.summary'),
|
|
64
|
+
multiple: true,
|
|
65
|
+
char: undefined,
|
|
66
|
+
}),
|
|
62
67
|
};
|
|
63
68
|
async run() {
|
|
64
69
|
const { flags } = await this.parse(DevopsPipelineCreate);
|
|
@@ -99,6 +104,7 @@ export default class DevopsPipelineCreate extends SfCommand {
|
|
|
99
104
|
bitbucketWorkspace: flags['bitbucket-workspace'],
|
|
100
105
|
bitbucketProjectKey: flags['bitbucket-project-key'],
|
|
101
106
|
stages: flags['stage'],
|
|
107
|
+
projectIds: flags['project-id'],
|
|
102
108
|
});
|
|
103
109
|
}
|
|
104
110
|
catch (error) {
|
|
@@ -110,7 +116,7 @@ export default class DevopsPipelineCreate extends SfCommand {
|
|
|
110
116
|
throw error;
|
|
111
117
|
}
|
|
112
118
|
if (result.success) {
|
|
113
|
-
this.printSuccessOutput(result, flags['repo'], org.getUsername());
|
|
119
|
+
this.printSuccessOutput(result, flags['repo'], org.getUsername(), flags['project-id']);
|
|
114
120
|
}
|
|
115
121
|
else {
|
|
116
122
|
this.error(`Failed to create pipeline: ${result.error ?? ''}`);
|
|
@@ -149,7 +155,7 @@ export default class DevopsPipelineCreate extends SfCommand {
|
|
|
149
155
|
this.error(messages.getMessage('error.VcsCredentialsMissing', [repo]));
|
|
150
156
|
}
|
|
151
157
|
}
|
|
152
|
-
printSuccessOutput(result, repoFlag, username) {
|
|
158
|
+
printSuccessOutput(result, repoFlag, username, projectIds) {
|
|
153
159
|
if (result.repository?.created) {
|
|
154
160
|
this.log(`Created repository: ${repoFlag} (${result.repository.repoType})`);
|
|
155
161
|
}
|
|
@@ -157,11 +163,22 @@ export default class DevopsPipelineCreate extends SfCommand {
|
|
|
157
163
|
this.log(` Pipeline ID: ${result.pipelineId ?? ''}`);
|
|
158
164
|
this.log(` Repository: ${result.repository?.repoUrl ?? ''} (${result.repository?.repoType ?? ''})`);
|
|
159
165
|
this.log(` Status: ${result.status ?? 'Inactive'}`);
|
|
166
|
+
if (projectIds && projectIds.length > 0) {
|
|
167
|
+
this.log(` Projects: ${projectIds.join(', ')}`);
|
|
168
|
+
}
|
|
169
|
+
if (result.stages && result.stages.length > 0) {
|
|
170
|
+
this.log(' Stages:');
|
|
171
|
+
for (const stage of result.stages) {
|
|
172
|
+
this.log(` ${stage.name ?? ''} (${stage.id})`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
160
175
|
this.log(' Next steps:');
|
|
161
176
|
const orgLabel = username ?? '<org>';
|
|
162
177
|
const pipelineIdLabel = result.pipelineId ?? '<ID>';
|
|
163
178
|
this.log(` Add pipeline stages: sf devops pipeline stage add --target-org ${orgLabel} --pipeline-id ${pipelineIdLabel}`);
|
|
164
|
-
|
|
179
|
+
if (!projectIds || projectIds.length === 0) {
|
|
180
|
+
this.log(` Attach a project: sf devops pipeline project add --target-org ${orgLabel} --pipeline-id ${pipelineIdLabel} --project-id <ID>`);
|
|
181
|
+
}
|
|
165
182
|
}
|
|
166
183
|
}
|
|
167
184
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/devops/pipeline/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,cAAc,EAEd,cAAc,EACd,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,wBAAwB,CAAC,CAAC;AACrG,MAAM,mBAAmB,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,cAAc,CAAC,CAAC;AAEtG,MAAM,CAAC,OAAO,OAAO,oBAAqB,S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;QACF,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,GAAG,CACN,qEAAqE,QAAQ,kBAAkB,eAAe,oBAAoB,CACnI,CAAC;QACJ,CAAC;IACH,CAAC"}
|
|
@@ -21,9 +21,17 @@ export default class DevopsPromote extends SfCommand<PromoteResult> {
|
|
|
21
21
|
'test-level': import("@oclif/core/interfaces").OptionFlag<import("../../common/types.js").TestLevel | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
22
|
tests: import("@oclif/core/interfaces").OptionFlag<string[] | undefined>;
|
|
23
23
|
'skip-validation': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
24
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
24
25
|
};
|
|
25
26
|
private static assertWorkItemsPromotable;
|
|
26
27
|
private static fetchStageWorkItems;
|
|
27
28
|
run(): Promise<PromoteResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Blocks promotion if another promotion to the same target stage is already in flight, to
|
|
31
|
+
* avoid creating a duplicate. Scoped to the target stage (and therefore its pipeline), so
|
|
32
|
+
* promotions in other stages or pipelines are unaffected. Best-effort: if the check can't
|
|
33
|
+
* run, the promotion proceeds as before.
|
|
34
|
+
*/
|
|
35
|
+
private assertNoInFlightPromotion;
|
|
28
36
|
private runValidation;
|
|
29
37
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Messages } from '@salesforce/core';
|
|
17
17
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
|
-
import { promoteStage } from '../../utils/promoteStage.js';
|
|
18
|
+
import { promoteStage, findInFlightPromotions, } from '../../utils/promoteStage.js';
|
|
19
19
|
import { resolveProjectIdFromWorkItem } from '../../utils/prepareWorkItem.js';
|
|
20
20
|
import { getPipelineIdForProject } from '../../utils/pipelineUtils.js';
|
|
21
21
|
import { deployAll, testLevel as testLevelFlag, specificTestsNoChar } from '../../common/flags/promote/promoteFlags.js';
|
|
@@ -62,6 +62,10 @@ export default class DevopsPromote extends SfCommand {
|
|
|
62
62
|
summary: messages.getMessage('flags.skip-validation.summary'),
|
|
63
63
|
default: false,
|
|
64
64
|
}),
|
|
65
|
+
force: Flags.boolean({
|
|
66
|
+
summary: messages.getMessage('flags.force.summary'),
|
|
67
|
+
default: false,
|
|
68
|
+
}),
|
|
65
69
|
};
|
|
66
70
|
static async assertWorkItemsPromotable(connection, workItemIds) {
|
|
67
71
|
const idList = workItemIds.map((id) => `'${id}'`).join(', ');
|
|
@@ -125,6 +129,9 @@ export default class DevopsPromote extends SfCommand {
|
|
|
125
129
|
this.error(messages.getMessage('error.NoWorkItems'));
|
|
126
130
|
}
|
|
127
131
|
}
|
|
132
|
+
if (!flags.force) {
|
|
133
|
+
await this.assertNoInFlightPromotion(connection, targetStageId);
|
|
134
|
+
}
|
|
128
135
|
if (!flags['skip-validation']) {
|
|
129
136
|
await this.runValidation(connection, pipelineId, resolvedWorkItemIds, targetStageId, !workItemIds?.length);
|
|
130
137
|
}
|
|
@@ -165,6 +172,29 @@ export default class DevopsPromote extends SfCommand {
|
|
|
165
172
|
promotedWorkitemIds: apiResult.promotedWorkitemIds,
|
|
166
173
|
};
|
|
167
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Blocks promotion if another promotion to the same target stage is already in flight, to
|
|
177
|
+
* avoid creating a duplicate. Scoped to the target stage (and therefore its pipeline), so
|
|
178
|
+
* promotions in other stages or pipelines are unaffected. Best-effort: if the check can't
|
|
179
|
+
* run, the promotion proceeds as before.
|
|
180
|
+
*/
|
|
181
|
+
async assertNoInFlightPromotion(connection, targetStageId) {
|
|
182
|
+
let inFlight;
|
|
183
|
+
try {
|
|
184
|
+
inFlight = await findInFlightPromotions(connection, targetStageId);
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
// Guard failure must not break the existing promote flow, but surface it so operators can see
|
|
188
|
+
// the duplicate-promotion check was skipped rather than silently passing.
|
|
189
|
+
this.warn(messages.getMessage('warn.InFlightCheckSkipped', [err instanceof Error ? err.message : String(err)]));
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (inFlight.length > 0) {
|
|
193
|
+
const tokens = inFlight.map((p) => p.requestToken).filter(Boolean);
|
|
194
|
+
const plural = tokens.length > 1 ? 's' : '';
|
|
195
|
+
this.error(messages.getMessage('error.PromotionInFlight', [plural, tokens.join(', '), this.config.bin]));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
168
198
|
async runValidation(connection, pipelineId, workItemIds, targetStageId, allWorkItemsInStage = false) {
|
|
169
199
|
let result;
|
|
170
200
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../../../src/commands/devops/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAc,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../../../src/commands/devops/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAc,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,YAAY,EAEZ,sBAAsB,GAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACxH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,E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AC;QACJ,CAAC;IACH,CAAC"}
|
|
@@ -16,12 +16,24 @@
|
|
|
16
16
|
import { Messages } from '@salesforce/core';
|
|
17
17
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
18
|
import { validatePromotion, formatValidationDetails, hasSharedComponents, } from '../../../utils/promotionUtils.js';
|
|
19
|
-
import { validateSalesforceId } from '../../../utils/soqlUtils.js';
|
|
19
|
+
import { validateSalesforceId, normalizeSalesforceId } from '../../../utils/soqlUtils.js';
|
|
20
20
|
import { resolveProjectIdFromWorkItem } from '../../../utils/prepareWorkItem.js';
|
|
21
|
-
import { getPipelineIdForProject } from '../../../utils/pipelineUtils.js';
|
|
21
|
+
import { getPipelineIdForProject, fetchPipelineStages, computeFirstStageId } from '../../../utils/pipelineUtils.js';
|
|
22
22
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
23
23
|
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'devops.promotion.validate');
|
|
24
24
|
const commonErrorMessages = Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
25
|
+
/**
|
|
26
|
+
* Combine details describe how work items that share components could be merged before promotion.
|
|
27
|
+
* We request them regardless of work-item count, except when promoting to the pipeline's first
|
|
28
|
+
* stage: those work items come straight from dev branches and have no source stage, so Core's
|
|
29
|
+
* combine-details path NPEs on a null source stage.
|
|
30
|
+
*/
|
|
31
|
+
async function shouldCheckCombineDetails(connection, pipelineId, targetStageId) {
|
|
32
|
+
const stages = await fetchPipelineStages(connection, pipelineId);
|
|
33
|
+
const firstStageId = computeFirstStageId(stages);
|
|
34
|
+
const promotingToFirstStage = Boolean(firstStageId) && normalizeSalesforceId(targetStageId) === normalizeSalesforceId(firstStageId);
|
|
35
|
+
return !promotingToFirstStage;
|
|
36
|
+
}
|
|
25
37
|
export default class DevopsPromotionValidate extends SfCommand {
|
|
26
38
|
static summary = messages.getMessage('summary');
|
|
27
39
|
static description = messages.getMessage('description');
|
|
@@ -68,9 +80,10 @@ export default class DevopsPromotionValidate extends SfCommand {
|
|
|
68
80
|
}
|
|
69
81
|
throw error;
|
|
70
82
|
}
|
|
83
|
+
const checkCombineDetails = await shouldCheckCombineDetails(connection, pipelineId, targetStageId);
|
|
71
84
|
let result;
|
|
72
85
|
try {
|
|
73
|
-
result = await validatePromotion(connection, pipelineId, workItemIds, targetStageId,
|
|
86
|
+
result = await validatePromotion(connection, pipelineId, workItemIds, targetStageId, checkCombineDetails);
|
|
74
87
|
}
|
|
75
88
|
catch (error) {
|
|
76
89
|
const errMsg = error instanceof Error ? error.message : String(error);
|