@simplysf/simply-cicd 0.17.0 → 0.18.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 +73 -34
- package/lib/commands/simply/cicd/build/check-permission-sets.d.ts +14 -0
- package/lib/commands/simply/cicd/build/check-permission-sets.js +37 -0
- package/lib/commands/simply/cicd/build/check-permission-sets.js.map +1 -0
- package/lib/common/build/checkPermissionSets.d.ts +32 -0
- package/lib/common/build/checkPermissionSets.js +123 -0
- package/lib/common/build/checkPermissionSets.js.map +1 -0
- package/messages/simply.cicd.build.check-permission-sets.md +13 -0
- package/oclif.manifest.json +85 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -20,6 +20,7 @@ This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/sim
|
|
|
20
20
|
|
|
21
21
|
<!-- commands -->
|
|
22
22
|
|
|
23
|
+
- [`sf simply cicd build check-permission-sets`](#sf-simply-cicd-build-check-permission-sets)
|
|
23
24
|
- [`sf simply cicd build cleanup-scratch-orgs`](#sf-simply-cicd-build-cleanup-scratch-orgs)
|
|
24
25
|
- [`sf simply cicd build create-fallback-tag`](#sf-simply-cicd-build-create-fallback-tag)
|
|
25
26
|
- [`sf simply cicd build create-package-version`](#sf-simply-cicd-build-create-package-version)
|
|
@@ -55,6 +56,44 @@ This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/sim
|
|
|
55
56
|
- [`sf simply cicd notify teams`](#sf-simply-cicd-notify-teams)
|
|
56
57
|
- [`sf simply cicd sfdx-dependabot`](#sf-simply-cicd-sfdx-dependabot)
|
|
57
58
|
|
|
59
|
+
## `sf simply cicd build check-permission-sets`
|
|
60
|
+
|
|
61
|
+
Fail the pipeline when any generated permission set in the repo has drifted from its source metadata.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
USAGE
|
|
65
|
+
$ sf simply cicd build check-permission-sets [--json] [--flags-dir <value>] [--debug] [--disabled]
|
|
66
|
+
|
|
67
|
+
FLAGS
|
|
68
|
+
--debug [env: SIMPLY_CICD_DEBUG] Enable verbose debug logging.
|
|
69
|
+
--disabled [env: SIMPLY_CICD_DISABLED] Skip this job entirely, logging a warning instead of running it.
|
|
70
|
+
|
|
71
|
+
GLOBAL FLAGS
|
|
72
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
73
|
+
--json Format output as json.
|
|
74
|
+
|
|
75
|
+
DESCRIPTION
|
|
76
|
+
Fail the pipeline when any generated permission set in the repo has drifted from its source metadata.
|
|
77
|
+
|
|
78
|
+
Finds every permission sets file in the repo, meaning every file whose name ends in `.psbuild.json` (the JSON format
|
|
79
|
+
`sf simply permissions build --file` reads), and checks each permission set it declares, the same way `sf simply
|
|
80
|
+
permissions build --file <file> --check` does. Nothing is written. Files are found by walking the directory tree from
|
|
81
|
+
the current directory, skipping `node_modules`, `.git`, `.sf`, and `.sfdx`, so `find . -name '*.psbuild.json'` lists
|
|
82
|
+
what will be checked. Relative paths in a permission sets file resolve against the current directory, so run this from
|
|
83
|
+
the repo root.
|
|
84
|
+
|
|
85
|
+
Every file is checked before the command fails, so one run lists every permission set that has drifted or is missing,
|
|
86
|
+
along with the command that regenerates each file. A `.psbuild.json` file that fails validation fails the command
|
|
87
|
+
immediately. A repo with no `.psbuild.json` files is skipped with exit code 0, so the job is safe to include in a
|
|
88
|
+
shared pipeline template. Formatting differences, such as indentation, line endings, or comments, don't count as
|
|
89
|
+
drift.
|
|
90
|
+
|
|
91
|
+
EXAMPLES
|
|
92
|
+
$ sf simply cicd build check-permission-sets
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
_See code: [lib/commands/simply/cicd/build/check-permission-sets.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/check-permission-sets.js)_
|
|
96
|
+
|
|
58
97
|
## `sf simply cicd build cleanup-scratch-orgs`
|
|
59
98
|
|
|
60
99
|
Delete scratch orgs older than 3 hours from every configured Dev Hub.
|
|
@@ -84,7 +123,7 @@ EXAMPLES
|
|
|
84
123
|
$ sf simply cicd build cleanup-scratch-orgs --dev-hub my-devhub
|
|
85
124
|
```
|
|
86
125
|
|
|
87
|
-
_See code: [lib/commands/simply/cicd/build/cleanup-scratch-orgs.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
126
|
+
_See code: [lib/commands/simply/cicd/build/cleanup-scratch-orgs.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js)_
|
|
88
127
|
|
|
89
128
|
## `sf simply cicd build create-fallback-tag`
|
|
90
129
|
|
|
@@ -141,7 +180,7 @@ EXAMPLES
|
|
|
141
180
|
$ sf simply cicd build create-fallback-tag --ci-commit-ref-name main --ci-project-path group/project --project-access-token glpat-... --ci-pipeline-id 123
|
|
142
181
|
```
|
|
143
182
|
|
|
144
|
-
_See code: [lib/commands/simply/cicd/build/create-fallback-tag.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
183
|
+
_See code: [lib/commands/simply/cicd/build/create-fallback-tag.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-fallback-tag.js)_
|
|
145
184
|
|
|
146
185
|
## `sf simply cicd build create-package-version`
|
|
147
186
|
|
|
@@ -214,7 +253,7 @@ EXAMPLES
|
|
|
214
253
|
$ sf simply cicd build create-package-version --ci-commit-ref-name main --ci-commit-sha a1b2c3d --ci-pipeline-id 123 --ci-pipeline-url https://gitlab.example.com/pipelines/123 --ci-project-path group/project --project-access-token glpat-... --packaging-devhub my-packaging-devhub
|
|
215
254
|
```
|
|
216
255
|
|
|
217
|
-
_See code: [lib/commands/simply/cicd/build/create-package-version.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
256
|
+
_See code: [lib/commands/simply/cicd/build/create-package-version.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-package-version.js)_
|
|
218
257
|
|
|
219
258
|
## `sf simply cicd build create-scratch`
|
|
220
259
|
|
|
@@ -255,7 +294,7 @@ EXAMPLES
|
|
|
255
294
|
$ sf simply cicd build create-scratch --dev-hub my-devhub
|
|
256
295
|
```
|
|
257
296
|
|
|
258
|
-
_See code: [lib/commands/simply/cicd/build/create-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
297
|
+
_See code: [lib/commands/simply/cicd/build/create-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/create-scratch.js)_
|
|
259
298
|
|
|
260
299
|
## `sf simply cicd build delete-scratch`
|
|
261
300
|
|
|
@@ -294,7 +333,7 @@ EXAMPLES
|
|
|
294
333
|
$ sf simply cicd build delete-scratch --dev-hub my-devhub
|
|
295
334
|
```
|
|
296
335
|
|
|
297
|
-
_See code: [lib/commands/simply/cicd/build/delete-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
336
|
+
_See code: [lib/commands/simply/cicd/build/delete-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/delete-scratch.js)_
|
|
298
337
|
|
|
299
338
|
## `sf simply cicd build determine-package-changes`
|
|
300
339
|
|
|
@@ -327,7 +366,7 @@ EXAMPLES
|
|
|
327
366
|
$ sf simply cicd build determine-package-changes --out changes.env
|
|
328
367
|
```
|
|
329
368
|
|
|
330
|
-
_See code: [lib/commands/simply/cicd/build/determine-package-changes.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
369
|
+
_See code: [lib/commands/simply/cicd/build/determine-package-changes.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/determine-package-changes.js)_
|
|
331
370
|
|
|
332
371
|
## `sf simply cicd build generate-flexipage-diff`
|
|
333
372
|
|
|
@@ -385,7 +424,7 @@ EXAMPLES
|
|
|
385
424
|
$ sf simply cicd build generate-flexipage-diff --vcs-provider github --ci-repository my-org/my-repo --ci-pull-request-number 45 --ci-run-id 987 --from abc123 --to def456 --project-access-token ghp-...
|
|
386
425
|
```
|
|
387
426
|
|
|
388
|
-
_See code: [lib/commands/simply/cicd/build/generate-flexipage-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
427
|
+
_See code: [lib/commands/simply/cicd/build/generate-flexipage-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/generate-flexipage-diff.js)_
|
|
389
428
|
|
|
390
429
|
## `sf simply cicd build generate-flow-diff`
|
|
391
430
|
|
|
@@ -443,7 +482,7 @@ EXAMPLES
|
|
|
443
482
|
$ sf simply cicd build generate-flow-diff --vcs-provider github --ci-repository my-org/my-repo --ci-pull-request-number 45 --ci-run-id 987 --from abc123 --to def456 --project-access-token ghp-...
|
|
444
483
|
```
|
|
445
484
|
|
|
446
|
-
_See code: [lib/commands/simply/cicd/build/generate-flow-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
485
|
+
_See code: [lib/commands/simply/cicd/build/generate-flow-diff.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/generate-flow-diff.js)_
|
|
447
486
|
|
|
448
487
|
## `sf simply cicd build install-dependencies`
|
|
449
488
|
|
|
@@ -494,7 +533,7 @@ FLAG DESCRIPTIONS
|
|
|
494
533
|
prompt in a pipeline, it is auto-approved.
|
|
495
534
|
```
|
|
496
535
|
|
|
497
|
-
_See code: [lib/commands/simply/cicd/build/install-dependencies.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
536
|
+
_See code: [lib/commands/simply/cicd/build/install-dependencies.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/install-dependencies.js)_
|
|
498
537
|
|
|
499
538
|
## `sf simply cicd build lwc-jest`
|
|
500
539
|
|
|
@@ -534,7 +573,7 @@ EXAMPLES
|
|
|
534
573
|
$ sf simply cicd build lwc-jest --lwc-jest-fail-on-test-failure
|
|
535
574
|
```
|
|
536
575
|
|
|
537
|
-
_See code: [lib/commands/simply/cicd/build/lwc-jest.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
576
|
+
_See code: [lib/commands/simply/cicd/build/lwc-jest.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/lwc-jest.js)_
|
|
538
577
|
|
|
539
578
|
## `sf simply cicd build publish-utam-page-objects`
|
|
540
579
|
|
|
@@ -637,7 +676,7 @@ EXAMPLES
|
|
|
637
676
|
--subscriber-package-version-id 04tXXXXXXXXXXXXXXX --dry-run
|
|
638
677
|
```
|
|
639
678
|
|
|
640
|
-
_See code: [lib/commands/simply/cicd/build/publish-utam-page-objects.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
679
|
+
_See code: [lib/commands/simply/cicd/build/publish-utam-page-objects.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/publish-utam-page-objects.js)_
|
|
641
680
|
|
|
642
681
|
## `sf simply cicd build push-scratch`
|
|
643
682
|
|
|
@@ -678,7 +717,7 @@ EXAMPLES
|
|
|
678
717
|
$ sf simply cicd build push-scratch --jwt-key-file ./server.key
|
|
679
718
|
```
|
|
680
719
|
|
|
681
|
-
_See code: [lib/commands/simply/cicd/build/push-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
720
|
+
_See code: [lib/commands/simply/cicd/build/push-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/push-scratch.js)_
|
|
682
721
|
|
|
683
722
|
## `sf simply cicd build test-scratch`
|
|
684
723
|
|
|
@@ -714,7 +753,7 @@ EXAMPLES
|
|
|
714
753
|
$ sf simply cicd build test-scratch --jwt-key-file ./server.key
|
|
715
754
|
```
|
|
716
755
|
|
|
717
|
-
_See code: [lib/commands/simply/cicd/build/test-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
756
|
+
_See code: [lib/commands/simply/cicd/build/test-scratch.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/build/test-scratch.js)_
|
|
718
757
|
|
|
719
758
|
## `sf simply cicd deploy happy-soup deploy-unpackaged`
|
|
720
759
|
|
|
@@ -765,7 +804,7 @@ EXAMPLES
|
|
|
765
804
|
$ sf simply cicd deploy happy-soup deploy-unpackaged --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
766
805
|
```
|
|
767
806
|
|
|
768
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
807
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js)_
|
|
769
808
|
|
|
770
809
|
## `sf simply cicd deploy happy-soup deployment-close-out`
|
|
771
810
|
|
|
@@ -819,7 +858,7 @@ EXAMPLES
|
|
|
819
858
|
$ sf simply cicd deploy happy-soup deployment-close-out --ci-commit-ref-name main --ci-pipeline-id 123 --ci-project-path group/project --project-access-token $PROJECT_ACCESS_TOKEN --deploy-release-date 2026-01-15
|
|
820
859
|
```
|
|
821
860
|
|
|
822
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
861
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js)_
|
|
823
862
|
|
|
824
863
|
## `sf simply cicd deploy happy-soup install-packaged`
|
|
825
864
|
|
|
@@ -879,7 +918,7 @@ FLAG DESCRIPTIONS
|
|
|
879
918
|
prompt in a pipeline, it is auto-approved.
|
|
880
919
|
```
|
|
881
920
|
|
|
882
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
921
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js)_
|
|
883
922
|
|
|
884
923
|
## `sf simply cicd deploy happy-soup post-deploy`
|
|
885
924
|
|
|
@@ -930,7 +969,7 @@ EXAMPLES
|
|
|
930
969
|
$ sf simply cicd deploy happy-soup post-deploy --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
931
970
|
```
|
|
932
971
|
|
|
933
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
972
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js)_
|
|
934
973
|
|
|
935
974
|
## `sf simply cicd deploy happy-soup post-destructive`
|
|
936
975
|
|
|
@@ -981,7 +1020,7 @@ EXAMPLES
|
|
|
981
1020
|
$ sf simply cicd deploy happy-soup post-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
982
1021
|
```
|
|
983
1022
|
|
|
984
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1023
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js)_
|
|
985
1024
|
|
|
986
1025
|
## `sf simply cicd deploy happy-soup pre-destructive`
|
|
987
1026
|
|
|
@@ -1032,7 +1071,7 @@ EXAMPLES
|
|
|
1032
1071
|
$ sf simply cicd deploy happy-soup pre-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
|
|
1033
1072
|
```
|
|
1034
1073
|
|
|
1035
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1074
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js)_
|
|
1036
1075
|
|
|
1037
1076
|
## `sf simply cicd deploy happy-soup tag-deployment`
|
|
1038
1077
|
|
|
@@ -1084,7 +1123,7 @@ EXAMPLES
|
|
|
1084
1123
|
$ sf simply cicd deploy happy-soup tag-deployment --alias my-org --ci-pipeline-id 123 --ci-pipeline-url https://gitlab.example.com/group/project/-/pipelines/123 --ci-project-path group/project --ci-merge-request-iid 45 --ci-merge-request-project-url https://gitlab.example.com/group/project --project-access-token $PROJECT_ACCESS_TOKEN
|
|
1085
1124
|
```
|
|
1086
1125
|
|
|
1087
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1126
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js)_
|
|
1088
1127
|
|
|
1089
1128
|
## `sf simply cicd deploy happy-soup validate`
|
|
1090
1129
|
|
|
@@ -1122,7 +1161,7 @@ EXAMPLES
|
|
|
1122
1161
|
$ sf simply cicd deploy happy-soup validate --deploy-config-file deployment-configs/uat.json --deploy-rules-file config/deploy-rules.json
|
|
1123
1162
|
```
|
|
1124
1163
|
|
|
1125
|
-
_See code: [lib/commands/simply/cicd/deploy/happy-soup/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1164
|
+
_See code: [lib/commands/simply/cicd/deploy/happy-soup/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/happy-soup/validate.js)_
|
|
1126
1165
|
|
|
1127
1166
|
## `sf simply cicd deploy project deploy-unpackaged`
|
|
1128
1167
|
|
|
@@ -1170,7 +1209,7 @@ EXAMPLES
|
|
|
1170
1209
|
$ sf simply cicd deploy project deploy-unpackaged --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1171
1210
|
```
|
|
1172
1211
|
|
|
1173
|
-
_See code: [lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1212
|
+
_See code: [lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js)_
|
|
1174
1213
|
|
|
1175
1214
|
## `sf simply cicd deploy project install-packaged`
|
|
1176
1215
|
|
|
@@ -1234,7 +1273,7 @@ FLAG DESCRIPTIONS
|
|
|
1234
1273
|
prompt in a pipeline, it is auto-approved.
|
|
1235
1274
|
```
|
|
1236
1275
|
|
|
1237
|
-
_See code: [lib/commands/simply/cicd/deploy/project/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1276
|
+
_See code: [lib/commands/simply/cicd/deploy/project/install-packaged.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/install-packaged.js)_
|
|
1238
1277
|
|
|
1239
1278
|
## `sf simply cicd deploy project post-deploy`
|
|
1240
1279
|
|
|
@@ -1282,7 +1321,7 @@ EXAMPLES
|
|
|
1282
1321
|
$ sf simply cicd deploy project post-deploy --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1283
1322
|
```
|
|
1284
1323
|
|
|
1285
|
-
_See code: [lib/commands/simply/cicd/deploy/project/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1324
|
+
_See code: [lib/commands/simply/cicd/deploy/project/post-deploy.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/post-deploy.js)_
|
|
1286
1325
|
|
|
1287
1326
|
## `sf simply cicd deploy project post-destructive`
|
|
1288
1327
|
|
|
@@ -1330,7 +1369,7 @@ EXAMPLES
|
|
|
1330
1369
|
$ sf simply cicd deploy project post-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1331
1370
|
```
|
|
1332
1371
|
|
|
1333
|
-
_See code: [lib/commands/simply/cicd/deploy/project/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1372
|
+
_See code: [lib/commands/simply/cicd/deploy/project/post-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/post-destructive.js)_
|
|
1334
1373
|
|
|
1335
1374
|
## `sf simply cicd deploy project pre-destructive`
|
|
1336
1375
|
|
|
@@ -1378,7 +1417,7 @@ EXAMPLES
|
|
|
1378
1417
|
$ sf simply cicd deploy project pre-destructive --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1379
1418
|
```
|
|
1380
1419
|
|
|
1381
|
-
_See code: [lib/commands/simply/cicd/deploy/project/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1420
|
+
_See code: [lib/commands/simply/cicd/deploy/project/pre-destructive.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/pre-destructive.js)_
|
|
1382
1421
|
|
|
1383
1422
|
## `sf simply cicd deploy project run-apex-tests`
|
|
1384
1423
|
|
|
@@ -1425,7 +1464,7 @@ EXAMPLES
|
|
|
1425
1464
|
$ sf simply cicd deploy project run-apex-tests --ci-job-token $CI_JOB_TOKEN --alias my-org
|
|
1426
1465
|
```
|
|
1427
1466
|
|
|
1428
|
-
_See code: [lib/commands/simply/cicd/deploy/project/run-apex-tests.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1467
|
+
_See code: [lib/commands/simply/cicd/deploy/project/run-apex-tests.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/run-apex-tests.js)_
|
|
1429
1468
|
|
|
1430
1469
|
## `sf simply cicd deploy project validate`
|
|
1431
1470
|
|
|
@@ -1460,7 +1499,7 @@ EXAMPLES
|
|
|
1460
1499
|
$ sf simply cicd deploy project validate --deploy-config-file config/deploy.json --deploy-rules-file config/deploy-rules.json
|
|
1461
1500
|
```
|
|
1462
1501
|
|
|
1463
|
-
_See code: [lib/commands/simply/cicd/deploy/project/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1502
|
+
_See code: [lib/commands/simply/cicd/deploy/project/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/project/validate.js)_
|
|
1464
1503
|
|
|
1465
1504
|
## `sf simply cicd deploy validate`
|
|
1466
1505
|
|
|
@@ -1494,7 +1533,7 @@ EXAMPLES
|
|
|
1494
1533
|
$ sf simply cicd deploy validate --deploy-config-file config/deploy.json --deploy-rules-file config/deploy-rules.json
|
|
1495
1534
|
```
|
|
1496
1535
|
|
|
1497
|
-
_See code: [lib/commands/simply/cicd/deploy/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1536
|
+
_See code: [lib/commands/simply/cicd/deploy/validate.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/deploy/validate.js)_
|
|
1498
1537
|
|
|
1499
1538
|
## `sf simply cicd notify build`
|
|
1500
1539
|
|
|
@@ -1570,7 +1609,7 @@ EXAMPLES
|
|
|
1570
1609
|
--teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1571
1610
|
```
|
|
1572
1611
|
|
|
1573
|
-
_See code: [lib/commands/simply/cicd/notify/build.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1612
|
+
_See code: [lib/commands/simply/cicd/notify/build.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/notify/build.js)_
|
|
1574
1613
|
|
|
1575
1614
|
## `sf simply cicd notify happy-soup`
|
|
1576
1615
|
|
|
@@ -1643,7 +1682,7 @@ EXAMPLES
|
|
|
1643
1682
|
$ sf simply cicd notify happy-soup --after-script --is-final-job --notify-on-completion --ci-job-status success --teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1644
1683
|
```
|
|
1645
1684
|
|
|
1646
|
-
_See code: [lib/commands/simply/cicd/notify/happy-soup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1685
|
+
_See code: [lib/commands/simply/cicd/notify/happy-soup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/notify/happy-soup.js)_
|
|
1647
1686
|
|
|
1648
1687
|
## `sf simply cicd notify project`
|
|
1649
1688
|
|
|
@@ -1717,7 +1756,7 @@ EXAMPLES
|
|
|
1717
1756
|
$ sf simply cicd notify project --after-script --ci-job-stage post-destructive --ci-job-status success --teams-webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1718
1757
|
```
|
|
1719
1758
|
|
|
1720
|
-
_See code: [lib/commands/simply/cicd/notify/project.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1759
|
+
_See code: [lib/commands/simply/cicd/notify/project.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/notify/project.js)_
|
|
1721
1760
|
|
|
1722
1761
|
## `sf simply cicd notify teams`
|
|
1723
1762
|
|
|
@@ -1749,7 +1788,7 @@ EXAMPLES
|
|
|
1749
1788
|
$ sf simply cicd notify teams --payload '{"text":"Deployment complete"}' --webhook-url https://outlook.office.com/webhook/... --enabled
|
|
1750
1789
|
```
|
|
1751
1790
|
|
|
1752
|
-
_See code: [lib/commands/simply/cicd/notify/teams.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1791
|
+
_See code: [lib/commands/simply/cicd/notify/teams.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/notify/teams.js)_
|
|
1753
1792
|
|
|
1754
1793
|
## `sf simply cicd sfdx-dependabot`
|
|
1755
1794
|
|
|
@@ -1825,7 +1864,7 @@ FLAG DESCRIPTIONS
|
|
|
1825
1864
|
Defaults to the selected provider's public instance if not provided.
|
|
1826
1865
|
```
|
|
1827
1866
|
|
|
1828
|
-
_See code: [lib/commands/simply/cicd/sfdx-dependabot.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.
|
|
1867
|
+
_See code: [lib/commands/simply/cicd/sfdx-dependabot.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-cicd@0.18.0/packages/simply-cicd/lib/commands/simply/cicd/sfdx-dependabot.js)_
|
|
1829
1868
|
<!-- commandsstop -->
|
|
1830
1869
|
|
|
1831
1870
|
## License
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type RunCheckPermissionSetsResult } from '../../../../common/build/checkPermissionSets.js';
|
|
3
|
+
/** Checks every permission sets file in the repo for permission sets that have drifted from their source metadata. */
|
|
4
|
+
export default class BuildCheckPermissionSets extends SfCommand<RunCheckPermissionSetsResult> {
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
disabled: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<RunCheckPermissionSetsResult>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { runCheckPermissionSets, } from '../../../../common/build/checkPermissionSets.js';
|
|
19
|
+
import { debugFlag, disabledFlag } from '../../../../common/build/flags.js';
|
|
20
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
21
|
+
const messages = Messages.loadMessages('@simplysf/simply-cicd', 'simply.cicd.build.check-permission-sets');
|
|
22
|
+
/** Checks every permission sets file in the repo for permission sets that have drifted from their source metadata. */
|
|
23
|
+
export default class BuildCheckPermissionSets extends SfCommand {
|
|
24
|
+
static summary = messages.getMessage('summary');
|
|
25
|
+
static description = messages.getMessage('description');
|
|
26
|
+
static examples = messages.getMessages('examples');
|
|
27
|
+
static flags = {
|
|
28
|
+
...SfCommand.baseFlags,
|
|
29
|
+
...debugFlag,
|
|
30
|
+
...disabledFlag,
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const { flags } = await this.parse(BuildCheckPermissionSets);
|
|
34
|
+
return runCheckPermissionSets({ disabled: flags.disabled });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=check-permission-sets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-permission-sets.js","sourceRoot":"","sources":["../../../../../src/commands/simply/cicd/build/check-permission-sets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EACL,sBAAsB,GAEvB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAE5E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,uBAAuB,EAAE,yCAAyC,CAAC,CAAC;AAE3G,sHAAsH;AACtH,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,SAAuC;IACpF,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,GAAG,SAAS,CAAC,SAAS;QACtB,GAAG,SAAS;QACZ,GAAG,YAAY;KAChB,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAE7D,OAAO,sBAAsB,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9D,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type PermissionSetCheckResult } from '@simplysf/simply-permissions-core';
|
|
2
|
+
/** The suffix that marks a permission sets file (the `simply permissions build --file` format). Also defined in `simply-permissions`. */
|
|
3
|
+
export declare const PERMISSION_SETS_FILE_SUFFIX = ".psbuild.json";
|
|
4
|
+
export type RunCheckPermissionSetsOptions = {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type PermissionSetsFileCheck = {
|
|
8
|
+
file: string;
|
|
9
|
+
permissionSets: PermissionSetCheckResult[];
|
|
10
|
+
};
|
|
11
|
+
export type RunCheckPermissionSetsResult = {
|
|
12
|
+
skipped: boolean;
|
|
13
|
+
files: PermissionSetsFileCheck[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Every permission sets file under the current directory: each file whose name ends in
|
|
17
|
+
* {@link PERMISSION_SETS_FILE_SUFFIX}, found by walking the tree. Skipped directories are pruned
|
|
18
|
+
* rather than filtered afterwards, so `node_modules` is never read, and symbolic links aren't followed.
|
|
19
|
+
* Doesn't consult git: tracked, untracked, and ignored files are all found.
|
|
20
|
+
*
|
|
21
|
+
* @returns Paths relative to the current directory with `/` separators, sorted.
|
|
22
|
+
*/
|
|
23
|
+
export declare function findPermissionSetsFiles(): Promise<string[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Finds every permission sets file in the repo and checks each permission set it declares against
|
|
26
|
+
* the generated file on disk, writing nothing. A repo with no permission sets files is a skip. Every
|
|
27
|
+
* file is checked before failing, so one run reports every stale permission set; an invalid file
|
|
28
|
+
* fails at once.
|
|
29
|
+
*
|
|
30
|
+
* @throws When any permission set has drifted or is missing, or a permission sets file is invalid.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runCheckPermissionSets(options: RunCheckPermissionSetsOptions): Promise<RunCheckPermissionSetsResult>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { promises as fs } from 'node:fs';
|
|
17
|
+
import { checkPermissionSets, loadPermissionSetsFile, PermissionSetBuildError, } from '@simplysf/simply-permissions-core';
|
|
18
|
+
import { logger } from '../logger.js';
|
|
19
|
+
/** The suffix that marks a permission sets file (the `simply permissions build --file` format). Also defined in `simply-permissions`. */
|
|
20
|
+
export const PERMISSION_SETS_FILE_SUFFIX = '.psbuild.json';
|
|
21
|
+
/** Directories never searched: dependencies, VCS data, and Salesforce CLI state. */
|
|
22
|
+
const SKIPPED_DIRECTORIES = new Set(['node_modules', '.git', '.sf', '.sfdx']);
|
|
23
|
+
/**
|
|
24
|
+
* Every permission sets file under the current directory: each file whose name ends in
|
|
25
|
+
* {@link PERMISSION_SETS_FILE_SUFFIX}, found by walking the tree. Skipped directories are pruned
|
|
26
|
+
* rather than filtered afterwards, so `node_modules` is never read, and symbolic links aren't followed.
|
|
27
|
+
* Doesn't consult git: tracked, untracked, and ignored files are all found.
|
|
28
|
+
*
|
|
29
|
+
* @returns Paths relative to the current directory with `/` separators, sorted.
|
|
30
|
+
*/
|
|
31
|
+
export async function findPermissionSetsFiles() {
|
|
32
|
+
const matches = [];
|
|
33
|
+
const walk = async (dir) => {
|
|
34
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
35
|
+
for (const entry of entries) {
|
|
36
|
+
const relativePath = dir === '.' ? entry.name : `${dir}/${entry.name}`;
|
|
37
|
+
if (entry.isDirectory()) {
|
|
38
|
+
if (!SKIPPED_DIRECTORIES.has(entry.name)) {
|
|
39
|
+
// eslint-disable-next-line no-await-in-loop -- depth-first keeps the open directory handles to one
|
|
40
|
+
await walk(relativePath);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else if (entry.isFile() && entry.name.endsWith(PERMISSION_SETS_FILE_SUFFIX)) {
|
|
44
|
+
matches.push(relativePath);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
await walk('.');
|
|
49
|
+
return matches.sort();
|
|
50
|
+
}
|
|
51
|
+
/** The same text `simply permissions build` reports for each `PermissionSetBuildError` code. */
|
|
52
|
+
function describeBuildError(error) {
|
|
53
|
+
switch (error.code) {
|
|
54
|
+
case 'scan-failed':
|
|
55
|
+
return `Failed to scan the Salesforce project directory: ${error.args[0]}`;
|
|
56
|
+
case 'invalid-config':
|
|
57
|
+
return `The configuration file ${error.args[0]} is invalid: ${error.args[1]}`;
|
|
58
|
+
case 'config-not-found':
|
|
59
|
+
return `The configuration file ${error.args[0]} does not exist.`;
|
|
60
|
+
case 'directory-not-found':
|
|
61
|
+
return `The source directory ${error.args[0]} for permission set ${error.args[1]} does not exist.`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function checkFile(file) {
|
|
65
|
+
try {
|
|
66
|
+
return { file, permissionSets: await checkPermissionSets(await loadPermissionSetsFile(file)) };
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error instanceof PermissionSetBuildError) {
|
|
70
|
+
const message = `Permission sets file ${file}: ${describeBuildError(error)}`;
|
|
71
|
+
logger.error(message);
|
|
72
|
+
throw new Error(message, { cause: error });
|
|
73
|
+
}
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Finds every permission sets file in the repo and checks each permission set it declares against
|
|
79
|
+
* the generated file on disk, writing nothing. A repo with no permission sets files is a skip. Every
|
|
80
|
+
* file is checked before failing, so one run reports every stale permission set; an invalid file
|
|
81
|
+
* fails at once.
|
|
82
|
+
*
|
|
83
|
+
* @throws When any permission set has drifted or is missing, or a permission sets file is invalid.
|
|
84
|
+
*/
|
|
85
|
+
export async function runCheckPermissionSets(options) {
|
|
86
|
+
if (options.disabled) {
|
|
87
|
+
logger.warn('check-permission-sets is disabled. Skipping.');
|
|
88
|
+
return { skipped: true, files: [] };
|
|
89
|
+
}
|
|
90
|
+
const files = await findPermissionSetsFiles();
|
|
91
|
+
if (files.length === 0) {
|
|
92
|
+
logger.warn('No permission sets files found. Skipping.');
|
|
93
|
+
return { skipped: true, files: [] };
|
|
94
|
+
}
|
|
95
|
+
const checks = [];
|
|
96
|
+
let total = 0;
|
|
97
|
+
let stale = 0;
|
|
98
|
+
for (const file of files) {
|
|
99
|
+
logger.info(`Checking permission sets file ${file}...`);
|
|
100
|
+
// eslint-disable-next-line no-await-in-loop -- files are checked in order so the log reads top to bottom
|
|
101
|
+
const check = await checkFile(file);
|
|
102
|
+
checks.push(check);
|
|
103
|
+
const staleSets = check.permissionSets.filter((permissionSet) => permissionSet.status !== 'up-to-date');
|
|
104
|
+
total += check.permissionSets.length;
|
|
105
|
+
stale += staleSets.length;
|
|
106
|
+
if (staleSets.length === 0) {
|
|
107
|
+
logger.success(`${check.permissionSets.length} permission set(s) up to date.`);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
for (const permissionSet of staleSets) {
|
|
111
|
+
logger.error(`${permissionSet.name} ${permissionSet.status} ${permissionSet.path}`);
|
|
112
|
+
}
|
|
113
|
+
logger.log(`Regenerate with: sf simply permissions build --file ${file}`);
|
|
114
|
+
}
|
|
115
|
+
if (stale > 0) {
|
|
116
|
+
const message = `${stale} of ${total} permission set(s) have drifted from their source metadata or are missing.`;
|
|
117
|
+
logger.error(message);
|
|
118
|
+
throw new Error(message);
|
|
119
|
+
}
|
|
120
|
+
logger.success(`All ${total} permission set(s) in ${files.length} permission sets file(s) are up to date.`);
|
|
121
|
+
return { skipped: false, files: checks };
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=checkPermissionSets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkPermissionSets.js","sourceRoot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AAgC,CAAC,CAAC;YAC/E,SAAS;QACX,CAAC;QACD,KAAK,MAAM,aAAa,IAAI,SAAS,EAAE,CAAC;YACtC,MAAM,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,IAAI,IAAI,aAAa,CAAC,MAAM,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,uDAAuD,IAAI,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,MAAM,OAAO,GAAG,GAAG,KAAK,OAAO,KAAK,4EAA4E,CAAC;QACjH,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAO,KAAK,yBAAyB,KAAK,CAAC,MAAM,0CAA0C,CAAC,CAAC;IAC5G,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Fail the pipeline when any generated permission set in the repo has drifted from its source metadata.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Finds every permission sets file in the repo, meaning every file whose name ends in `.psbuild.json` (the JSON format `sf simply permissions build --file` reads), and checks each permission set it declares, the same way `sf simply permissions build --file <file> --check` does. Nothing is written. Files are found by walking the directory tree from the current directory, skipping `node_modules`, `.git`, `.sf`, and `.sfdx`, so `find . -name '*.psbuild.json'` lists what will be checked. Relative paths in a permission sets file resolve against the current directory, so run this from the repo root.
|
|
8
|
+
|
|
9
|
+
Every file is checked before the command fails, so one run lists every permission set that has drifted or is missing, along with the command that regenerates each file. A `.psbuild.json` file that fails validation fails the command immediately. A repo with no `.psbuild.json` files is skipped with exit code 0, so the job is safe to include in a shared pipeline template. Formatting differences, such as indentation, line endings, or comments, don't count as drift.
|
|
10
|
+
|
|
11
|
+
# examples
|
|
12
|
+
|
|
13
|
+
- <%= config.bin %> <%= command.id %>
|
package/oclif.manifest.json
CHANGED
|
@@ -277,6 +277,90 @@
|
|
|
277
277
|
"validate:deploy:cicd:simply"
|
|
278
278
|
]
|
|
279
279
|
},
|
|
280
|
+
"simply:cicd:build:check-permission-sets": {
|
|
281
|
+
"aliases": [],
|
|
282
|
+
"args": {},
|
|
283
|
+
"description": "Finds every permission sets file in the repo, meaning every file whose name ends in `.psbuild.json` (the JSON format `sf simply permissions build --file` reads), and checks each permission set it declares, the same way `sf simply permissions build --file <file> --check` does. Nothing is written. Files are found by walking the directory tree from the current directory, skipping `node_modules`, `.git`, `.sf`, and `.sfdx`, so `find . -name '*.psbuild.json'` lists what will be checked. Relative paths in a permission sets file resolve against the current directory, so run this from the repo root.\n\nEvery file is checked before the command fails, so one run lists every permission set that has drifted or is missing, along with the command that regenerates each file. A `.psbuild.json` file that fails validation fails the command immediately. A repo with no `.psbuild.json` files is skipped with exit code 0, so the job is safe to include in a shared pipeline template. Formatting differences, such as indentation, line endings, or comments, don't count as drift.",
|
|
284
|
+
"examples": [
|
|
285
|
+
"<%= config.bin %> <%= command.id %>"
|
|
286
|
+
],
|
|
287
|
+
"flags": {
|
|
288
|
+
"json": {
|
|
289
|
+
"description": "Format output as json.",
|
|
290
|
+
"helpGroup": "GLOBAL",
|
|
291
|
+
"name": "json",
|
|
292
|
+
"allowNo": false,
|
|
293
|
+
"type": "boolean"
|
|
294
|
+
},
|
|
295
|
+
"flags-dir": {
|
|
296
|
+
"helpGroup": "GLOBAL",
|
|
297
|
+
"name": "flags-dir",
|
|
298
|
+
"summary": "Import flag values from a directory.",
|
|
299
|
+
"hasDynamicHelp": false,
|
|
300
|
+
"multiple": false,
|
|
301
|
+
"type": "option"
|
|
302
|
+
},
|
|
303
|
+
"debug": {
|
|
304
|
+
"env": "SIMPLY_CICD_DEBUG",
|
|
305
|
+
"name": "debug",
|
|
306
|
+
"summary": "Enable verbose debug logging.",
|
|
307
|
+
"allowNo": false,
|
|
308
|
+
"type": "boolean"
|
|
309
|
+
},
|
|
310
|
+
"disabled": {
|
|
311
|
+
"env": "SIMPLY_CICD_DISABLED",
|
|
312
|
+
"name": "disabled",
|
|
313
|
+
"summary": "Skip this job entirely, logging a warning instead of running it.",
|
|
314
|
+
"allowNo": false,
|
|
315
|
+
"type": "boolean"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"hasDynamicHelp": false,
|
|
319
|
+
"hiddenAliases": [],
|
|
320
|
+
"id": "simply:cicd:build:check-permission-sets",
|
|
321
|
+
"pluginAlias": "@simplysf/simply-cicd",
|
|
322
|
+
"pluginName": "@simplysf/simply-cicd",
|
|
323
|
+
"pluginType": "core",
|
|
324
|
+
"strict": true,
|
|
325
|
+
"summary": "Fail the pipeline when any generated permission set in the repo has drifted from its source metadata.",
|
|
326
|
+
"enableJsonFlag": true,
|
|
327
|
+
"isESM": true,
|
|
328
|
+
"relativePath": [
|
|
329
|
+
"lib",
|
|
330
|
+
"commands",
|
|
331
|
+
"simply",
|
|
332
|
+
"cicd",
|
|
333
|
+
"build",
|
|
334
|
+
"check-permission-sets.js"
|
|
335
|
+
],
|
|
336
|
+
"aliasPermutations": [],
|
|
337
|
+
"permutations": [
|
|
338
|
+
"simply:cicd:build:check-permission-sets",
|
|
339
|
+
"cicd:simply:build:check-permission-sets",
|
|
340
|
+
"cicd:build:simply:check-permission-sets",
|
|
341
|
+
"cicd:build:check-permission-sets:simply",
|
|
342
|
+
"simply:build:cicd:check-permission-sets",
|
|
343
|
+
"build:simply:cicd:check-permission-sets",
|
|
344
|
+
"build:cicd:simply:check-permission-sets",
|
|
345
|
+
"build:cicd:check-permission-sets:simply",
|
|
346
|
+
"simply:build:check-permission-sets:cicd",
|
|
347
|
+
"build:simply:check-permission-sets:cicd",
|
|
348
|
+
"build:check-permission-sets:simply:cicd",
|
|
349
|
+
"build:check-permission-sets:cicd:simply",
|
|
350
|
+
"simply:cicd:check-permission-sets:build",
|
|
351
|
+
"cicd:simply:check-permission-sets:build",
|
|
352
|
+
"cicd:check-permission-sets:simply:build",
|
|
353
|
+
"cicd:check-permission-sets:build:simply",
|
|
354
|
+
"simply:check-permission-sets:cicd:build",
|
|
355
|
+
"check-permission-sets:simply:cicd:build",
|
|
356
|
+
"check-permission-sets:cicd:simply:build",
|
|
357
|
+
"check-permission-sets:cicd:build:simply",
|
|
358
|
+
"simply:check-permission-sets:build:cicd",
|
|
359
|
+
"check-permission-sets:simply:build:cicd",
|
|
360
|
+
"check-permission-sets:build:simply:cicd",
|
|
361
|
+
"check-permission-sets:build:cicd:simply"
|
|
362
|
+
]
|
|
363
|
+
},
|
|
280
364
|
"simply:cicd:build:cleanup-scratch-orgs": {
|
|
281
365
|
"aliases": [],
|
|
282
366
|
"args": {},
|
|
@@ -6712,5 +6796,5 @@
|
|
|
6712
6796
|
]
|
|
6713
6797
|
}
|
|
6714
6798
|
},
|
|
6715
|
-
"version": "0.
|
|
6799
|
+
"version": "0.18.0"
|
|
6716
6800
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysf/simply-cicd",
|
|
3
3
|
"description": "Commands for Salesforce CI/CD pipelines",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.18.0",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply-plugins",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply-plugins/issues",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"@simplysf/simply-cicd-core": "^0.2.2",
|
|
65
65
|
"@simplysf/simply-core": "^1.6.7",
|
|
66
66
|
"@simplysf/simply-package-core": "^0.3.0",
|
|
67
|
+
"@simplysf/simply-permissions-core": "^0.4.0",
|
|
67
68
|
"chalk": "^5.6.2",
|
|
68
69
|
"execa": "^8.0.1",
|
|
69
70
|
"handlebars": "^4.7.9",
|
|
@@ -206,5 +207,5 @@
|
|
|
206
207
|
"output": []
|
|
207
208
|
}
|
|
208
209
|
},
|
|
209
|
-
"gitHead": "
|
|
210
|
+
"gitHead": "cfc320bc665f61d2ab5c702ea9120bddc34b6078"
|
|
210
211
|
}
|