@salesforce/afv-skills 1.24.0 → 1.26.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/commerce-b2b-open-code-components-replace/SKILL.md +244 -0
- package/skills/commerce-b2b-open-code-components-replace/assets/ootb-to-open-code-mapping.json +66 -0
- package/skills/dx-devops-test-failures-analyze/SKILL.md +89 -0
- package/skills/dx-devops-test-failures-analyze/references/code-analyzer-violations.md +26 -0
- package/skills/dx-devops-test-failures-analyze/references/failure-categories.md +85 -0
- package/skills/{checking-devops-prerequisites/SKILL.md → dx-devops-test-failures-analyze/references/prerequisite-checks.md} +8 -37
- package/skills/{creating-fix-work-item/SKILL.md → dx-devops-test-failures-analyze/references/work-item-creation.md} +8 -12
- package/skills/dx-devops-test-pipeline-configure/SKILL.md +72 -0
- package/skills/dx-devops-test-pipeline-configure/references/configuring-quality-gate.md +133 -0
- package/skills/dx-devops-test-pipeline-configure/references/configuring-test-provider.md +80 -0
- package/skills/dx-devops-test-pipeline-configure/references/error-handling.md +39 -0
- package/skills/dx-devops-test-pipeline-configure/references/gotchas.md +37 -0
- package/skills/dx-devops-test-pipeline-configure/references/prerequisite-checks.md +112 -0
- package/skills/dx-devops-test-pipeline-configure/references/syncing-test-providers.md +69 -0
- package/skills/dx-devops-test-suite-assignments-configure/SKILL.md +74 -0
- package/skills/dx-devops-test-suite-assignments-configure/references/api-endpoint.md +30 -0
- package/skills/dx-devops-test-suite-assignments-configure/references/error-handling.md +14 -0
- package/skills/dx-devops-test-suite-assignments-configure/references/prerequisite-checks.md +112 -0
- package/skills/{recommending-devops-tests/SKILL.md → dx-devops-test-suite-assignments-configure/references/recommendation-logic.md} +10 -26
- package/skills/dx-devops-test-suite-assignments-configure/references/suite-assignment-modes.md +99 -0
- package/skills/dx-devops-test-suite-run/SKILL.md +111 -0
- package/skills/dx-devops-test-suite-run/references/error-handling.md +31 -0
- package/skills/dx-devops-test-suite-run/references/polling-configuration.md +78 -0
- package/skills/dx-devops-test-suite-run/references/prerequisite-checks.md +112 -0
- package/skills/dx-devops-test-suite-run/references/retrigger-mode.md +51 -0
- package/skills/dx-org-manage/SKILL.md +192 -0
- package/skills/dx-org-manage/examples/README.md +45 -0
- package/skills/dx-org-manage/examples/scratch-orgs/error_no_devhub.json +9 -0
- package/skills/dx-org-manage/examples/scratch-orgs/error_timeout.json +13 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_definition_file.json +28 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_edition.json +26 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_snapshot.json +27 -0
- package/skills/dx-org-manage/examples/snapshots/error_output.json +9 -0
- package/skills/dx-org-manage/examples/snapshots/success_output.json +15 -0
- package/skills/dx-org-manage/references/cli_flags.md +67 -0
- package/skills/dx-org-manage/references/creating-scratch-org.md +164 -0
- package/skills/dx-org-manage/references/creating-snapshot.md +103 -0
- package/skills/dx-org-manage/references/definition_file_options.md +224 -0
- package/skills/dx-org-manage/references/edition_types.md +78 -0
- package/skills/dx-org-manage/references/opening-org.md +160 -0
- package/skills/dx-org-manage/references/snapshot_usage.md +74 -0
- package/skills/dx-org-permission-set-assign/SKILL.md +98 -0
- package/skills/dx-org-permission-set-assign/examples/error_output.json +19 -0
- package/skills/dx-org-permission-set-assign/examples/success_output.json +16 -0
- package/skills/dx-org-permission-set-assign/references/cli_flags.md +68 -0
- package/skills/experience-cms-brand-apply/SKILL.md +1 -1
- package/skills/experience-ui-bundle-app-coordinate/SKILL.md +31 -19
- package/skills/experience-ui-bundle-file-upload-generate/SKILL.md +1 -1
- package/skills/experience-ui-bundle-frontend-generate/implementation/header-footer.md +1 -1
- package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +336 -581
- package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +172 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/graphiti-cli.md +373 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/graphql-hand-authoring.md +376 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +119 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/rest-and-integration.md +152 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +217 -0
- package/skills/experience-ui-bundle-salesforce-data-access/scripts/graphql-search.sh +36 -9
- package/skills/platform-agentsetup-categories-fetch/SKILL.md +109 -0
- package/skills/platform-agentsetup-categories-fetch/references/api-response-schema.md +121 -0
- package/skills/platform-custom-object-generate/SKILL.md +62 -7
- package/skills/platform-custom-object-generate/references/description-enrichment.md +125 -0
- package/skills/platform-metadata-retrieve/SKILL.md +121 -0
- package/skills/platform-metadata-retrieve/examples/error_output.json +10 -0
- package/skills/platform-metadata-retrieve/examples/success_output.json +27 -0
- package/skills/platform-metadata-retrieve/references/cli_flags.md +138 -0
- package/skills/platform-metadata-retrieve/references/retrieval_modes.md +181 -0
- package/skills/platform-sharing-rules-generate/SKILL.md +165 -0
- package/skills/platform-sharing-rules-generate/references/rule-types.md +199 -0
- package/skills/platform-tracing-agentforce-configure/SKILL.md +118 -0
- package/skills/platform-tracing-agentforce-configure/assets/AgentforcePlatformTracing-template.xml +4 -0
- package/skills/platform-tracing-configure/SKILL.md +118 -0
- package/skills/platform-tracing-configure/assets/EventSettings-template.xml +4 -0
- package/skills/platform-trust-archive-manage/SKILL.md +25 -11
- package/skills/platform-trust-archive-manage/examples/monitor-failed-jobs.md +2 -2
- package/skills/platform-trust-archive-manage/references/archive-activity-entity.md +1 -1
- package/skills/platform-trust-archive-manage/references/connect-api-operations.md +51 -12
- package/skills/analyzing-test-failures/SKILL.md +0 -159
- package/skills/configuring-quality-gate/SKILL.md +0 -120
- package/skills/configuring-test-provider/SKILL.md +0 -113
- package/skills/managing-suite-assignments/SKILL.md +0 -161
- package/skills/polling-test-results/SKILL.md +0 -72
- package/skills/running-devops-test-suite/SKILL.md +0 -144
- package/skills/syncing-test-providers/SKILL.md +0 -108
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dx-devops-test-pipeline-configure
|
|
3
|
+
description: "Configures DevOps Center pipeline testing infrastructure: enables a test provider so its suites become available, re-syncs a configured provider to pull in new suites, or creates a quality gate with rules on a stage. Routes by intent across three modes after running shared prerequisite checks and an explicit confirmation gate. Use this skill when a user wants to set up, configure, enable, sync, or refresh a test provider, or set/configure a quality gate or coverage threshold on a DevOps Center pipeline stage. TRIGGER when: the user wants to configure/enable/add/set up a test provider, re-sync or refresh a provider's suite list, pull in new suites, or set/configure a quality gate, coverage threshold, or testing benchmark on a stage. DO NOT TRIGGER when: assigning existing suites to a stage (use dx-devops-test-suite-assignments-configure), running or retriggering a suite (use dx-devops-test-suite-run), or non-DevOps-Center work."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "67.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Configure DevOps Center Pipeline Testing Infrastructure
|
|
10
|
+
|
|
11
|
+
Sets up and configures a DevOps Center pipeline's testing infrastructure. This skill handles three closely related "configure your pipeline" operations that share the same org context, prerequisites, and entity scope (the pipeline level). Pick the mode that matches the user's intent.
|
|
12
|
+
|
|
13
|
+
> **API version:** All DevOps testing system calls target Salesforce API **v67.0** (minimum required).
|
|
14
|
+
|
|
15
|
+
**Important:** All DevOps Center data (pipelines, stages, providers, suites, gates) lives in the Salesforce org — NOT the local repo. Never search the filesystem for pipeline configuration. Always query the org with `sf data query` or `sf api request rest`.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 1 — Run prerequisites first (always)
|
|
20
|
+
|
|
21
|
+
Before any query or system call, run the prerequisite checks in `references/prerequisite-checks.md`. On any failure, surface the plain-language message and stop — never write to an unverified environment.
|
|
22
|
+
|
|
23
|
+
- **Modes A & B (provider configure/sync):** run Prerequisites 1–4 (org login, Agentforce DX plugin, DevOps Center org auth, pipeline identified). Prerequisite 5 (stage) is **not** required — providers are configured at the pipeline level.
|
|
24
|
+
- **Mode C (quality gate):** run Prerequisites 1–4 **and** Prerequisite 5 (stage). Prereq 5 gives the `DevopsPipelineStage` only — the target `DevopsTestSuiteStage` record Id is resolved separately in Mode C's Step 0 (trigger → suite-stage row).
|
|
25
|
+
|
|
26
|
+
Carry forward the resolved `doce-org-alias`, `pipelineId`, and (Mode C) `stageId` / `testSuiteStageId`.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Step 2 — Select the mode
|
|
31
|
+
|
|
32
|
+
| If the user wants to… | Mode | Follow |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| Enable / set up / add a provider that is **not yet configured** | **A — Configure a test provider** | `references/configuring-test-provider.md` |
|
|
35
|
+
| Re-sync / refresh an **already-configured** provider to pull in new suites | **B — Sync a configured provider** | `references/syncing-test-providers.md` |
|
|
36
|
+
| Set / configure a quality gate, coverage threshold, or testing benchmark on a stage | **C — Configure a quality gate** | `references/configuring-quality-gate.md` |
|
|
37
|
+
|
|
38
|
+
**Disambiguating A vs B (the critical decision):** First fetch the pipeline's providers (`GET .../testProviders?status=all`) — both modes start there. Then:
|
|
39
|
+
|
|
40
|
+
- Provider is **Available** (not configured) → **Mode A** (configure).
|
|
41
|
+
- Provider is **Configured** but suites are stale/missing → **Mode B** (sync).
|
|
42
|
+
- Provider is **Configured** and the user can't see suites *when assigning to a stage* → this is a **stage-assignment gap, not a configuration gap**. Redirect to `dx-devops-test-suite-assignments-configure`.
|
|
43
|
+
|
|
44
|
+
⚠ **Never POST to the configure endpoint for an already-configured provider** — it creates duplicate `DevopsPipelineTestProvider` records. See `references/gotchas.md`.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Step 3 — Confirmation gate (required in every mode)
|
|
49
|
+
|
|
50
|
+
Every mode mutates org state and **must** show a confirmation gate before any write. Each mode's reference file contains its exact gate wording (Mode C additionally requires a mandatory impact preview before the gate). Do not call any write API until the user gives an affirmative response. If the user declines, stop without writing.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Step 4 — Execute and report
|
|
55
|
+
|
|
56
|
+
Follow the chosen reference file for the exact API calls, success messages, and error handling:
|
|
57
|
+
|
|
58
|
+
- `references/configuring-test-provider.md` — Mode A
|
|
59
|
+
- `references/syncing-test-providers.md` — Mode B
|
|
60
|
+
- `references/configuring-quality-gate.md` — Mode C
|
|
61
|
+
- `references/error-handling.md` — consolidated status-code → plain-language tables for all modes
|
|
62
|
+
- `references/gotchas.md` — duplicate-provider trap, API-name differences, trigger-type rules
|
|
63
|
+
|
|
64
|
+
Never expose raw API errors, stack traces, or JSON payloads to the user — always translate to plain language.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Related skills
|
|
69
|
+
|
|
70
|
+
- **`dx-devops-test-suite-assignments-configure`** — after configuring/syncing a provider, assign or map its suites to a stage; also recommends which suites to run for a commit.
|
|
71
|
+
- **`dx-devops-test-suite-run`** — run a suite, or retrigger a quality gate after fixes meet the threshold.
|
|
72
|
+
- **`dx-devops-test-failures-analyze`** — explain failures from a run and optionally create a fix work item.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Mode C — Configure a Quality Gate
|
|
2
|
+
|
|
3
|
+
Creates a DevOps Center quality gate with associated rules (`PASS_PERCENTAGE`, `SEVERITY`, `ESSENTIAL`) and links it to a pipeline-stage suite assignment, after a mandatory impact preview and explicit confirmation.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
Run Prerequisites 1–4 **and** Prerequisite 5 (stage). You need `doce-org-alias`, `pipelineId`, and `stageId`. Prereq 5 resolves only the **`DevopsPipelineStage`** — it does **not** give you the `DevopsTestSuiteStage` record. Resolve that separately in Step 0 below.
|
|
8
|
+
|
|
9
|
+
## Inputs required
|
|
10
|
+
|
|
11
|
+
| Input | Source |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `name` | User-provided name for the quality gate |
|
|
14
|
+
| `rules` | List of `{type, threshold?}` — see rule types below |
|
|
15
|
+
| `doce-org-alias` | Prerequisite 1 |
|
|
16
|
+
| `event` | `Pre-Promote`, `Post-Promote`, or `Review` — which trigger the gate applies to |
|
|
17
|
+
| `testSuiteName` | The suite the gate will gate (the gate links to a specific suite-on-stage) |
|
|
18
|
+
| `testSuiteStageId` | Target `DevopsTestSuiteStage` record Id — **resolved in Step 0**, not from Prereq 5 |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Step 0 — Resolve the target `DevopsTestSuiteStage` record
|
|
23
|
+
|
|
24
|
+
A quality gate links to a specific suite assigned to a stage's trigger, represented by a `DevopsTestSuiteStage` record. That object is keyed by `DevopsPipelineStageTriggerId` + `TestSuiteId` (it is **not** linked directly to `DevopsPipelineStage`), so resolve it in two queries.
|
|
25
|
+
|
|
26
|
+
**0a — Find the stage's trigger for the chosen event:**
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
sf data query \
|
|
30
|
+
--query "SELECT Id, TriggerType FROM DevopsPipelineStageTrigger WHERE RelatedRecordId = '<stageId>' AND TriggerType = '<event>'" \
|
|
31
|
+
--target-org <doce-org-alias> --json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> For a `Review` gate the trigger is pipeline-level — use `RelatedRecordId = '<pipelineId>'` with `TriggerType = 'Review'` instead. Record the returned Id as `<triggerId>`.
|
|
35
|
+
|
|
36
|
+
**0b — Find the suite-stage row for the target suite on that trigger:**
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
sf data query \
|
|
40
|
+
--query "SELECT Id, TestSuiteId, TestSuite.Name, IsQualityGateEnabled, DevopsQualityGateId FROM DevopsTestSuiteStage WHERE DevopsPipelineStageTriggerId = '<triggerId>'" \
|
|
41
|
+
--target-org <doce-org-alias> --json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Match the row whose `TestSuite.Name` is the suite the user named; its `Id` is `<testSuiteStageId>`.
|
|
45
|
+
|
|
46
|
+
- If **no** `DevopsTestSuiteStage` row matches (the suite isn't assigned to that trigger), stop and report it — the suite must be assigned first via `dx-devops-test-suite-assignments-configure`. Do **not** fabricate a `testSuiteStageId` or proceed.
|
|
47
|
+
- If the matched row already has `IsQualityGateEnabled = true`, tell the user a gate is already linked and confirm whether to replace it before continuing.
|
|
48
|
+
|
|
49
|
+
## Rule types
|
|
50
|
+
|
|
51
|
+
| Type | Description | Threshold |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `PASS_PERCENTAGE` | Minimum % of tests that must pass | Required (0–100) |
|
|
54
|
+
| `SEVERITY` | Maximum allowed severity level of failures | Required (numeric, e.g. 1–5) |
|
|
55
|
+
| `ESSENTIAL` | All essential tests must pass | Not required |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## MANDATORY IMPACT PREVIEW
|
|
60
|
+
|
|
61
|
+
**Before executing any commands**, show the user this preview and wait for explicit confirmation:
|
|
62
|
+
|
|
63
|
+
> "Here's what this quality gate will enforce on `<stageName>`:
|
|
64
|
+
> - Rule: `<type>` — `<description>`
|
|
65
|
+
> - Threshold: `<value>`
|
|
66
|
+
> - Affected pipelines: `<list>`
|
|
67
|
+
>
|
|
68
|
+
> Confirm to apply?"
|
|
69
|
+
|
|
70
|
+
**Never proceed past this point without showing the impact preview first and receiving explicit confirmation.**
|
|
71
|
+
|
|
72
|
+
## Confirmation gate
|
|
73
|
+
|
|
74
|
+
Only proceed after the user has explicitly confirmed (e.g., "yes", "confirm", "go ahead"). If the user declines or does not confirm, stop and do not execute any commands.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Step 1 — Create the gate record
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
sf api request rest \
|
|
82
|
+
"/services/data/v67.0/connect/devopstesting/qualityGate" \
|
|
83
|
+
--method POST \
|
|
84
|
+
--body '{"name": "<gateName>"}' \
|
|
85
|
+
--target-org <doce-org-alias>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Extract `qualityGateId` from the response.
|
|
89
|
+
|
|
90
|
+
## Step 2 — Create each rule as an sObject record
|
|
91
|
+
|
|
92
|
+
Rules are not accepted in the Connect API payload — create them as `DevopsQualityGateRule` records directly. Only create rules the user has requested. `ESSENTIAL` has no threshold.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
sf data create record \
|
|
96
|
+
--sobject DevopsQualityGateRule \
|
|
97
|
+
--values "DevopsQualityGateId='<qualityGateId>' Rule='PASS_PERCENTAGE' Threshold=<value>" \
|
|
98
|
+
--target-org <doce-org-alias> --json
|
|
99
|
+
|
|
100
|
+
sf data create record \
|
|
101
|
+
--sobject DevopsQualityGateRule \
|
|
102
|
+
--values "DevopsQualityGateId='<qualityGateId>' Rule='ESSENTIAL'" \
|
|
103
|
+
--target-org <doce-org-alias> --json
|
|
104
|
+
|
|
105
|
+
sf data create record \
|
|
106
|
+
--sobject DevopsQualityGateRule \
|
|
107
|
+
--values "DevopsQualityGateId='<qualityGateId>' Rule='SEVERITY' Threshold=<value>" \
|
|
108
|
+
--target-org <doce-org-alias> --json
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Step 3 — Link the gate to the suite stage
|
|
112
|
+
|
|
113
|
+
Update the `DevopsTestSuiteStage` record to link the new gate:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
sf data update record \
|
|
117
|
+
--sobject DevopsTestSuiteStage \
|
|
118
|
+
--record-id <testSuiteStageId> \
|
|
119
|
+
--values "IsQualityGateEnabled=true DevopsQualityGateId='<qualityGateId>'" \
|
|
120
|
+
--target-org <doce-org-alias> --json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## On success
|
|
126
|
+
|
|
127
|
+
> "Quality gate `<gateName>` created with `<N>` rule(s) and assigned to `<suiteName>` on `<stageName>`."
|
|
128
|
+
|
|
129
|
+
## Note
|
|
130
|
+
|
|
131
|
+
To *re-run* an existing gate after meeting its threshold, that is **not** this mode — use `dx-devops-test-suite-run` (retrigger mode). To assign or map suites to stages first, use `dx-devops-test-suite-assignments-configure`.
|
|
132
|
+
|
|
133
|
+
See `references/error-handling.md` for status-code responses.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Mode A — Configure a Test Provider
|
|
2
|
+
|
|
3
|
+
Configures an *Available* (not-yet-configured) test provider on a DevOps Center pipeline, making its test suites available for assignment to pipeline stages.
|
|
4
|
+
|
|
5
|
+
**Confirmation required:** Yes — explicit confirmation before the provider is configured.
|
|
6
|
+
|
|
7
|
+
## Inputs
|
|
8
|
+
|
|
9
|
+
| Variable | Source |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `doce-org-alias` | Prerequisite 1 |
|
|
12
|
+
| `pipelineId` | Prerequisite 4 (pipeline selection) |
|
|
13
|
+
| `testProviderId` | Resolved by fetching the pipeline's test providers (Step 1 below) |
|
|
14
|
+
|
|
15
|
+
Prerequisite 5 (stage) is **not** required — providers are configured at the pipeline level.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 1 — Fetch test providers to resolve the provider ID
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
sf api request rest \
|
|
23
|
+
"/services/data/v67.0/connect/devopstesting/pipeline/<pipelineId>/testProviders?status=all" \
|
|
24
|
+
--target-org <doce-org-alias>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Each provider entry includes `testProviderId`, `testProviderName`, and a status (Configured vs. Available). Present a short summary grouped by status:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Test providers for <pipelineName>:
|
|
31
|
+
|
|
32
|
+
✓ Configured:
|
|
33
|
+
- Code Analyzer (63 suites)
|
|
34
|
+
- Apex Unit Tests (5 suites)
|
|
35
|
+
|
|
36
|
+
Available (not yet configured):
|
|
37
|
+
- Flow Tests
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- **Only an Available provider can be configured.** If the pipeline has no available providers, report that and stop — do NOT fabricate a provider or ID.
|
|
41
|
+
|
|
42
|
+
### If the named provider is already Configured
|
|
43
|
+
|
|
44
|
+
Do **not** present the confirmation gate and do **not** POST to the configure endpoint (Steps 2–3) — that would create a duplicate `DevopsPipelineTestProvider`. Instead:
|
|
45
|
+
|
|
46
|
+
1. State plainly that the provider is already configured, including its synced suite count and last-sync time if returned (e.g. *"Flow Tests is already configured on `<pipelineName>` with 3 suites synced (last sync 2026-06-23)."*).
|
|
47
|
+
2. Diagnose the user's actual goal and redirect **by name**:
|
|
48
|
+
- If the user says the provider's **suites don't appear when assigning tests to a stage**, this is a **stage-assignment gap, not a provider-configuration gap** — the suites already exist at the pipeline level; they just need to be linked to the stage. Redirect to **`dx-devops-test-suite-assignments-configure`**.
|
|
49
|
+
- If the user expects **newly created suites** that aren't yet synced, use **Mode B — Sync a configured provider** (`references/syncing-test-providers.md`) to pull them in.
|
|
50
|
+
3. Do not loop back to configuring — finish cleanly after the explanation and redirect.
|
|
51
|
+
|
|
52
|
+
## Step 2 — Confirmation gate
|
|
53
|
+
|
|
54
|
+
**Required — do not call the API before the user confirms.**
|
|
55
|
+
|
|
56
|
+
> "I'll configure `<testProviderName>` on the `<pipelineName>` pipeline. This will make its suites available for assignment to stages. Confirm?"
|
|
57
|
+
|
|
58
|
+
Do not proceed until the user gives an affirmative response.
|
|
59
|
+
|
|
60
|
+
## Step 3 — Configure the provider
|
|
61
|
+
|
|
62
|
+
On confirmation, call the configure endpoint with the provider ID:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
sf api request rest \
|
|
66
|
+
"/services/data/v67.0/connect/devops/pipeline/<pipelineId>/testProvider" \
|
|
67
|
+
--method POST \
|
|
68
|
+
--body '{"testProviderId": "<testProviderId>"}' \
|
|
69
|
+
--target-org <doce-org-alias>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## On success
|
|
73
|
+
|
|
74
|
+
> "Provider `<testProviderName>` is now configured on the `<pipelineName>` pipeline. Its suites are available for assignment to stages."
|
|
75
|
+
|
|
76
|
+
Newly configured suites can then be assigned to stages with `dx-devops-test-suite-assignments-configure`.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
See `references/gotchas.md` for the duplicate-provider trap and `references/error-handling.md` for status-code responses.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Error Handling — All Modes
|
|
2
|
+
|
|
3
|
+
Never expose raw API error messages, stack traces, or JSON payloads to the user. Map response status codes to plain-language messages.
|
|
4
|
+
|
|
5
|
+
## Mode A — Configure a test provider
|
|
6
|
+
|
|
7
|
+
| Status | User-facing message |
|
|
8
|
+
|---|---|
|
|
9
|
+
| 400 | "The request was invalid. Check that the provider ID and pipeline ID are correct." |
|
|
10
|
+
| 403 | "You don't have permission to configure test providers on this pipeline." |
|
|
11
|
+
| 404 | "The pipeline or test provider was not found." |
|
|
12
|
+
| 409 | "That provider appears to already be configured on this pipeline. To pick up new suites, re-sync it instead." |
|
|
13
|
+
| 500 | "A server error occurred. Try again in a few minutes." |
|
|
14
|
+
|
|
15
|
+
## Mode B — Sync a configured provider
|
|
16
|
+
|
|
17
|
+
| Status | User-facing message |
|
|
18
|
+
|---|---|
|
|
19
|
+
| 400 | "The sync request was invalid. Check that the provider ID and pipeline ID are correct." |
|
|
20
|
+
| 403 | "You don't have permission to sync test providers on this pipeline." |
|
|
21
|
+
| 404 | "The pipeline or test provider was not found." |
|
|
22
|
+
| 500 | "A server error occurred. Try again in a few minutes." |
|
|
23
|
+
|
|
24
|
+
## Mode C — Configure a quality gate
|
|
25
|
+
|
|
26
|
+
| Status | User-facing message |
|
|
27
|
+
|---|---|
|
|
28
|
+
| 400 | "The quality gate configuration is invalid. Check that all rule types and thresholds are correct." |
|
|
29
|
+
| 403 | "You don't have permission to configure quality gates on this org." |
|
|
30
|
+
| 500 | "A server error occurred. Try again in a few minutes." |
|
|
31
|
+
|
|
32
|
+
## Prerequisite / environment errors
|
|
33
|
+
|
|
34
|
+
| Error condition | Response |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `sf org list` fails entirely | "Could not reach the Salesforce CLI. Make sure `sf` is installed and on your PATH." |
|
|
37
|
+
| `sf org display` returns auth error | Surface plain-language re-auth instructions. Do not expose the raw error. |
|
|
38
|
+
| `DevopsPipeline` query fails with 5xx | "The DevOps Center org is returning a server error. Try again in a few minutes." |
|
|
39
|
+
| Any check throws unexpectedly | "Something went wrong checking prerequisites. Error: [plain summary]. Let's try again — or resolve it manually and let me know when ready." |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Critical Gotchas
|
|
2
|
+
|
|
3
|
+
## Duplicate provider configuration (the big one)
|
|
4
|
+
|
|
5
|
+
`POST /connect/devops/pipeline/<pipelineId>/testProvider` **creates a new provider configuration record** (`DevopsPipelineTestProvider`). Use it ONLY to configure a provider for the **first time** (Mode A).
|
|
6
|
+
|
|
7
|
+
To re-sync an already-configured provider for new suites, use `POST /connect/devops/sync` (Mode B). Calling the configure endpoint on an already-configured provider produces **duplicate** `DevopsPipelineTestProvider` records.
|
|
8
|
+
|
|
9
|
+
**Decision tree:**
|
|
10
|
+
|
|
11
|
+
- Provider is **Available** → configure via `POST .../pipeline/<id>/testProvider` (Mode A).
|
|
12
|
+
- Provider is **Configured**, new suites missing → sync via `POST /connect/devops/sync` (Mode B).
|
|
13
|
+
- Provider is **Configured**, suites missing only when assigning to a stage → stage-assignment gap; redirect to `dx-devops-test-suite-assignments-configure`.
|
|
14
|
+
|
|
15
|
+
## API name differences
|
|
16
|
+
|
|
17
|
+
| Issue | Resolution |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `DevopsPipeline` query returns empty | DevOps Center not installed on the target org, or wrong org alias — ask the user to verify |
|
|
20
|
+
| `DevopsWorkItem` sObject not supported | Use `WorkItem` (no namespace) — the correct API name for this org version |
|
|
21
|
+
| `sf plugins` doesn't match `agentforce` | The installed plugin is `@salesforce/plugin-agent` — match on `plugin-agent` too |
|
|
22
|
+
|
|
23
|
+
## Trigger-type rules
|
|
24
|
+
|
|
25
|
+
| Issue | Resolution |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Review trigger is pipeline-level, not stage-level | Query `DevopsPipelineStageTrigger` where `TriggerType = 'Review'` and `RelatedRecordId = <pipelineId>` |
|
|
28
|
+
| Connect API `testSuites` returns empty with `?stageId=` | Use `?triggerId=<reviewTriggerId>` — `stageId` only works for stage-level triggers |
|
|
29
|
+
|
|
30
|
+
## Endpoint families
|
|
31
|
+
|
|
32
|
+
- **Configure provider:** `POST /connect/devops/pipeline/<pipelineId>/testProvider`
|
|
33
|
+
- **Sync provider:** `POST /connect/devops/sync`
|
|
34
|
+
- **List providers:** `GET /connect/devopstesting/pipeline/<pipelineId>/testProviders?status=all`
|
|
35
|
+
- **Quality gate:** `POST /connect/devopstesting/qualityGate`
|
|
36
|
+
|
|
37
|
+
Note the `devops` vs `devopstesting` path segment differs between sync/configure and the listing/quality-gate endpoints — copy them exactly.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Prerequisite Checks — Shared DevOps Center Gate
|
|
2
|
+
|
|
3
|
+
Shared environment gate for every DevOps Center testing skill. Run these checks **before** any query or system call. On any failure, surface the plain-language message and stop until the user resolves it — never proceed to a write with an unverified environment.
|
|
4
|
+
|
|
5
|
+
> **API version:** All DevOps testing system calls target Salesforce API **v67.0** (minimum required).
|
|
6
|
+
|
|
7
|
+
**Important:** All DevOps Center data (pipelines, stages, test suites, executions) lives in the Salesforce org — NOT in the local repository. Never search the filesystem for pipeline configuration. Always query the org using `sf data query` or `sf api request rest`.
|
|
8
|
+
|
|
9
|
+
**Object model — use the STANDARD objects, never the `sf_devops__` managed package:** DevOps Center testing data lives in standard platform objects — `DevopsPipeline`, `DevopsPipelineStage`, `DevopsPipelineStageTrigger`, `DevopsTestSuite`, `DevopsTestSuiteStage`, `DevopsTestSuiteExecution`, `DevopsProject`, `WorkItem`. Do **NOT** query the legacy managed-package objects (`sf_devops__Pipeline__c`, `sf_devops__Pipeline_Stage__c`, etc.) and do **NOT** gate on a `PackageLicense` / namespace check for `sf_devops`. "DevOps Center installed" is determined **solely** by whether `DevopsPipeline` is queryable and returns records (Prerequisite 4) — never by the presence of the `sf_devops__` namespace. If a `sf_devops__*` object is missing, that is expected and is NOT evidence that DevOps Center is uninstalled.
|
|
10
|
+
|
|
11
|
+
## How skills use this
|
|
12
|
+
|
|
13
|
+
Run Prerequisites 1–4 in order. Prerequisite 5 (stage) is run **only** when the operation targets a specific pipeline stage (configuring a gate, running/retriggering a suite, mapping a suite). Carry forward the resolved `doce-org-alias`, `pipelineId`, and (when applicable) `stageId`.
|
|
14
|
+
|
|
15
|
+
Resolve the **DevOps Center org alias** without asking the user unless genuinely ambiguous:
|
|
16
|
+
1. If the user named an org alias in their message, use it.
|
|
17
|
+
2. Otherwise, use the default org (`sf org display --json`, no `--target-org`).
|
|
18
|
+
3. Only if the default org has no `DevopsPipeline` records (Prereq 4 fails), ask: "Which org alias is your DevOps Center org?"
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Prerequisite 1 — Salesforce org: active login
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
sf org list --json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Look for at least one entry in `result.nonScratchOrgs`, `result.scratchOrgs`, or `result.sandboxes` with `"connectedStatus": "Connected"`.
|
|
29
|
+
|
|
30
|
+
- **Pass:** at least one org is Connected
|
|
31
|
+
- **Fail:** no orgs listed, or all show a non-connected status
|
|
32
|
+
|
|
33
|
+
**On fail:** "No authenticated Salesforce org found. Run `sf org login web --alias <your-alias>` in your terminal, then come back."
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Prerequisite 2 — Agentforce DX plugin installed
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
sf plugins --json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Look for a plugin entry whose `name` contains `plugin-agent`, `agentforce`, or `einstein` (case-insensitive).
|
|
44
|
+
|
|
45
|
+
- **Pass:** plugin found
|
|
46
|
+
- **Fail:** no matching entry
|
|
47
|
+
|
|
48
|
+
**On fail:** "The Agentforce DX Plugin is not installed. Run `sf plugins install @salesforce/plugin-agent`, then restart the IDE and try again."
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Prerequisite 3 — DevOps Center org authenticated
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
sf org display --target-org <doce-org-alias> --json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Check that `"connectedStatus"` is `"Connected"`.
|
|
59
|
+
|
|
60
|
+
- **Pass:** Connected
|
|
61
|
+
- **Fail:** expired session or error
|
|
62
|
+
|
|
63
|
+
**On fail:** "Your DevOps Center org session has expired. Run `sf org login web --alias <doce-org-alias>` to re-authenticate."
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Prerequisite 4 — Pipeline identified
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
sf data query \
|
|
71
|
+
--query "SELECT Id, Name, CreatedDate FROM DevopsPipeline ORDER BY Name ASC" \
|
|
72
|
+
--target-org <doce-org-alias> \
|
|
73
|
+
--json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- **Pass (exactly one):** use it automatically — do NOT ask.
|
|
77
|
+
- **Pass (multiple):** if the user already named a pipeline, match by name. Otherwise display a numbered list and ask:
|
|
78
|
+
```text
|
|
79
|
+
Found <N> pipelines:
|
|
80
|
+
1. <Name>
|
|
81
|
+
2. <Name>
|
|
82
|
+
Which pipeline would you like to work with?
|
|
83
|
+
```
|
|
84
|
+
- **Fail (no records):** "No DevOps Center pipeline found. Create a project and pipeline in DevOps Center before using the DevOps Testing Skills."
|
|
85
|
+
- **Fail (unsupported object):** "DevOps Center does not appear to be installed on `<doce-org-alias>`. Check that you're pointing at the correct org."
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Prerequisite 5 — Pipeline stage identified (conditional)
|
|
90
|
+
|
|
91
|
+
Run **only** when the operation targets a specific stage (e.g. configuring a quality gate).
|
|
92
|
+
|
|
93
|
+
If the user's message already names a stage (e.g. "Integration", "Staging", "Production"), use that name directly — do NOT ask again. Look up its Id:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
sf data query \
|
|
97
|
+
--query "SELECT Id, Name FROM DevopsPipelineStage WHERE DevopsPipelineId = '<pipelineId>' AND Name = '<stageName>'" \
|
|
98
|
+
--target-org <doce-org-alias> --json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Only if no stage is mentioned, fetch the full list and ask which one:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
sf data query \
|
|
105
|
+
--query "SELECT Id, Name FROM DevopsPipelineStage WHERE DevopsPipelineId = '<pipelineId>' ORDER BY Name ASC" \
|
|
106
|
+
--target-org <doce-org-alias> --json
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Then ask: "Which pipeline stage are we working with?" — do NOT ask for an org alias; stages are resolved by name from the pipeline.
|
|
110
|
+
|
|
111
|
+
- **Pass:** stage Id and Name confirmed
|
|
112
|
+
- **Deferred:** not required until the operation needs it
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Mode B — Sync a Configured Provider
|
|
2
|
+
|
|
3
|
+
Re-syncs an already-*Configured* test provider on a DevOps Center pipeline so that suites added to the provider since it was last configured become available for assignment to stages.
|
|
4
|
+
|
|
5
|
+
**Confirmation required:** Yes — explicit confirmation before the sync is triggered.
|
|
6
|
+
|
|
7
|
+
## Inputs
|
|
8
|
+
|
|
9
|
+
| Variable | Source |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `doce-org-alias` | Prerequisite 1 |
|
|
12
|
+
| `pipelineId` | Prerequisite 4 (pipeline selection) |
|
|
13
|
+
| `testProviderId` | Resolved by fetching the pipeline's test providers (Step 1 below) |
|
|
14
|
+
|
|
15
|
+
Prerequisite 5 (stage) is **not** required — providers are synced at the pipeline level.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 1 — Fetch test providers to resolve the provider ID
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
sf api request rest \
|
|
23
|
+
"/services/data/v67.0/connect/devopstesting/pipeline/<pipelineId>/testProviders?status=all" \
|
|
24
|
+
--target-org <doce-org-alias>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Each provider entry includes `testProviderId`, `testProviderName`, and a status (Configured vs. Available). Present a short summary grouped by status (same format as Mode A).
|
|
28
|
+
|
|
29
|
+
- **Only a Configured provider can be synced.** If the user names an *Available* (not-yet-configured) provider, explain it must be configured first — use **Mode A** (`references/configuring-test-provider.md`).
|
|
30
|
+
- If the pipeline has no configured providers, report that and stop — do NOT fabricate a provider or ID.
|
|
31
|
+
|
|
32
|
+
## Step 2 — Confirmation gate
|
|
33
|
+
|
|
34
|
+
**Required — do not call the API before the user confirms.**
|
|
35
|
+
|
|
36
|
+
> "I'll re-sync `<testProviderName>` on the `<pipelineName>` pipeline to pick up any new suites. Confirm?"
|
|
37
|
+
|
|
38
|
+
Do not proceed until the user gives an affirmative response.
|
|
39
|
+
|
|
40
|
+
## Step 3 — Trigger the sync
|
|
41
|
+
|
|
42
|
+
On confirmation, call the sync endpoint with the provider ID(s) and pipeline ID:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
sf api request rest \
|
|
46
|
+
"/services/data/v67.0/connect/devops/sync" \
|
|
47
|
+
--method POST \
|
|
48
|
+
--body '{
|
|
49
|
+
"testProviderIds": ["<testProviderId>"],
|
|
50
|
+
"pipelineId": "<pipelineId>"
|
|
51
|
+
}' \
|
|
52
|
+
--target-org <doce-org-alias>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`testProviderIds` is a list — multiple configured providers can be synced in one call.
|
|
56
|
+
|
|
57
|
+
## On success
|
|
58
|
+
|
|
59
|
+
> "Provider `<testProviderName>` sync started. The operation is running asynchronously — new suites will be available shortly."
|
|
60
|
+
|
|
61
|
+
The sync runs asynchronously; newly synced suites can then be assigned to stages with `dx-devops-test-suite-assignments-configure`.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Critical gotcha
|
|
66
|
+
|
|
67
|
+
**Do NOT use** `POST /connect/devops/pipeline/<pipelineId>/testProvider` to sync — that endpoint **creates a new provider configuration** and will result in duplicate `DevopsPipelineTestProvider` records. Sync only via `POST /connect/devops/sync`. See `references/gotchas.md`.
|
|
68
|
+
|
|
69
|
+
See `references/error-handling.md` for status-code responses.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dx-devops-test-suite-assignments-configure
|
|
3
|
+
description: "Recommends and manages DevOps Center test suite assignments for pipeline stages. Mode A analyzes a commit diff against assigned suite metadata to recommend relevant existing suites and flag coverage gaps (pure reasoning). Modes B-D assign a single suite, bulk-map multiple suites with a mandatory impact preview, or add/remove test classes with governance rules, via the testSuiteStages Connect API. Use this skill to recommend suites for a commit, assign or map suites to stages, or add/remove tests in a suite. TRIGGER when: the user asks which suites to run for a commit/diff or what covers their changes; a suite is unlinked and the user wants it assigned; the user wants to configure suite-to-stage mappings, assign multiple suites, or add/remove/sync tests in a suite. DO NOT TRIGGER when: configuring or syncing a test provider (use dx-devops-test-pipeline-configure), running suites (use dx-devops-test-suite-run), or authoring/running tests directly (use generating-apex-test or running-apex-tests)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "67.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Configure DevOps Center Suite Assignments
|
|
10
|
+
|
|
11
|
+
Recommends which existing test suites to run for a change, and manages how suites are assigned and mapped to pipeline stages. These operations share the same suite-stage metadata: a recommendation surfaces relevant suites and flags gaps, and those gaps lead directly into assignment.
|
|
12
|
+
|
|
13
|
+
> **API version:** All DevOps testing system calls target Salesforce API **v67.0** (minimum required).
|
|
14
|
+
|
|
15
|
+
**Important:** All DevOps Center data lives in the Salesforce org — NOT the local repo. Never search the filesystem for suite configuration. Always query the org with `sf data query` or `sf api request rest`.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 1 — Run prerequisites first (always)
|
|
20
|
+
|
|
21
|
+
Run the prerequisite checks in `references/prerequisite-checks.md` before any query or system call. On any failure, surface the plain-language message and stop.
|
|
22
|
+
|
|
23
|
+
- **Mode A (recommend):** Prerequisites 1–4 (org login, plugin, DevOps Center org auth, pipeline identified). No stage required — recommendation reads the pipeline-level Review trigger.
|
|
24
|
+
- **Modes B–D (assign/map/classes):** Prerequisites 1–4 **and** Prerequisite 5 (stage). You need `doce-org-alias`, `pipelineId`, and `stageId`.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step 2 — Select the mode
|
|
29
|
+
|
|
30
|
+
| If the user wants to… | Mode | Follow |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| Know **which suites to run** for a commit/diff, or what covers their changes | **A — Recommend suites** | `references/recommendation-logic.md` |
|
|
33
|
+
| Assign **one** suite to a stage as a one-off | **B — Assign a single suite** | `references/suite-assignment-modes.md` |
|
|
34
|
+
| **Bulk-map** multiple suites to a stage as a testing strategy | **C — Map multiple suites** | `references/suite-assignment-modes.md` |
|
|
35
|
+
| **Add/remove** individual test classes within a suite assignment | **D — Add/remove classes** | `references/suite-assignment-modes.md` |
|
|
36
|
+
|
|
37
|
+
Mode A is pure reasoning (no writes). Modes B–D mutate org state via the same `testSuiteStages` endpoint (`references/api-endpoint.md`).
|
|
38
|
+
|
|
39
|
+
**How A feeds B–D:** When recommendation flags a relevant suite that is *not assigned* to the stage, that gap is the input to Mode B/C. When it flags a *new method with no suite coverage*, direct the developer to author tests manually (v1 constraint — never suggest generating tests here).
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 3 — Governance & confirmation (Modes B–D)
|
|
44
|
+
|
|
45
|
+
Modes B–D **must** confirm before any write:
|
|
46
|
+
|
|
47
|
+
- **Mode B** — single confirmation prompt naming the suite, stage, and event.
|
|
48
|
+
- **Mode C** — a **mandatory impact-preview table** (Suite / Stage / Event / Action) before the confirmation gate.
|
|
49
|
+
- **Mode D** — re-present the final test list before confirming. **Rejected tests must be EXCLUDED from the payload.** If tests were modified during review, re-present the final list before requesting confirmation. Never call without explicit approval.
|
|
50
|
+
|
|
51
|
+
Do not call the API until the user gives an affirmative response. If the user declines, stop without writing. Full wording for each gate is in `references/suite-assignment-modes.md`.
|
|
52
|
+
|
|
53
|
+
Mode A (recommendation) makes no writes and needs no confirmation gate.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Step 4 — Execute and report
|
|
58
|
+
|
|
59
|
+
Follow the chosen reference file:
|
|
60
|
+
|
|
61
|
+
- `references/recommendation-logic.md` — Mode A: diff classification, provider matching, ranking, gap flagging, output format.
|
|
62
|
+
- `references/suite-assignment-modes.md` — Modes B–D: inputs, confirmation wording, success messages.
|
|
63
|
+
- `references/api-endpoint.md` — the shared `testSuiteStages` POST payload schema (Modes B–D).
|
|
64
|
+
- `references/error-handling.md` — status-code → plain-language tables.
|
|
65
|
+
|
|
66
|
+
Never expose raw API errors, stack traces, or JSON to the user.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Related skills
|
|
71
|
+
|
|
72
|
+
- **`dx-devops-test-pipeline-configure`** — if the suite you want to assign doesn't appear yet, configure or re-sync the provider; also configures quality gates on a stage after mapping.
|
|
73
|
+
- **`dx-devops-test-suite-run`** — execute a recommended/assigned suite on a stage.
|
|
74
|
+
- **`dx-devops-test-failures-analyze`** — analyze failures and improvement suggestions for the tests within a suite.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# API Endpoint — testSuiteStages (Modes B–D)
|
|
2
|
+
|
|
3
|
+
All three assignment modes (B, C, D) use the same Connect API endpoint. Substitute all `<placeholder>` values before executing.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
sf api request rest "/services/data/v67.0/connect/devopstesting/pipeline/<pipelineId>/testSuiteStages" --method POST --body '{"pipelineStageId":"<stageId>","event":"<event>","assignments":[{"testSuiteId":"<id>","action":"add|remove"}]}' --target-org <doce-org-alias>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Full payload schema
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"pipelineStageId": "<stageId>",
|
|
14
|
+
"event": "<event>",
|
|
15
|
+
"assignments": [
|
|
16
|
+
{"testSuiteId": "<suiteId1>", "action": "add"},
|
|
17
|
+
{"testSuiteId": "<suiteId2>", "action": "remove"}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
| Field | Type | Description |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `pipelineStageId` | string | The pipeline stage ID (from Prerequisite 5) |
|
|
25
|
+
| `event` | string | `Pre-Promote`, `Post-Promote`, or `Review` |
|
|
26
|
+
| `assignments` | array | One or more `{testSuiteId, action}` entries — `action` is `add` or `remove` |
|
|
27
|
+
|
|
28
|
+
- **Mode B** sends a single `add` assignment.
|
|
29
|
+
- **Mode C** sends multiple `add`/`remove` entries in one call (bulk mapping).
|
|
30
|
+
- **Mode D** sends `add`/`remove` entries for the classes/suites being synced — rejected tests excluded.
|