@salesforce/afv-skills 1.33.0 → 1.35.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/package.json +1 -1
- package/skills/agentforce-architecture-analyze/SKILL.md +8 -0
- package/skills/agentforce-bot-upgrade/SKILL.md +0 -2
- package/skills/agentforce-d360-analyze/SKILL.md +8 -0
- package/skills/agentforce-observe/SKILL.md +3 -0
- package/skills/agentforce-test/SKILL.md +3 -0
- package/skills/automation-flow-generate/SKILL.md +1 -0
- package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +239 -0
- package/skills/automation-sandbox-post-copy-config-generate/assets/config_template.json +21 -0
- package/skills/automation-sandbox-post-copy-config-generate/assets/json_schema.json +90 -0
- package/skills/automation-sandbox-post-copy-config-generate/examples/sample_sop_excerpt.md +31 -0
- package/skills/automation-sandbox-post-copy-config-generate/examples/sample_sop_to_config.json +50 -0
- package/skills/automation-sandbox-post-copy-config-generate/references/configuration_catalog.md +76 -0
- package/skills/automation-sandbox-post-copy-config-generate/references/sop_parsing_patterns.md +157 -0
- package/skills/automation-sandbox-post-copy-config-generate/references/source_format_handling.md +230 -0
- package/skills/commerce-b2b-open-code-components-integrate/SKILL.md +8 -0
- package/skills/commerce-b2b-open-code-components-replace/SKILL.md +2 -0
- package/skills/commerce-b2b-store-create/SKILL.md +4 -1
- package/skills/data360-activate/SKILL.md +12 -0
- package/skills/data360-code-extension-generate/SKILL.md +6 -6
- package/skills/data360-connect/SKILL.md +11 -0
- package/skills/data360-harmonize/SKILL.md +11 -0
- package/skills/data360-orchestrate/SKILL.md +30 -0
- package/skills/data360-prepare/SKILL.md +14 -0
- package/skills/data360-query/SKILL.md +10 -0
- package/skills/data360-schema-get/SKILL.md +7 -0
- package/skills/data360-segment/SKILL.md +11 -0
- package/skills/design-systems-slds-validate/SKILL.md +8 -0
- package/skills/design-systems-slds2-migrate/SKILL.md +3 -0
- package/skills/dx-apexguru-scan/SKILL.md +403 -0
- package/skills/dx-apexguru-scan/examples/README.md +54 -0
- package/skills/dx-apexguru-scan/examples/sample-decoded-summary.json +176 -0
- package/skills/dx-apexguru-scan/examples/sample-full-no-runtime-response.json +26 -0
- package/skills/dx-apexguru-scan/examples/sample-succeeded-response.json +15 -0
- package/skills/dx-apexguru-scan/references/api-reference.md +81 -0
- package/skills/dx-apexguru-scan/references/authentication.md +134 -0
- package/skills/dx-apexguru-scan/references/error-handling.md +56 -0
- package/skills/dx-apexguru-scan/references/violation-catalog.md +28 -0
- package/skills/dx-apexguru-scan/scripts/build-zip.sh +87 -0
- package/skills/dx-apexguru-scan/scripts/decode-report.js +389 -0
- package/skills/dx-apexguru-scan/scripts/resolve-token.sh +151 -0
- package/skills/dx-apexguru-scan/scripts/run-scan.sh +153 -0
- package/skills/dx-apexguru-scan/scripts/scan.sh +96 -0
- package/skills/dx-apexguru-scan/scripts/validate-token.js +121 -0
- package/skills/dx-app-analytics-query/SKILL.md +5 -0
- package/skills/dx-code-analyzer-configure/SKILL.md +5 -5
- package/skills/dx-code-analyzer-custom-rule-create/SKILL.md +3 -1
- package/skills/dx-code-analyzer-run/SKILL.md +10 -2
- package/skills/dx-devops-pipeline-manage/SKILL.md +263 -0
- package/skills/dx-devops-pipeline-manage/examples/common-workflows.md +177 -0
- package/skills/dx-devops-pipeline-manage/references/cli-commands.md +298 -0
- package/skills/dx-devops-pipeline-manage/references/parsing-patterns.md +134 -0
- package/skills/dx-devops-pipeline-manage/scripts/check-activation-ready.sh +34 -0
- package/skills/dx-devops-pipeline-manage/scripts/validate-org-type.sh +17 -0
- package/skills/dx-devops-pipeline-manage/scripts/verify-operation.sh +82 -0
- package/skills/dx-devops-promote/SKILL.md +214 -0
- package/skills/dx-devops-promote/examples/promotion-workflows.md +212 -0
- package/skills/dx-devops-promote/references/cli-commands.md +303 -0
- package/skills/dx-devops-test-failures-analyze/SKILL.md +8 -0
- package/skills/dx-devops-test-pipeline-configure/SKILL.md +7 -0
- package/skills/dx-devops-test-suite-assignments-configure/SKILL.md +9 -0
- package/skills/dx-devops-test-suite-run/SKILL.md +8 -0
- package/skills/dx-org-switch/SKILL.md +3 -0
- package/skills/experience-lwc-base-components-integrate/SKILL.md +176 -0
- package/skills/experience-lwc-base-components-integrate/references/lbc-expert-guidance.md +127 -0
- package/skills/experience-lwc-base-components-integrate/references/lightning-component-index.md +179 -0
- package/skills/experience-lwc-base-components-integrate/references/lightning-components.md +5429 -0
- package/skills/experience-lwc-base-components-integrate/scripts/extract-component-docs.sh +61 -0
- package/skills/experience-lwc-generate/SKILL.md +18 -0
- package/skills/experience-lwc-rtl-validate/SKILL.md +149 -0
- package/skills/experience-lwc-rtl-validate/references/rtl-expert.md +892 -0
- package/skills/experience-lwc-rtl-validate/scripts/scan-rtl-css.sh +206 -0
- package/skills/experience-lwc-typescript-migrate/SKILL.md +207 -0
- package/skills/experience-lwc-typescript-migrate/assets/dts-template.ts +15 -0
- package/skills/experience-lwc-typescript-migrate/assets/type-patterns.ts +44 -0
- package/skills/experience-lwc-typescript-migrate/scripts/find-consumers.sh +128 -0
- package/skills/experience-lwr-site-generate/SKILL.md +1 -1
- package/skills/experience-ui-bundle-agentforce-client-generate/SKILL.md +5 -2
- package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +1 -1
- package/skills/experience-ui-bundle-file-upload-generate/SKILL.md +5 -0
- package/skills/experience-ui-bundle-localize/SKILL.md +323 -0
- package/skills/experience-ui-bundle-localize/references/gotchas.md +249 -0
- package/skills/experience-ui-bundle-localize/references/i18n-setup.md +169 -0
- package/skills/experience-ui-bundle-localize/references/interpolation.md +311 -0
- package/skills/experience-ui-bundle-localize/references/label-xml.md +282 -0
- package/skills/experience-ui-bundle-localize/references/verifying.md +219 -0
- package/skills/experience-ui-bundle-localize/scripts/check-i18n-wired.sh +195 -0
- package/skills/experience-ui-bundle-localize/scripts/check-manifest-registered.sh +100 -0
- package/skills/experience-ui-bundle-localize/scripts/check-org-api-version.sh +40 -0
- package/skills/experience-ui-bundle-localize/scripts/detect-bundle-type.sh +57 -0
- package/skills/experience-ui-bundle-metadata-generate/SKILL.md +1 -1
- package/skills/experience-ui-bundle-project-generate/SKILL.md +4 -4
- package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +11 -0
- package/skills/external-diagram-mermaid-generate/SKILL.md +21 -0
- package/skills/integration-connectivity-generate/SKILL.md +17 -0
- package/skills/integration-eventing-cdc-configure/SKILL.md +9 -0
- package/skills/integration-eventing-subscription-configure/SKILL.md +7 -0
- package/skills/mobile-apps-create/SKILL.md +5 -0
- package/skills/mobile-platform-native-capabilities-integrate/SKILL.md +3 -0
- package/skills/mobile-platform-offline-validate/SKILL.md +9 -0
- package/skills/omnistudio-callable-apex-generate/SKILL.md +14 -0
- package/skills/omnistudio-datamapper-generate/SKILL.md +13 -0
- package/skills/omnistudio-datapacks-deploy/SKILL.md +18 -0
- package/skills/omnistudio-dependencies-analyze/SKILL.md +12 -0
- package/skills/omnistudio-epc-catalog-generate/SKILL.md +15 -0
- package/skills/omnistudio-flexcard-generate/SKILL.md +11 -0
- package/skills/omnistudio-integration-procedure-generate/SKILL.md +11 -0
- package/skills/omnistudio-omniscript-generate/SKILL.md +9 -0
- package/skills/platform-agentexchange-partner-offers-configure/SKILL.md +8 -0
- package/skills/platform-agentsetup-categories-fetch/SKILL.md +3 -0
- package/skills/platform-apex-generate/SKILL.md +5 -0
- package/skills/platform-apex-logs-debug/SKILL.md +12 -0
- package/skills/platform-apex-test-generate/SKILL.md +5 -0
- package/skills/platform-apex-test-run/SKILL.md +14 -0
- package/skills/platform-custom-application-generate/SKILL.md +1 -0
- package/skills/platform-custom-field-generate/SKILL.md +1 -1
- package/skills/platform-custom-lightning-type-generate/SKILL.md +3 -0
- package/skills/platform-custom-lightning-type-generate/assets/primitive-types-and-constraints.md +1 -1
- package/skills/platform-custom-tab-generate/SKILL.md +1 -0
- package/skills/platform-data-manage/SKILL.md +15 -0
- package/skills/platform-dataspace-access-configure/SKILL.md +2 -2
- package/skills/platform-flexipage-generate/SKILL.md +3 -0
- package/skills/platform-lightning-app-coordinate/SKILL.md +18 -1
- package/skills/platform-mcp-tool-widget-coordinate/SKILL.md +250 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/action-name-source-prompt.md +74 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/apex-invocable-source-prompt.md +90 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-source-prompt.md +191 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/pasted-tool-output-prompt.md +85 -0
- package/skills/platform-mcp-tool-widget-coordinate/references/build-plan-format.md +74 -0
- package/skills/platform-mcp-tool-widget-coordinate/references/mcp-tool-output-discovery.md +184 -0
- package/skills/platform-mcp-tool-widget-coordinate/references/two-clt-modeling.md +128 -0
- package/skills/platform-mcp-tool-widget-coordinate/references/validation-gates.md +181 -0
- package/skills/platform-metadata-api-context-get/SKILL.md +6 -2
- package/skills/platform-metadata-retrieve/SKILL.md +5 -0
- package/skills/platform-models-api-configure/SKILL.md +10 -0
- package/skills/platform-permission-set-generate/SKILL.md +1 -2
- package/skills/platform-policy-rule-generate/SKILL.md +2 -0
- package/skills/platform-report-generate/SKILL.md +1 -1
- package/skills/platform-sharing-rules-generate/SKILL.md +1 -1
- package/skills/platform-soql-query/SKILL.md +13 -0
- package/skills/platform-tracing-agentforce-configure/SKILL.md +5 -1
- package/skills/platform-tracing-configure/SKILL.md +4 -1
- package/skills/platform-trust-archive-manage/SKILL.md +3 -0
- package/skills/platform-validation-rule-generate/SKILL.md +1 -0
- package/skills/platform-widget-generate/SKILL.md +2 -1
- package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +3 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# DevOps Center Pipeline CLI Commands Reference
|
|
2
|
+
|
|
3
|
+
Command reference for `sf devops pipeline` and `sf devops stage` — flags and JSON output schemas. For jq parsing snippets, error handling, the idempotent check-before-create pattern, and auth setup, see `references/parsing-patterns.md`.
|
|
4
|
+
|
|
5
|
+
## Command Summary
|
|
6
|
+
|
|
7
|
+
| Command | Purpose | Required Flags |
|
|
8
|
+
|---------|---------|---------------|
|
|
9
|
+
| `sf devops pipeline list` | List all pipelines in the org | `--target-org` |
|
|
10
|
+
| `sf devops pipeline get` | Get one pipeline's stages, repos, and connected projects | `--target-org`, `--pipeline-id` |
|
|
11
|
+
| `sf devops pipeline create` | Create a pipeline linked to a Git repo | `--target-org`, `--name`, `--repo` |
|
|
12
|
+
| `sf devops pipeline update` | Activate / deactivate / rename a pipeline | `--target-org`, `--pipeline-id` |
|
|
13
|
+
| `sf devops pipeline stage add` | Insert an empty stage before another stage | `--target-org`, `--pipeline-id`, `--name`, `--next-stage-id` |
|
|
14
|
+
| `sf devops pipeline stage update` | Rename a stage | `--target-org`, `--pipeline-id`, `--stage-id`, `--name` |
|
|
15
|
+
| `sf devops pipeline stage delete` | Delete a stage (auto-relinks neighbors) | `--target-org`, `--pipeline-id`, `--stage-id` |
|
|
16
|
+
| `sf devops pipeline project add` | Attach a project to a pipeline | `--target-org`, `--pipeline-id`, `--project-id` |
|
|
17
|
+
| `sf devops pipeline project delete` | Detach a project from a pipeline | `--target-org`, `--pipeline-id`, `--project-id` |
|
|
18
|
+
| `sf devops stage environment add` | Add a Salesforce environment to a stage | `--target-org`, `--pipeline-id`, `--stage-id`, `--environment-name`, `--org-type` |
|
|
19
|
+
| `sf devops stage environment delete` | Remove an environment (inactive pipeline only) | `--target-org`, `--pipeline-id`, `--environment-id` |
|
|
20
|
+
|
|
21
|
+
All commands support `--json` for structured output and `--api-version <value>` to override the API version. `--target-org` is not required if the `target-org` config variable is already set.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## List Pipelines
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
sf devops pipeline list --target-org my-devops-org --json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Returns all pipelines in the org as **SObject records** under `.result.pipelines[]`, with capitalized fields (`Id`, `Name`, `Description`, `IsActive`). This summary view does **not** include stages or connected projects — use `pipeline get` for those.
|
|
32
|
+
|
|
33
|
+
### JSON Output Schema
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"status": 0,
|
|
38
|
+
"result": {
|
|
39
|
+
"pipelines": [
|
|
40
|
+
{
|
|
41
|
+
"attributes": { "type": "DevopsPipeline", "url": "/services/data/v67.0/sobjects/DevopsPipeline/1PJWt0000007NsjOAE" },
|
|
42
|
+
"Id": "1PJWt0000007NsjOAE",
|
|
43
|
+
"Name": "Release Pipeline",
|
|
44
|
+
"Description": null,
|
|
45
|
+
"IsActive": false
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use `.Id` with `--pipeline-id` in follow-on commands.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Get Pipeline Details
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
sf devops pipeline get --target-org my-devops-org --pipeline-id 0XB000000000001 --json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Returns a single pipeline's full detail — its stages, the repo/branch per stage, and connected projects. **This is how you discover stage IDs** needed by `stage add` (`--next-stage-id`), `stage update`/`stage delete` (`--stage-id`), and `stage environment add` (`--stage-id`). Unlike `pipeline list`, `get` uses lowercase camelCase fields (`id`, `name`, `stages`, `connectedProjects`).
|
|
63
|
+
|
|
64
|
+
### JSON Output Schema
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"status": 0,
|
|
69
|
+
"result": {
|
|
70
|
+
"id": "1PJWt000000HLUfOAO",
|
|
71
|
+
"name": "Release Pipeline",
|
|
72
|
+
"description": null,
|
|
73
|
+
"isActive": true,
|
|
74
|
+
"stages": [
|
|
75
|
+
{
|
|
76
|
+
"id": "1QVWt000000G3huOAC",
|
|
77
|
+
"name": "Staging",
|
|
78
|
+
"nextStageId": "1QVWt000000G3htOAC",
|
|
79
|
+
"branchName": "staging",
|
|
80
|
+
"repositoryName": "my-new-rep",
|
|
81
|
+
"repositoryOwner": "ad-shreya",
|
|
82
|
+
"environment": { "id": "1QeWt0000000i13KAA", "name": "cli-stage" }
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "1QVWt000000G3htOAC",
|
|
86
|
+
"name": "Production",
|
|
87
|
+
"nextStageId": null,
|
|
88
|
+
"branchName": "main",
|
|
89
|
+
"repositoryName": "my-new-rep",
|
|
90
|
+
"repositoryOwner": "ad-shreya",
|
|
91
|
+
"environment": { "id": "1QeWt0000000jDFKAY", "name": "Prod 2" }
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"connectedProjects": [ { "id": "1QgWt0000000rabKAA", "name": "Release Project 1" } ],
|
|
95
|
+
"warnings": []
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Stage Ordering — Linked List, Not an Array Index
|
|
101
|
+
|
|
102
|
+
Stages form a **linked list** via `nextStageId`, not a numeric `order` field:
|
|
103
|
+
- Each stage's `nextStageId` points to the stage that follows it in the promotion chain.
|
|
104
|
+
- The **terminal stage** (last, typically Production) has `nextStageId: null`.
|
|
105
|
+
- To insert before a given stage with `stage add`, pass that stage's `id` as `--next-stage-id`.
|
|
106
|
+
|
|
107
|
+
See `references/parsing-patterns.md` for jq snippets that list stage names/IDs, find the terminal stage, and resolve a stage ID by name.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Create Pipeline
|
|
112
|
+
|
|
113
|
+
A pipeline must be linked to a Git repository at creation.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Existing repo — pass the full URL, nothing else
|
|
117
|
+
sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" \
|
|
118
|
+
--repo https://github.com/myorg/myrepo --json
|
|
119
|
+
|
|
120
|
+
# New GitHub repo — requires --repo-owner
|
|
121
|
+
sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" \
|
|
122
|
+
--repo my-new-repo --create-repo --repo-type github --repo-owner myorg --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
For a **new Bitbucket repo**, swap the provider flags: `--repo-type bitbucket --bitbucket-workspace myworkspace` (plus optional `--bitbucket-project-key PROJ`) in place of `--repo-type github --repo-owner`. Add `--description "<text>"` to any scenario for a pipeline description.
|
|
126
|
+
|
|
127
|
+
### Required Flags by Scenario
|
|
128
|
+
|
|
129
|
+
The correct flag set depends on whether the repo already exists and, for new repos, on the provider. Always required: `--name` and `--repo`. `--description` is optional in every scenario.
|
|
130
|
+
|
|
131
|
+
| Scenario | Required flags | Must NOT include |
|
|
132
|
+
|----------|---------------|------------------|
|
|
133
|
+
| **Existing repo** (GitHub or Bitbucket) | `--name`, `--repo <url>` | `--create-repo`, `--repo-type`, `--repo-owner`, `--bitbucket-*` |
|
|
134
|
+
| **New GitHub repo** | `--name`, `--repo <name>`, `--create-repo`, `--repo-type github`, `--repo-owner <org-or-user>` | `--bitbucket-workspace`, `--bitbucket-project-key` |
|
|
135
|
+
| **New Bitbucket repo** | `--name`, `--repo <name>`, `--create-repo`, `--repo-type bitbucket`, `--bitbucket-workspace <workspace>` | `--repo-owner` |
|
|
136
|
+
|
|
137
|
+
Per-flag detail:
|
|
138
|
+
|
|
139
|
+
| Flag | Applies to | Notes |
|
|
140
|
+
|------|-----------|-------|
|
|
141
|
+
| `--name` / `-n` | all | Pipeline name (required) |
|
|
142
|
+
| `--repo` / `-r` | all | Existing repo URL, or a repo name when used with `--create-repo` (required) |
|
|
143
|
+
| `--description` / `-d` | all | Pipeline description (optional) |
|
|
144
|
+
| `--create-repo` | new repo only | Create the repo if it doesn't exist |
|
|
145
|
+
| `--repo-type` | new repo only | `github` or `bitbucket` (required when creating a repo) |
|
|
146
|
+
| `--repo-owner` | **GitHub** new repo | Organization or user that owns the repo (required for GitHub create) |
|
|
147
|
+
| `--bitbucket-workspace` | **Bitbucket** new repo | Workspace that owns the repo (required for Bitbucket create) |
|
|
148
|
+
| `--bitbucket-project-key` | Bitbucket new repo | Optional Bitbucket project key |
|
|
149
|
+
| `--stage` / `-s` | all | Name of a pipeline stage, in promotion order. Repeat once per stage. Defaults to Integration, UAT, Staging, Production |
|
|
150
|
+
|
|
151
|
+
> **Provider mismatch fails:** pairing `--repo-owner` with `--repo-type bitbucket`, or `--bitbucket-workspace` with `--repo-type github`, is rejected. Match the provider flag to `--repo-type`.
|
|
152
|
+
|
|
153
|
+
### Custom Stage Names at Create Time
|
|
154
|
+
|
|
155
|
+
By default a new pipeline seeds the stage chain **Integration → UAT → Staging → Production**. To seed a different chain, repeat `--stage` once per stage in promotion order:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
sf devops pipeline create \
|
|
159
|
+
--target-org my-devops-org \
|
|
160
|
+
--name "Release Pipeline" \
|
|
161
|
+
--repo https://github.com/myorg/myrepo \
|
|
162
|
+
--stage Dev --stage QA --stage Prod \
|
|
163
|
+
--json
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Seeding stages at create time avoids a separate round of `stage add` / `stage update` calls afterward.
|
|
167
|
+
|
|
168
|
+
After creating, resolve the new pipeline's ID by name from `sf devops pipeline list --json` (see `references/parsing-patterns.md`) — this avoids depending on the exact shape of the create response. A new pipeline always starts with at least one stage (the default chain, or your `--stage` list) — run `sf devops pipeline get` to see the seeded stages, then add or rename stages if you need to adjust the chain.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Update Pipeline (Activate / Deactivate / Rename)
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Activate — requires at least one stage
|
|
176
|
+
sf devops pipeline update --pipeline-id 0XB000000000001 --activate --json
|
|
177
|
+
|
|
178
|
+
# Deactivate
|
|
179
|
+
sf devops pipeline update --pipeline-id 0XB000000000001 --deactivate --json
|
|
180
|
+
|
|
181
|
+
# Rename
|
|
182
|
+
sf devops pipeline update --pipeline-id 0XB000000000001 --name "My Pipeline" --json
|
|
183
|
+
|
|
184
|
+
# Deactivate and rename in one step
|
|
185
|
+
sf devops pipeline update --pipeline-id 0XB000000000001 --deactivate --name "My Pipeline" --json
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
| Flag | Notes |
|
|
189
|
+
|------|-------|
|
|
190
|
+
| `--pipeline-id` | Required — ID of the pipeline to update |
|
|
191
|
+
| `--activate` | Activate the pipeline. Mutually exclusive with `--deactivate` |
|
|
192
|
+
| `--deactivate` | Deactivate the pipeline. Mutually exclusive with `--activate` |
|
|
193
|
+
| `--name` / `-n` | New name for the pipeline. Can be combined with `--deactivate` |
|
|
194
|
+
|
|
195
|
+
- A pipeline must have **at least one stage** before it can be activated.
|
|
196
|
+
- `--activate` and `--deactivate` cannot be used together; `--deactivate` and `--name` may be combined in one command.
|
|
197
|
+
- **You can't modify pipeline stages after you activate and promote changes through it.** Finish all stage/environment configuration before activating.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Add a Stage
|
|
202
|
+
|
|
203
|
+
Inserts an **empty** stage (no branch or environment) immediately before `--next-stage-id`. Configure its environment separately afterward.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Add a Development stage before Integration
|
|
207
|
+
sf devops pipeline stage add \
|
|
208
|
+
--target-org my-devops-org \
|
|
209
|
+
--pipeline-id 0XB000000000001 \
|
|
210
|
+
--name "Development" \
|
|
211
|
+
--next-stage-id 0Xc000000000001 \
|
|
212
|
+
--json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Get the `--next-stage-id` from `sf devops pipeline get`. The new stage is always inserted **immediately before** the anchor stage you pass as `--next-stage-id` — there is no append-to-end flag. To place a stage at a given point in the chain, choose the anchor that should follow it (e.g. anchor to the terminal stage to insert the new stage just before it).
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Rename / Delete a Stage
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Rename a stage
|
|
223
|
+
sf devops pipeline stage update \
|
|
224
|
+
--pipeline-id 0XB000000000001 \
|
|
225
|
+
--stage-id 0Xc000000000002 \
|
|
226
|
+
--name "QA" \
|
|
227
|
+
--json
|
|
228
|
+
|
|
229
|
+
# Delete a stage — the predecessor auto-relinks to the successor so the chain stays intact
|
|
230
|
+
sf devops pipeline stage delete \
|
|
231
|
+
--pipeline-id 0XB000000000001 \
|
|
232
|
+
--stage-id 0Xc000000000002 \
|
|
233
|
+
--json
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Add an Environment to a Stage
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
sf devops stage environment add \
|
|
242
|
+
--target-org my-devops-org \
|
|
243
|
+
--pipeline-id 0XB000000000001 \
|
|
244
|
+
--stage-id 0Xp000000000001 \
|
|
245
|
+
--environment-name Production_Org \
|
|
246
|
+
--org-type Production \
|
|
247
|
+
--json
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
| Flag | Required | Notes |
|
|
251
|
+
|------|----------|-------|
|
|
252
|
+
| `--pipeline-id` | Required | Pipeline containing the stage |
|
|
253
|
+
| `--stage-id` | Required | Target stage (from `pipeline get`) |
|
|
254
|
+
| `--environment-name` / `-e` | Required | Environment name |
|
|
255
|
+
| `--org-type` | Required | Exactly `Production` or `Sandbox` |
|
|
256
|
+
| `--no-browser` | Optional | Don't auto-open a browser for OAuth; prints the redirect URL instead |
|
|
257
|
+
|
|
258
|
+
> **Headless caveat:** This command triggers an OAuth flow and opens a browser by default. In CI or headless runs, pass `--no-browser` and complete authentication via the printed redirect URL.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Delete an Environment from a Stage
|
|
263
|
+
|
|
264
|
+
The pipeline must be **inactive** before you can delete an environment.
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
sf devops stage environment delete \
|
|
268
|
+
--target-org my-devops-org \
|
|
269
|
+
--pipeline-id 0XB000000000001 \
|
|
270
|
+
--environment-id 0Xe000000000001 \
|
|
271
|
+
--json
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
`--pipeline-id` is used to verify the pipeline is inactive before deleting.
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Attach / Detach a Project
|
|
279
|
+
|
|
280
|
+
A project can be attached to **only one pipeline**.
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
# Attach
|
|
284
|
+
sf devops pipeline project add \
|
|
285
|
+
--target-org my-devops-org \
|
|
286
|
+
--pipeline-id 0XB000000000001 \
|
|
287
|
+
--project-id 0Hn000000000001 \
|
|
288
|
+
--json
|
|
289
|
+
|
|
290
|
+
# Detach — deletes only the junction record; the project itself is not deleted
|
|
291
|
+
sf devops pipeline project delete \
|
|
292
|
+
--target-org my-devops-org \
|
|
293
|
+
--pipeline-id 0XB000000000001 \
|
|
294
|
+
--project-id 0Hn000000000001 \
|
|
295
|
+
--json
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Resolve a project ID from its name via `sf devops project list --json` — see `references/parsing-patterns.md` for the jq snippet.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# DevOps Center Pipeline — Parsing, Errors & Auth
|
|
2
|
+
|
|
3
|
+
jq snippets for parsing `sf devops` JSON output, error-handling reference, the idempotent check-before-create pattern, and authentication requirements. For command flags and JSON schemas, see `references/cli-commands.md`.
|
|
4
|
+
|
|
5
|
+
## Parsing Stage Chains
|
|
6
|
+
|
|
7
|
+
Stages form a linked list via `nextStageId` (see the schema in `references/cli-commands.md`). Use these snippets against `pipeline get`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# List stage names and IDs with their next pointer
|
|
11
|
+
sf devops pipeline get --pipeline-id 1PJWt000000HLUfOAO --json | \
|
|
12
|
+
jq -r '.result.stages[] | "\(.name) (\(.id)) -> next: \(.nextStageId)"'
|
|
13
|
+
|
|
14
|
+
# Find the terminal stage ID (nextStageId is null)
|
|
15
|
+
sf devops pipeline get --pipeline-id 1PJWt000000HLUfOAO --json | \
|
|
16
|
+
jq -r '.result.stages[] | select(.nextStageId == null) | .id'
|
|
17
|
+
|
|
18
|
+
# Find a stage ID by name (e.g. to anchor an insert before "Production")
|
|
19
|
+
sf devops pipeline get --pipeline-id 1PJWt000000HLUfOAO --json | \
|
|
20
|
+
jq -r '.result.stages[] | select(.name == "Production") | .id'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Resolve a Pipeline ID by Name
|
|
26
|
+
|
|
27
|
+
`pipeline list` is the reliable way to turn a pipeline name into an ID (note the `.pipelines[]` wrapper and capitalized `Name`/`Id`):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
PIPELINE_ID=$(sf devops pipeline list --json | \
|
|
31
|
+
jq -r '.result.pipelines[] | select(.Name == "Release Pipeline") | .Id' | head -n1)
|
|
32
|
+
echo "Pipeline: $PIPELINE_ID"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### List Pipelines (name, ID, active state)
|
|
36
|
+
|
|
37
|
+
`pipeline list` does not carry stages — to show the stage chain, feed each ID into `pipeline get`:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
sf devops pipeline list --json | \
|
|
41
|
+
jq -r '.result.pipelines[] | "\(.Name) [\(.IsActive)] (\(.Id))"'
|
|
42
|
+
# Release Pipeline [true] (1PJWt000000HLUfOAO)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Resolve a Project ID by Name
|
|
48
|
+
|
|
49
|
+
`project list` returns SObject records under `.result.projects[]` with capitalized fields (`Id`, `Name`):
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
sf devops project list --json | jq -r '.result.projects[] | "\(.Id): \(.Name)"'
|
|
53
|
+
|
|
54
|
+
# Extract a specific project ID by name
|
|
55
|
+
sf devops project list --json | \
|
|
56
|
+
jq -r '.result.projects[] | select(.Name == "Release Project 1") | .Id'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Idempotent Create (Check-Before-Create)
|
|
62
|
+
|
|
63
|
+
The CLI does not dedupe pipelines. Check for an existing pipeline before creating:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
PIPELINE_NAME="Release Pipeline"
|
|
67
|
+
|
|
68
|
+
EXISTING_ID=$(sf devops pipeline list --json | \
|
|
69
|
+
jq -r ".result.pipelines[] | select(.Name == \"$PIPELINE_NAME\") | .Id" | head -n1)
|
|
70
|
+
|
|
71
|
+
if [ -n "$EXISTING_ID" ]; then
|
|
72
|
+
echo "Pipeline already exists: $EXISTING_ID"
|
|
73
|
+
else
|
|
74
|
+
sf devops pipeline create \
|
|
75
|
+
--name "$PIPELINE_NAME" \
|
|
76
|
+
--repo https://github.com/myorg/myrepo \
|
|
77
|
+
--json
|
|
78
|
+
NEW_ID=$(sf devops pipeline list --json | \
|
|
79
|
+
jq -r ".result.pipelines[] | select(.Name == \"$PIPELINE_NAME\") | .Id" | head -n1)
|
|
80
|
+
echo "Created new pipeline: $NEW_ID"
|
|
81
|
+
fi
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Error Handling
|
|
87
|
+
|
|
88
|
+
**Missing required repo (create):**
|
|
89
|
+
```json
|
|
90
|
+
{ "status": 1, "name": "RequiredFlagsError", "message": "Missing required flag --repo", "exitCode": 1 }
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Pipeline not found:**
|
|
94
|
+
```json
|
|
95
|
+
{ "status": 1, "name": "NOT_FOUND", "message": "Pipeline 0XB000000000999 does not exist or is not accessible", "exitCode": 1 }
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Activation without a stage:**
|
|
99
|
+
```json
|
|
100
|
+
{ "status": 1, "name": "NO_STAGES", "message": "A pipeline must have at least one stage before you can activate it", "exitCode": 1 }
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Environment delete on active pipeline:**
|
|
104
|
+
```json
|
|
105
|
+
{ "status": 1, "name": "PIPELINE_ACTIVE", "message": "The environment must belong to an inactive pipeline", "exitCode": 1 }
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Project already attached:**
|
|
109
|
+
```json
|
|
110
|
+
{ "status": 1, "name": "PROJECT_ALREADY_ATTACHED", "message": "You can attach a project to only one pipeline", "exitCode": 1 }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Authentication failure:**
|
|
114
|
+
```json
|
|
115
|
+
{ "status": 1, "name": "NoOrgFound", "message": "No org configuration found for target-org. Run 'sf org login web' to authenticate.", "exitCode": 1 }
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
> **Note:** Error `name`/`message` strings are representative — match on the non-zero `status` and the substring of `message`, not exact strings.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Authentication Requirements
|
|
123
|
+
|
|
124
|
+
All `sf devops pipeline` / `sf devops stage` commands require:
|
|
125
|
+
|
|
126
|
+
1. **Authenticated org**: `sf org login web` or JWT auth
|
|
127
|
+
2. **DevOps Center enabled**: org must have DOCe provisioned
|
|
128
|
+
3. **Appropriate permissions**: access to the pipeline, its stages, and connected environments
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
sf org display --target-org <alias> --json
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
If auth fails: `sf org login web --set-default --alias <alias>`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Check the deterministic activation prerequisite: a pipeline must have >=1 stage
|
|
3
|
+
# before `sf devops pipeline update --activate` will succeed.
|
|
4
|
+
# Usage: scripts/check-activation-ready.sh <pipeline-id> [target-org-alias]
|
|
5
|
+
# Exits 0 if the pipeline has at least one stage; otherwise prints an actionable
|
|
6
|
+
# error and exits 1. Exits 2 if the pipeline can't be read.
|
|
7
|
+
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
PIPELINE_ID="${1:?Usage: check-activation-ready.sh <pipeline-id> [target-org-alias]}"
|
|
11
|
+
TARGET_ORG="${2:-}"
|
|
12
|
+
|
|
13
|
+
ORG_FLAG=()
|
|
14
|
+
[ -n "$TARGET_ORG" ] && ORG_FLAG=(--target-org "$TARGET_ORG")
|
|
15
|
+
|
|
16
|
+
GET_JSON=$(sf devops pipeline get --pipeline-id "$PIPELINE_ID" "${ORG_FLAG[@]+"${ORG_FLAG[@]}"}" --json 2>/dev/null) || {
|
|
17
|
+
echo "ERROR: could not read pipeline '$PIPELINE_ID'. Verify the ID with 'sf devops pipeline list --json' and that the org has DevOps Center enabled." >&2
|
|
18
|
+
exit 2
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
STATUS=$(echo "$GET_JSON" | jq -r '.status // 1')
|
|
22
|
+
if [ "$STATUS" != "0" ]; then
|
|
23
|
+
echo "ERROR: 'pipeline get' returned status $STATUS for '$PIPELINE_ID'." >&2
|
|
24
|
+
exit 2
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
STAGE_COUNT=$(echo "$GET_JSON" | jq -r '(.result.stages // []) | length')
|
|
28
|
+
if [ "$STAGE_COUNT" -ge 1 ]; then
|
|
29
|
+
echo "OK: pipeline '$PIPELINE_ID' has $STAGE_COUNT stage(s) — ready to activate"
|
|
30
|
+
exit 0
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
echo "ERROR: pipeline '$PIPELINE_ID' has no stages. Add at least one stage (sf devops pipeline stage add ...) before --activate." >&2
|
|
34
|
+
exit 1
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Validate a stage-environment --org-type value against the fixed CLI enum.
|
|
3
|
+
# Usage: scripts/validate-org-type.sh <org-type>
|
|
4
|
+
# Exits 0 if the value is exactly "Production" or "Sandbox"; otherwise prints
|
|
5
|
+
# an actionable error and exits 1.
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
ORG_TYPE="${1:-}"
|
|
10
|
+
|
|
11
|
+
if [ "$ORG_TYPE" = "Production" ] || [ "$ORG_TYPE" = "Sandbox" ]; then
|
|
12
|
+
echo "OK: --org-type '$ORG_TYPE' is valid"
|
|
13
|
+
exit 0
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
echo "ERROR: --org-type must be exactly 'Production' or 'Sandbox' (case-sensitive). Got: '${ORG_TYPE}'" >&2
|
|
17
|
+
exit 1
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Deterministically verify the result of a pipeline operation by checking the
|
|
3
|
+
# command's JSON status and the relevant post-state fields from `pipeline get`.
|
|
4
|
+
# Usage:
|
|
5
|
+
# scripts/verify-operation.sh status <json-file-or-'-'>
|
|
6
|
+
# -> assert the captured CLI JSON has .status == 0
|
|
7
|
+
# scripts/verify-operation.sh active <pipeline-id> <true|false> [target-org]
|
|
8
|
+
# -> assert .result.isActive matches the expected boolean
|
|
9
|
+
# scripts/verify-operation.sh has-stage <pipeline-id> <stage-name> [target-org]
|
|
10
|
+
# -> assert a stage with that name exists in the chain
|
|
11
|
+
# scripts/verify-operation.sh has-project <pipeline-id> <project-name> [target-org]
|
|
12
|
+
# -> assert a connected project with that name exists
|
|
13
|
+
# Exits 0 when the assertion holds; prints an actionable error and exits 1 otherwise.
|
|
14
|
+
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
|
|
17
|
+
MODE="${1:?Usage: verify-operation.sh <status|active|has-stage|has-project> ...}"
|
|
18
|
+
|
|
19
|
+
# Read a pipeline once and hand back validated JSON on stdout. Distinguishes a
|
|
20
|
+
# failed CLI read / non-zero JSON status from a successful read (whose fields the
|
|
21
|
+
# caller then evaluates), so post-state checks never mistake a read failure for a
|
|
22
|
+
# "not found" result. Exits 2 with an actionable message on any read/JSON error.
|
|
23
|
+
GET_JSON=""
|
|
24
|
+
read_pipeline() {
|
|
25
|
+
local pid="$1" org="$2"
|
|
26
|
+
local flag=() err rc
|
|
27
|
+
[ -n "$org" ] && flag=(--target-org "$org")
|
|
28
|
+
# Capture stdout and stderr separately; do not let pipefail abort silently.
|
|
29
|
+
err=$(mktemp)
|
|
30
|
+
rc=0
|
|
31
|
+
GET_JSON=$(sf devops pipeline get --pipeline-id "$pid" "${flag[@]+"${flag[@]}"}" --json 2>"$err") || rc=$?
|
|
32
|
+
if [ "$rc" -ne 0 ]; then
|
|
33
|
+
echo "ERROR: could not read pipeline '$pid' (sf exited $rc): $(tr '\n' ' ' <"$err")" >&2
|
|
34
|
+
rm -f "$err"; exit 2
|
|
35
|
+
fi
|
|
36
|
+
rm -f "$err"
|
|
37
|
+
local st
|
|
38
|
+
st=$(echo "$GET_JSON" | jq -r '.status // 1' 2>/dev/null || echo 1)
|
|
39
|
+
if [ "$st" != "0" ]; then
|
|
40
|
+
local msg
|
|
41
|
+
msg=$(echo "$GET_JSON" | jq -r '.message // "unknown error"' 2>/dev/null || echo "unparseable response")
|
|
42
|
+
echo "ERROR: 'pipeline get' for '$pid' returned status $st — $msg" >&2
|
|
43
|
+
exit 2
|
|
44
|
+
fi
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
case "$MODE" in
|
|
48
|
+
status)
|
|
49
|
+
SRC="${2:?status mode needs a JSON file path or '-' for stdin}"
|
|
50
|
+
JSON=$([ "$SRC" = "-" ] && cat || cat "$SRC")
|
|
51
|
+
ST=$(echo "$JSON" | jq -r '.status // 1')
|
|
52
|
+
if [ "$ST" = "0" ]; then echo "OK: command status 0"; exit 0; fi
|
|
53
|
+
MSG=$(echo "$JSON" | jq -r '.message // "unknown error"')
|
|
54
|
+
echo "ERROR: command returned status $ST — $MSG" >&2; exit 1
|
|
55
|
+
;;
|
|
56
|
+
active)
|
|
57
|
+
PID="${2:?}"; WANT="${3:?expected true|false}"; ORG="${4:-}"
|
|
58
|
+
read_pipeline "$PID" "$ORG" # exits 2 on read/JSON error before we evaluate fields
|
|
59
|
+
GOT=$(echo "$GET_JSON" | jq -r '.result.isActive')
|
|
60
|
+
if [ "$GOT" = "$WANT" ]; then echo "OK: isActive == $WANT"; exit 0; fi
|
|
61
|
+
echo "ERROR: expected isActive=$WANT but pipeline '$PID' reports isActive=$GOT" >&2; exit 1
|
|
62
|
+
;;
|
|
63
|
+
has-stage)
|
|
64
|
+
PID="${2:?}"; NAME="${3:?stage name}"; ORG="${4:-}"
|
|
65
|
+
read_pipeline "$PID" "$ORG"
|
|
66
|
+
if echo "$GET_JSON" | jq -e --arg n "$NAME" '.result.stages[]? | select(.name == $n)' >/dev/null; then
|
|
67
|
+
echo "OK: stage '$NAME' present"; exit 0
|
|
68
|
+
fi
|
|
69
|
+
echo "ERROR: stage '$NAME' not found in pipeline '$PID'" >&2; exit 1
|
|
70
|
+
;;
|
|
71
|
+
has-project)
|
|
72
|
+
PID="${2:?}"; NAME="${3:?project name}"; ORG="${4:-}"
|
|
73
|
+
read_pipeline "$PID" "$ORG"
|
|
74
|
+
if echo "$GET_JSON" | jq -e --arg n "$NAME" '.result.connectedProjects[]? | select(.name == $n)' >/dev/null; then
|
|
75
|
+
echo "OK: project '$NAME' connected"; exit 0
|
|
76
|
+
fi
|
|
77
|
+
echo "ERROR: project '$NAME' not connected to pipeline '$PID'" >&2; exit 1
|
|
78
|
+
;;
|
|
79
|
+
*)
|
|
80
|
+
echo "ERROR: unknown mode '$MODE' (expected status|active|has-stage|has-project)" >&2; exit 1
|
|
81
|
+
;;
|
|
82
|
+
esac
|