@salesforce/afv-skills 1.42.0 → 1.44.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 +2 -6
- package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +3 -0
- package/skills/automation-sandbox-post-copy-configure/SKILL.md +4 -0
- package/skills/design-systems-slds-validate/SKILL.md +2 -2
- package/skills/dx-devops-conflict-resolve/SKILL.md +205 -0
- package/skills/dx-devops-conflict-resolve/examples/conflict-workflows.md +165 -0
- package/skills/dx-devops-conflict-resolve/references/deploy-failure-resolution.md +75 -0
- package/skills/dx-devops-conflict-resolve/references/git-conflict-resolution.md +124 -0
- package/skills/dx-devops-conflict-resolve/scripts/detect-conflicts.sh +91 -0
- package/skills/dx-devops-conflict-resolve/scripts/diagnose-deploy-failure.sh +156 -0
- package/skills/dx-devops-request-status/SKILL.md +160 -0
- package/skills/dx-devops-request-status/examples/polling-workflows.md +101 -0
- package/skills/dx-devops-request-status/references/cli-commands.md +176 -0
- package/skills/dx-devops-request-status/scripts/poll-status.sh +134 -0
- package/skills/dx-devops-test-failures-analyze/SKILL.md +6 -6
- package/skills/dx-devops-test-pipeline-configure/SKILL.md +7 -7
- package/skills/dx-devops-test-suite-assignments-configure/SKILL.md +6 -6
- package/skills/dx-devops-test-suite-run/SKILL.md +6 -6
- package/skills/dx-devops-work-item-manage/SKILL.md +2 -0
- package/skills/dx-org-manage/references/creating-scratch-org.md +5 -2
- package/skills/dx-org-manage/references/creating-snapshot.md +1 -0
- package/skills/dx-org-shape-manage/SKILL.md +152 -0
- package/skills/dx-org-shape-manage/examples/create_error_output.json +9 -0
- package/skills/dx-org-shape-manage/examples/create_success_output.json +9 -0
- package/skills/dx-org-shape-manage/examples/delete_output.json +11 -0
- package/skills/dx-org-shape-manage/examples/list_inactive_output.json +32 -0
- package/skills/dx-org-shape-manage/examples/list_output.json +24 -0
- package/skills/dx-org-shape-manage/references/cli_flags.md +135 -0
- package/skills/dx-org-switch/SKILL.md +2 -2
- package/skills/dx-org-trial-expiration-check/SKILL.md +2 -0
- package/skills/dx-pkg-post-install-configure/SKILL.md +3 -0
- package/skills/education-cloud-multi-campus-configure/SKILL.md +211 -0
- package/skills/education-cloud-multi-campus-configure/examples/hierarchy_visualization.md +174 -0
- package/skills/education-cloud-multi-campus-configure/examples/output_examples.md +54 -0
- package/skills/education-cloud-multi-campus-configure/examples/sample_hierarchy_input.csv +29 -0
- package/skills/education-cloud-multi-campus-configure/examples/sample_hierarchy_input_edgecases.csv +16 -0
- package/skills/education-cloud-multi-campus-configure/references/account_recordtype_prerequisite.md +44 -0
- package/skills/education-cloud-multi-campus-configure/references/delta_computation.md +33 -0
- package/skills/education-cloud-multi-campus-configure/references/error_handling.md +198 -0
- package/skills/education-cloud-multi-campus-configure/references/foundation_prerequisites.md +54 -0
- package/skills/education-cloud-multi-campus-configure/references/gotchas.md +16 -0
- package/skills/education-cloud-multi-campus-configure/references/hierarchy_parsing_rules.md +133 -0
- package/skills/education-cloud-multi-campus-configure/references/mcp-invocation.md +75 -0
- package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/SKILL.md +1 -1
- package/skills/experience-cms-brand-apply/SKILL.md +4 -1
- package/skills/experience-cms-brand-create/SKILL.md +197 -0
- package/skills/experience-cms-brand-create/assets/brand-template.json +329 -0
- package/skills/experience-cms-brand-create/references/brand-anatomy.md +120 -0
- package/skills/experience-cms-brand-create/references/disk-contract.md +84 -0
- package/skills/experience-cms-content-generate/SKILL.md +192 -0
- package/skills/experience-cms-content-generate/assets/display-formats.md +84 -0
- package/skills/experience-cms-content-generate/assets/payloads/create-content-bulk.json +11 -0
- package/skills/experience-cms-content-generate/assets/payloads/create-content-single.json +11 -0
- package/skills/experience-cms-content-generate/assets/payloads/publish-content.json +4 -0
- package/skills/experience-cms-content-generate/assets/payloads/update-content.json +9 -0
- package/skills/experience-cms-content-generate/assets/questions.md +241 -0
- package/skills/experience-cms-content-generate/examples/create-content-call.md +81 -0
- package/skills/experience-cms-content-generate/references/bulk-batching.md +56 -0
- package/skills/experience-cms-content-generate/references/content-type-classification.md +88 -0
- package/skills/experience-cms-content-generate/references/content-write-tool.md +95 -0
- package/skills/experience-cms-content-generate/references/delegation-protocol.md +37 -0
- package/skills/experience-cms-content-generate/references/edit-publish-workflow.md +63 -0
- package/skills/experience-cms-content-generate/references/error-recovery.md +72 -0
- package/skills/experience-cms-content-generate/references/identifier-resolution.md +26 -0
- package/skills/experience-cms-content-generate/references/intent-routing.md +45 -0
- package/skills/experience-cms-content-generate/references/principles.md +19 -0
- package/skills/experience-cms-content-generate/references/ux-rules.md +68 -0
- package/skills/experience-cms-content-generate/references/workspace-resolution.md +33 -0
- package/skills/experience-cms-content-type-generate/SKILL.md +449 -0
- package/skills/experience-cms-content-type-generate/assets/discovery-prompts.md +79 -0
- package/skills/experience-cms-content-type-generate/assets/schema-example.json +70 -0
- package/skills/experience-cms-content-type-generate/references/agent-checklist.md +50 -0
- package/skills/experience-cms-content-type-generate/references/anti-patterns.md +39 -0
- package/skills/experience-cms-content-type-generate/references/deployment-errors.md +27 -0
- package/skills/experience-cms-content-type-generate/references/discovery-details.md +106 -0
- package/skills/experience-cms-content-type-generate/references/discovery-query-rules.md +85 -0
- package/skills/experience-cms-content-type-generate/references/edit-fields-loop.md +48 -0
- package/skills/experience-cms-content-type-generate/references/pre-deploy-checklist.md +21 -0
- package/skills/experience-cms-content-type-generate/references/retrieve-and-reconcile.md +105 -0
- package/skills/experience-cms-content-type-generate/references/schema-rules.md +51 -0
- package/skills/experience-cms-content-type-generate/references/schema-summary-format.md +60 -0
- package/skills/experience-lds-graphql-generate/SKILL.md +4 -0
- package/skills/experience-lwc-accessibility-jest-run/SKILL.md +79 -0
- package/skills/experience-lwc-accessibility-jest-run/references/running-sa11y-jest-tests.md +205 -0
- package/skills/experience-lwc-design-generate/SKILL.md +5 -4
- package/skills/experience-lwc-generate/SKILL.md +10 -9
- package/skills/experience-ui-bundle-deploy/references/dev-preview.md +21 -0
- package/skills/experience-ui-bundle-deploy/references/social-login.md +1 -0
- package/skills/experience-ui-bundle-file-upload-generate/SKILL.md +6 -6
- package/skills/experience-ui-bundle-localize/SKILL.md +30 -37
- package/skills/experience-ui-bundle-localize/references/gotchas.md +23 -7
- package/skills/experience-ui-bundle-localize/references/i18n-setup.md +48 -4
- package/skills/experience-ui-bundle-localize/references/label-xml.md +22 -8
- package/skills/experience-ui-bundle-localize/references/verifying.md +39 -11
- package/skills/experience-ui-bundle-localize/scripts/detect-bundle-type.sh +118 -15
- package/skills/experience-ui-bundle-localize/scripts/tests/test-detect-bundle-type.sh +187 -0
- package/skills/experience-ui-bundle-mfa-configure/SKILL.md +13 -2
- package/skills/experience-ui-bundle-mfa-configure/references/social-login.md +1 -0
- package/skills/experience-ui-bundle-project-generate/SKILL.md +2 -2
- package/skills/integration-connectivity-generate/SKILL.md +11 -10
- package/skills/integration-eventing-cdc-configure/SKILL.md +6 -6
- package/skills/integration-eventing-subscription-configure/SKILL.md +6 -5
- package/skills/mobile-platform-native-capabilities-integrate/SKILL.md +2 -2
- package/skills/mobile-platform-offline-validate/scripts/package.json +1 -1
- package/skills/platform-agentexchange-partner-offers-configure/SKILL.md +8 -8
- package/skills/platform-custom-application-generate/SKILL.md +2 -0
- package/skills/platform-custom-field-generate/SKILL.md +8 -6
- package/skills/platform-custom-metadata-type-generate/SKILL.md +460 -0
- package/skills/platform-custom-metadata-type-generate/references/cmdt-records.md +251 -0
- package/skills/platform-custom-metadata-type-generate/scripts/sanitize-developer-name.sh +46 -0
- package/skills/platform-custom-setting-generate/SKILL.md +419 -0
- package/skills/platform-dataspace-access-configure/SKILL.md +2 -0
- package/skills/platform-sharing-owd-configure/SKILL.md +3 -0
- package/skills/platform-value-set-generate/SKILL.md +2 -0
- package/skills/service-agentforce-channel-configure/SKILL.md +29 -20
- package/skills/service-agentforce-channel-configure/assets/BotEmailDefinition.botEmailDefinition-meta.xml +36 -0
- package/skills/service-agentforce-channel-configure/assets/email/unfiled$public/AgentforceForServiceEmailTemplate.email +17 -0
- package/skills/service-agentforce-channel-configure/assets/email/unfiled$public/AgentforceForServiceEmailTemplate.email-meta.xml +29 -0
- package/skills/service-agentforce-channel-configure/assets/mdapi-package.xml +25 -0
- package/skills/service-agentforce-channel-configure/assets/settings-mdapi-package.xml +30 -0
- package/skills/service-agentforce-channel-configure/references/agent-wiring.md +20 -0
- package/skills/service-agentforce-channel-configure/references/botemaildefinition.md +107 -0
- package/skills/service-agentforce-channel-configure/references/channel-branch-email.md +203 -50
- package/skills/service-agentforce-channel-configure/references/channel-types.md +30 -3
- package/skills/service-agentforce-channel-configure/references/queue-resolution.md +17 -8
- package/skills/service-agentforce-channel-configure/references/routing-flow.md +14 -3
- package/skills/service-agentforce-channel-configure/scripts/validate-botemaildefinition.py +126 -0
- package/skills/service-agentforce-channel-configure/scripts/validate-emailtemplate.py +133 -0
- package/skills/service-de-channel-activate/SKILL.md +271 -0
- package/skills/service-de-channel-activate/references/gotchas.md +31 -0
- package/skills/service-de-channel-activate/references/phone-verification.md +96 -0
- package/skills/service-de-channel-activate/references/worked-examples.md +14 -0
- package/skills/service-de-channel-consent-configure/SKILL.md +230 -0
- package/skills/service-de-channel-consent-configure/references/gotchas.md +41 -0
- package/skills/service-de-channel-consent-configure/references/language-keywords.md +84 -0
- package/skills/service-de-channel-consent-configure/references/worked-examples.md +134 -0
- package/skills/service-de-channel-create/SKILL.md +369 -0
- package/skills/service-de-channel-create/references/apple.md +59 -0
- package/skills/service-de-channel-create/references/connect-insert.md +84 -0
- package/skills/service-de-channel-create/references/facebook.md +154 -0
- package/skills/service-de-channel-create/references/line.md +66 -0
- package/skills/service-de-channel-create/references/sms.md +98 -0
- package/skills/service-de-channel-create/references/whatsapp.md +98 -0
- package/skills/service-de-channel-create/references/worked-examples.md +70 -0
- package/skills/service-de-channel-routing-configure/SKILL.md +345 -0
- package/skills/service-de-channel-routing-configure/references/asa-routing.md +90 -0
- package/skills/service-de-channel-routing-configure/references/gotchas.md +27 -0
- package/skills/service-de-channel-routing-configure/references/queue-creation.md +123 -0
- package/skills/service-de-channel-routing-configure/references/target-locate.md +98 -0
- package/skills/service-de-channel-routing-configure/references/worked-examples.md +174 -0
- package/skills/service-de-headless-channel-configure/SKILL.md +305 -0
- package/skills/service-de-headless-channel-configure/references/gotchas.md +27 -0
- package/skills/service-de-headless-channel-configure/references/inputs.md +49 -0
- package/skills/service-de-headless-channel-configure/references/output-envelopes.md +53 -0
- package/skills/service-de-headless-channel-configure/references/partial-success.md +24 -0
- package/skills/service-de-headless-channel-configure/references/terms-and-conditions.md +54 -0
- package/skills/service-de-headless-channel-configure/references/worked-examples.md +108 -0
- package/skills/service-de-waba-integrate/SKILL.md +227 -0
- package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +29 -0
- package/skills/service-digital-engagement-messaging-site-integrate/SKILL.md +10 -9
- package/skills/service-digital-engagement-messaging-site-integrate/references/lwr_patch.md +39 -21
- package/skills/service-digital-engagement-messaging-site-integrate/scripts/patch_lwr_bundle.sh +157 -96
- package/skills/service-email-to-case-configure/SKILL.md +190 -0
- package/skills/service-email-to-case-configure/assets/CaseSettings.settings-meta.xml +45 -0
- package/skills/service-email-to-case-configure/examples/CaseSettings-two-addresses.settings-meta.xml +36 -0
- package/skills/service-email-to-case-configure/references/apply-mechanics.md +73 -0
- package/skills/service-email-to-case-configure/references/routing_address_reference.md +73 -0
- package/skills/service-email-to-case-configure/references/troubleshooting.md +25 -0
- package/skills/service-email-to-case-configure/scripts/apply-casesettings.py +1315 -0
- package/skills/service-email-to-case-configure/scripts/check-agent-email-capability.sh +26 -0
- package/skills/service-email-to-case-configure/scripts/tests/__init__.py +0 -0
- package/skills/service-email-to-case-configure/scripts/tests/_bootstrap.py +45 -0
- package/skills/service-email-to-case-configure/scripts/tests/_fakeorg.py +366 -0
- package/skills/service-email-to-case-configure/scripts/tests/_run.py +84 -0
- package/skills/service-email-to-case-configure/scripts/tests/test_apply_org_scenarios.py +655 -0
- package/skills/service-email-to-case-configure/scripts/tests/test_get_session.py +134 -0
- package/skills/service-email-to-case-configure/scripts/tests/test_new_capabilities.py +193 -0
- package/skills/service-email-to-case-configure/scripts/tests/test_validate_casesettings.py +170 -0
- package/skills/service-email-to-case-configure/scripts/validate-casesettings.py +229 -0
- package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +33 -15
- package/skills/service-itsm-agentic-setup-agentforce-coordinate/examples/output-templates.md +63 -47
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +17 -12
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/references/cli-invocation.md +5 -3
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/scripts/classify-enable-plan.mjs +11 -3
- package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +8 -6
- package/skills/service-itsm-agentic-setup-agentforce-studio-validate/references/cli-invocation.md +3 -3
- package/skills/service-itsm-agentic-setup-agentforce-studio-validate/scripts/classify-readiness.mjs +11 -3
- package/skills/service-itsm-agentic-setup-configure/SKILL.md +5 -5
- package/skills/service-itsm-agentic-setup-configure/examples/output-templates.md +5 -5
- package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +2 -2
- package/skills/service-itsm-agentic-setup-employee-agent-configure/references/report-format.md +11 -7
- package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/render-report.mjs +20 -7
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +10 -6
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/action-availability.md +7 -7
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/report-format.md +11 -7
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/build-create-body.mjs +24 -17
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-action-availability.mjs +98 -58
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/render-report.mjs +20 -7
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/strip-release-management.mjs +176 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +19 -19
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/cli-invocation.md +3 -4
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/helper-contracts.md +6 -6
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/permset-topology.md +3 -10
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/classify-permset-availability.mjs +7 -9
- package/skills/service-itsm-incident-mgmt-configure/SKILL.md +2 -0
- package/skills/service-itsm-incident-priority-configure/SKILL.md +15 -12
- package/skills/service-itsm-incident-priority-configure/examples/matrix-operations.md +27 -1
- package/skills/service-itsm-incident-priority-configure/references/sf-cli-invocation.md +37 -6
- package/skills/service-native-voice-recording-transcription-configure/SKILL.md +146 -0
- package/skills/service-native-voice-recording-transcription-configure/assets/confirmation-output.json +16 -0
- package/skills/service-native-voice-recording-transcription-configure/assets/package.xml +22 -0
- package/skills/service-native-voice-recording-transcription-configure/references/thunderbird-voice-settings.md +101 -0
- package/skills/service-native-voice-recording-transcription-configure/scripts/enable-recording-transcription.sh +181 -0
- package/skills/service-helpagent-coordinate/references/channel-help-portal.md +0 -22
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-1-1-non-text-content.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-i-lists.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-ii-tables.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-iii-form-labels.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-iv-regions.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-v-groups.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-5-identify-input.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-4-3-contrast.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-1-1-keyboard.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-4-4-link-purpose.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-4-6-headings-labels.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-5-1-pointer-gestures.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-5-2-pointer-cancellation.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-5-3-label-in-name.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-5-7-dragging-movement.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-2-1-on-focus.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-2-2-on-input.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-3-1-error-identification.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-3-2-labels-instructions.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-3-3-error-suggestion.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-4-1-2-i-name.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-4-1-2-ii-role.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-4-1-2-iii-value.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-1-1-non-text-content.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-4-1-use-of-color.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-4-10-resize-reflow.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-4-11-non-text-contrast.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-4-3-contrast.md +0 -0
- /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/scripts/contrast-ratio.py +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# detect-conflicts.sh — Non-destructively detect Git merge conflicts between a
|
|
3
|
+
# DevOps Center work item feature branch and a target pipeline-stage branch.
|
|
4
|
+
#
|
|
5
|
+
# DevOps Center is Git-backed: it promotes the work item's feature branch into
|
|
6
|
+
# the target stage branch. This script trial-merges the target INTO the feature
|
|
7
|
+
# branch WITHOUT committing, records the conflicting files, then aborts the trial
|
|
8
|
+
# so the working tree is left exactly as it was found.
|
|
9
|
+
#
|
|
10
|
+
# Usage: detect-conflicts.sh <feature-branch> <target-branch> [remote]
|
|
11
|
+
# Example: detect-conflicts.sh feature/WI-101 uat origin
|
|
12
|
+
#
|
|
13
|
+
# Exit codes:
|
|
14
|
+
# 0 clean merge — no conflicts, safe to promote
|
|
15
|
+
# 2 conflicts — the conflicting files are printed to stdout
|
|
16
|
+
# 1 error — dirty tree, unknown branch, or fetch failure (stderr)
|
|
17
|
+
set -euo pipefail
|
|
18
|
+
|
|
19
|
+
FEATURE="${1:?usage: detect-conflicts.sh <feature-branch> <target-branch> [remote]}"
|
|
20
|
+
TARGET="${2:?usage: detect-conflicts.sh <feature-branch> <target-branch> [remote]}"
|
|
21
|
+
REMOTE="${3:-origin}"
|
|
22
|
+
|
|
23
|
+
# Must be inside a git work tree.
|
|
24
|
+
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
25
|
+
echo "ERROR: not inside a git repository." >&2
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Refuse to run with a dirty working tree — a trial merge could clobber changes.
|
|
30
|
+
if [ -n "$(git status --porcelain)" ]; then
|
|
31
|
+
echo "ERROR: working tree is not clean. Commit or stash changes before detecting conflicts." >&2
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Remember where to return to, so detection leaves the checkout untouched.
|
|
36
|
+
ORIG_REF="$(git symbolic-ref --quiet --short HEAD || git rev-parse HEAD)"
|
|
37
|
+
|
|
38
|
+
cleanup() {
|
|
39
|
+
git merge --abort >/dev/null 2>&1 || git reset --merge >/dev/null 2>&1 || true
|
|
40
|
+
git checkout --quiet "$ORIG_REF" >/dev/null 2>&1 || true
|
|
41
|
+
}
|
|
42
|
+
trap cleanup EXIT
|
|
43
|
+
|
|
44
|
+
if ! git fetch "$REMOTE" >/dev/null 2>&1; then
|
|
45
|
+
echo "ERROR: git fetch $REMOTE failed." >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# Check out the feature branch as a tracking branch if it is not local yet.
|
|
50
|
+
if ! git checkout --quiet "$FEATURE" >/dev/null 2>&1; then
|
|
51
|
+
if ! git checkout --quiet -b "$FEATURE" "$REMOTE/$FEATURE" >/dev/null 2>&1; then
|
|
52
|
+
echo "ERROR: cannot check out feature branch '$FEATURE' (local or $REMOTE/$FEATURE)." >&2
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# Confirm the target branch exists on the remote.
|
|
58
|
+
if ! git rev-parse --verify --quiet "$REMOTE/$TARGET" >/dev/null; then
|
|
59
|
+
echo "ERROR: target branch '$REMOTE/$TARGET' not found." >&2
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Trial-merge the target INTO the feature branch, without committing. Capture the
|
|
64
|
+
# merge exit status explicitly — a non-zero status means either merge conflicts
|
|
65
|
+
# (unmerged paths present) OR a non-conflict failure such as unrelated histories.
|
|
66
|
+
set +e
|
|
67
|
+
MERGE_OUT="$(git merge --no-commit --no-ff "$REMOTE/$TARGET" 2>&1)"
|
|
68
|
+
MERGE_STATUS=$?
|
|
69
|
+
set -e
|
|
70
|
+
CONFLICTS="$(git diff --name-only --diff-filter=U || true)"
|
|
71
|
+
|
|
72
|
+
# Trap-based cleanup aborts the trial merge and restores the original checkout.
|
|
73
|
+
|
|
74
|
+
# Real merge conflicts: unmerged paths exist. Report them and signal "conflicts".
|
|
75
|
+
if [ -n "$CONFLICTS" ]; then
|
|
76
|
+
echo "CONFLICTS: merging $REMOTE/$TARGET into $FEATURE conflicts on these files:"
|
|
77
|
+
printf '%s\n' "$CONFLICTS"
|
|
78
|
+
exit 2
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
# No unmerged paths but the merge still failed — a non-conflict error (e.g.
|
|
82
|
+
# unrelated histories). Never report CLEAN in this case; surface the error.
|
|
83
|
+
if [ "$MERGE_STATUS" -ne 0 ]; then
|
|
84
|
+
echo "ERROR: git merge of $REMOTE/$TARGET into $FEATURE failed for a non-conflict reason:" >&2
|
|
85
|
+
printf '%s\n' "$MERGE_OUT" >&2
|
|
86
|
+
exit 1
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
# Merge succeeded with no conflicts — safe to promote.
|
|
90
|
+
echo "CLEAN: no merge conflicts between $FEATURE and $REMOTE/$TARGET."
|
|
91
|
+
exit 0
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# diagnose-deploy-failure.sh — Classify a DevOps Center promotion/deploy failure
|
|
3
|
+
# and decide whether a FULL PROMOTION can fix it.
|
|
4
|
+
#
|
|
5
|
+
# DevOps Center promotes by deploying a work item's feature branch into the target
|
|
6
|
+
# stage branch. A promotion can fail for two broad reasons:
|
|
7
|
+
# 1. Merge conflict — the branches conflict; re-promoting will not help. Resolve
|
|
8
|
+
# the conflict first (scripts/detect-conflicts.sh + the resolve workflow).
|
|
9
|
+
# 2. Deploy error — frequently a MISSING DEPENDENCY: the deployed set
|
|
10
|
+
# references a component it does not include. A FULL promotion (promote ALL
|
|
11
|
+
# pending changes for the work item, not a partial/selective set) can fix this
|
|
12
|
+
# ONLY if the missing component actually exists on the feature branch.
|
|
13
|
+
#
|
|
14
|
+
# This script parses the error text; when it finds a missing dependency it checks,
|
|
15
|
+
# with `git show`, whether that component's source file is present on the branch.
|
|
16
|
+
#
|
|
17
|
+
# Usage: diagnose-deploy-failure.sh <error-file|-> <feature-branch> [target-branch] [remote]
|
|
18
|
+
# Pass '-' as the first argument to read the error text from stdin.
|
|
19
|
+
# Example: sf project deploy start ... 2>&1 \
|
|
20
|
+
# | scripts/diagnose-deploy-failure.sh - feature/WI-101 uat origin
|
|
21
|
+
#
|
|
22
|
+
# Output: key=value lines the agent parses —
|
|
23
|
+
# REASON, CAN_FULL_PROMOTION_FIX, RECOMMENDATION, and when a dependency is parsed
|
|
24
|
+
# MISSING_DEPENDENCY_TYPE / MISSING_DEPENDENCY_NAME / IN_FEATURE_BRANCH
|
|
25
|
+
# (+ IN_TARGET_BRANCH when a target branch is given).
|
|
26
|
+
#
|
|
27
|
+
# Exit codes:
|
|
28
|
+
# 0 full promotion CAN fix — missing component exists on the feature branch
|
|
29
|
+
# 2 merge conflict — resolve the conflict, do not just re-promote
|
|
30
|
+
# 3 dependency not on branch — component must be added before promoting
|
|
31
|
+
# 4 no dependency parsed — inspect the error; a full promotion likely won't help
|
|
32
|
+
# 1 usage / environment error
|
|
33
|
+
set -euo pipefail
|
|
34
|
+
|
|
35
|
+
ERR_SRC="${1:?usage: diagnose-deploy-failure.sh <error-file|-> <feature-branch> [target-branch] [remote]}"
|
|
36
|
+
FEATURE="${2:?usage: diagnose-deploy-failure.sh <error-file|-> <feature-branch> [target-branch] [remote]}"
|
|
37
|
+
TARGET="${3:-}"
|
|
38
|
+
REMOTE="${4:-origin}"
|
|
39
|
+
|
|
40
|
+
# Read the error text from a file or stdin.
|
|
41
|
+
if [ "$ERR_SRC" = "-" ]; then
|
|
42
|
+
ERR="$(cat)"
|
|
43
|
+
elif [ -f "$ERR_SRC" ]; then
|
|
44
|
+
ERR="$(cat "$ERR_SRC")"
|
|
45
|
+
else
|
|
46
|
+
echo "ERROR: error source '$ERR_SRC' is not a readable file (use '-' to read stdin)." >&2
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
51
|
+
echo "ERROR: not inside a git repository." >&2
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
shopt -s nocasematch
|
|
56
|
+
|
|
57
|
+
# 1. Merge conflict? A full promotion cannot fix it — resolve the conflict instead.
|
|
58
|
+
if [[ "$ERR" =~ (MERGE_CONFLICT|CONFLICTS:) ]]; then
|
|
59
|
+
echo "REASON=merge_conflict"
|
|
60
|
+
echo "CAN_FULL_PROMOTION_FIX=false"
|
|
61
|
+
echo "RECOMMENDATION=This is a merge conflict, not a missing dependency. Resolve it with the conflict workflow (scripts/detect-conflicts.sh, then merge/resolve/commit/push the feature branch), then re-promote."
|
|
62
|
+
exit 2
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# 2. Try to parse a missing dependency (type + name) from the error text.
|
|
66
|
+
# Order mirrors the DevOps Center provider: "Variable does not exist" first.
|
|
67
|
+
DEP_TYPE=""
|
|
68
|
+
DEP_NAME=""
|
|
69
|
+
if [[ "$ERR" =~ Variable[[:space:]]+does[[:space:]]+not[[:space:]]+exist:[[:space:]]*([A-Za-z0-9_]+) ]]; then
|
|
70
|
+
DEP_TYPE="ApexClass"; DEP_NAME="${BASH_REMATCH[1]}"
|
|
71
|
+
elif [[ "$ERR" =~ no[[:space:]]+(ApexClass|ApexTrigger|ApexPage|CustomObject|Flow)[[:space:]]+named[[:space:]]+([A-Za-z0-9_]+)[[:space:]]+found ]]; then
|
|
72
|
+
DEP_TYPE="${BASH_REMATCH[1]}"; DEP_NAME="${BASH_REMATCH[2]}"
|
|
73
|
+
elif ! [[ "$ERR" =~ (Variable[[:space:]]does[[:space:]]not[[:space:]]exist|Problem:) ]] \
|
|
74
|
+
&& [[ "$ERR" =~ Type:[[:space:]]*(ApexClass|ApexTrigger|ApexPage|Profile|CustomObject|Flow) ]]; then
|
|
75
|
+
DEP_TYPE="${BASH_REMATCH[1]}"
|
|
76
|
+
if [[ "$ERR" =~ Component:[[:space:]]*([A-Za-z0-9_]+) ]]; then
|
|
77
|
+
DEP_NAME="${BASH_REMATCH[1]}"
|
|
78
|
+
else
|
|
79
|
+
DEP_TYPE="" # need both type and name to act
|
|
80
|
+
fi
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
# Canonicalize the metadata type (nocasematch may capture any casing from the error).
|
|
84
|
+
canon_type() {
|
|
85
|
+
case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in
|
|
86
|
+
apexclass) echo "ApexClass" ;;
|
|
87
|
+
apextrigger) echo "ApexTrigger" ;;
|
|
88
|
+
apexpage) echo "ApexPage" ;;
|
|
89
|
+
profile) echo "Profile" ;;
|
|
90
|
+
customobject) echo "CustomObject" ;;
|
|
91
|
+
flow) echo "Flow" ;;
|
|
92
|
+
*) echo "" ;;
|
|
93
|
+
esac
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
CANON=""
|
|
97
|
+
[ -n "$DEP_TYPE" ] && CANON="$(canon_type "$DEP_TYPE")"
|
|
98
|
+
|
|
99
|
+
if [ -z "$CANON" ] || [ -z "$DEP_NAME" ]; then
|
|
100
|
+
echo "REASON=no_dependency_parsed"
|
|
101
|
+
echo "CAN_FULL_PROMOTION_FIX=false"
|
|
102
|
+
echo "RECOMMENDATION=Could not identify a missing component from the error. Inspect the full deploy error and fix the underlying metadata/test issue, then re-promote. A full promotion is unlikely to help unless the failure is a missing dependency."
|
|
103
|
+
exit 4
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# Candidate source paths for the component (standard SFDX layouts).
|
|
107
|
+
paths_for() {
|
|
108
|
+
local t="$1" n="$2"
|
|
109
|
+
case "$t" in
|
|
110
|
+
ApexClass) printf '%s\n' "force-app/main/default/classes/$n.cls" "main/default/classes/$n.cls" "classes/$n.cls" ;;
|
|
111
|
+
ApexTrigger) printf '%s\n' "force-app/main/default/triggers/$n.trigger" "main/default/triggers/$n.trigger" ;;
|
|
112
|
+
ApexPage) printf '%s\n' "force-app/main/default/pages/$n.page" "main/default/pages/$n.page" ;;
|
|
113
|
+
Profile) printf '%s\n' "force-app/main/default/profiles/$n.profile-meta.xml" "main/default/profiles/$n.profile-meta.xml" ;;
|
|
114
|
+
CustomObject) printf '%s\n' "force-app/main/default/objects/$n/$n.object-meta.xml" "main/default/objects/$n/$n.object-meta.xml" ;;
|
|
115
|
+
Flow) printf '%s\n' "force-app/main/default/flows/$n.flow-meta.xml" "main/default/flows/$n.flow-meta.xml" ;;
|
|
116
|
+
esac
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# Is at least one candidate path present in the branch? Try the local ref, then the remote ref.
|
|
120
|
+
present_in_branch() {
|
|
121
|
+
local branch="$1" t="$2" n="$3" p
|
|
122
|
+
while IFS= read -r p; do
|
|
123
|
+
[ -z "$p" ] && continue
|
|
124
|
+
if git show "$branch:$p" >/dev/null 2>&1 || git show "$REMOTE/$branch:$p" >/dev/null 2>&1; then
|
|
125
|
+
return 0
|
|
126
|
+
fi
|
|
127
|
+
done <<EOF
|
|
128
|
+
$(paths_for "$t" "$n")
|
|
129
|
+
EOF
|
|
130
|
+
return 1
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
IN_FEATURE=false
|
|
134
|
+
if present_in_branch "$FEATURE" "$CANON" "$DEP_NAME"; then IN_FEATURE=true; fi
|
|
135
|
+
|
|
136
|
+
IN_TARGET=""
|
|
137
|
+
if [ -n "$TARGET" ]; then
|
|
138
|
+
if present_in_branch "$TARGET" "$CANON" "$DEP_NAME"; then IN_TARGET=true; else IN_TARGET=false; fi
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
echo "MISSING_DEPENDENCY_TYPE=$CANON"
|
|
142
|
+
echo "MISSING_DEPENDENCY_NAME=$DEP_NAME"
|
|
143
|
+
echo "IN_FEATURE_BRANCH=$IN_FEATURE"
|
|
144
|
+
[ -n "$IN_TARGET" ] && echo "IN_TARGET_BRANCH=$IN_TARGET"
|
|
145
|
+
|
|
146
|
+
if [ "$IN_FEATURE" = true ]; then
|
|
147
|
+
echo "REASON=dependency_in_feature_branch"
|
|
148
|
+
echo "CAN_FULL_PROMOTION_FIX=true"
|
|
149
|
+
echo "RECOMMENDATION=The missing component $CANON '$DEP_NAME' exists on the feature branch but was not in the deployed set. A FULL promotion (promote all pending changes for this work item, not a partial set) should include it and fix the failure. Confirm with the user, then re-promote as a full promotion via dx-devops-promote."
|
|
150
|
+
exit 0
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
echo "REASON=dependency_not_in_feature_branch"
|
|
154
|
+
echo "CAN_FULL_PROMOTION_FIX=false"
|
|
155
|
+
echo "RECOMMENDATION=The missing component $CANON '$DEP_NAME' is NOT on the feature branch, so promoting the branch cannot supply it. Add and commit the missing $CANON to the work item's feature branch (or include the work item that owns it), then re-promote."
|
|
156
|
+
exit 3
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dx-devops-request-status
|
|
3
|
+
description: "Use this skill to poll the status of an asynchronous DevOps Center request — a promotion or deploy operation. Provide the request token returned by dx-devops-promote (the promote response) to check completion, monitor progress, or verify success or failure via sf devops request status. TRIGGER when the user wants to check whether a promotion or deploy finished, monitor an in-flight async request, poll until a request completes, or confirm a request succeeded before finalizing. DO NOT TRIGGER for initiating a promotion or deploy (use dx-devops-promote), for work item creation or status transitions (use dx-devops-work-item-manage), or for conflict detection. Read-only status check — never mutates pipeline state."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
domains: ["Developer Experience"]
|
|
7
|
+
minApiVersion: "58.0"
|
|
8
|
+
relatedSkills:
|
|
9
|
+
- "dx-devops-promote"
|
|
10
|
+
- "dx-devops-work-item-manage"
|
|
11
|
+
cliTools:
|
|
12
|
+
- tool: ["jq"]
|
|
13
|
+
semver: ">=1.6"
|
|
14
|
+
- tool: ["sf"]
|
|
15
|
+
semver: ">=2.0.0"
|
|
16
|
+
accessCheck:
|
|
17
|
+
- type: "orgPref"
|
|
18
|
+
value: "ALMDevopsCorePref"
|
|
19
|
+
- type: "userPerm"
|
|
20
|
+
value: "UserHasDevOpsCore"
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# DevOps Center Request Status
|
|
24
|
+
|
|
25
|
+
Polls the status of an asynchronous DevOps Center request — a promotion or deploy operation — by its request token via `sf devops request status`. Provides headless, `--json`-driven, read-only status checks for autonomous release workflows in CI. This skill never mutates pipeline state; it only reports the current status of an in-flight or completed request.
|
|
26
|
+
|
|
27
|
+
## Scope
|
|
28
|
+
|
|
29
|
+
- **In scope**: Check the status of a single async request by its request token; interpret the two-level outcome (request-processing `.result.status` vs. the `.result.errorDetails` failure oracle); poll with backoff until a request finishes or a caller-supplied timeout is reached; surface parsed error details on failure
|
|
30
|
+
- **Out of scope**: Initiating a promotion or deploy (use `dx-devops-promote`), work item creation/status updates (use `dx-devops-work-item-manage`), conflict detection, running `sf devops promotion complete` (that is the caller's next step after this skill confirms success), pipeline or project setup
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Required Inputs
|
|
35
|
+
|
|
36
|
+
Gather or infer before proceeding:
|
|
37
|
+
|
|
38
|
+
- **Request token** (required): the request token returned in the `dx-devops-promote` promote response. Passed via `-i/--request-token`. Without it, this skill cannot proceed — ask for it or obtain it from the prior promote step's output
|
|
39
|
+
- **Target org**: `-o/--target-org <alias>` (required unless the `target-org` config variable is set)
|
|
40
|
+
|
|
41
|
+
Defaults unless specified:
|
|
42
|
+
- Output format: `--json` for headless consumption
|
|
43
|
+
- Polling interval: 10 seconds between checks; cap total wait at a caller-supplied timeout (default 30 minutes). Never poll faster than every 5 seconds — DOCe API rate limits apply
|
|
44
|
+
|
|
45
|
+
If the user gives a clear request ("check request a0B…", "poll request a0B… until it finishes"), proceed once you have the request token.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Workflow
|
|
50
|
+
|
|
51
|
+
All operations use `sf devops request status` with `--json` output. This skill is **read-only** — it issues no mutations. The command's flags and JSON output schema are documented in `references/cli-commands.md`.
|
|
52
|
+
|
|
53
|
+
### Phase 1 — Authenticate and confirm the request token
|
|
54
|
+
|
|
55
|
+
1. **Verify org authentication** before any operation:
|
|
56
|
+
```bash
|
|
57
|
+
sf org display --json
|
|
58
|
+
```
|
|
59
|
+
- If it fails, instruct the user to run `sf org login web --set-default --alias <alias>`
|
|
60
|
+
- Pass `-o/--target-org <alias>` on every subsequent command (required unless the `target-org` config variable is set)
|
|
61
|
+
|
|
62
|
+
2. **Confirm you have a request token.** If the user initiated a promotion in the same session, reuse the request token captured from the `dx-devops-promote` promote response. If no token is available, STOP and ask for it — do NOT guess or fabricate a token.
|
|
63
|
+
|
|
64
|
+
### Phase 2 — Single status check (two-level semantics)
|
|
65
|
+
|
|
66
|
+
> **CRITICAL:** `.result.status` (uppercase, e.g. `SUCCESS`) reports whether the async **request finished processing** — NOT whether the underlying deploy succeeded. A request can show `status: "SUCCESS"` while the deployment itself **failed**. The real outcome oracle is `.result.errorDetails`: **non-null `errorDetails` means the operation failed, even when `status == SUCCESS`.**
|
|
67
|
+
|
|
68
|
+
3. **Run a single status check** with `scripts/poll-status.sh --once`, which queries the request once and derives the true outcome deterministically (glob-matches the operation-prefixed `.result.status` suffix, then applies the `.result.errorDetails` failure oracle). Do NOT hand-roll the JSON parsing in prose — the script owns the two-level rule so it stays consistent with the polling path:
|
|
69
|
+
```bash
|
|
70
|
+
scripts/poll-status.sh --once <request-token> <target-org-alias>
|
|
71
|
+
```
|
|
72
|
+
Interpret the exit code (the script prints a human-readable line to match):
|
|
73
|
+
- `0` — request finished and the operation **succeeded** (`errorDetails` null) → hand back to the caller
|
|
74
|
+
- `2` — request finished but the operation **FAILED** (status suffix `*FAILED*`/`*ERROR*`/`*CANCELED*`, or a `*SUCCESS*` status with non-null `errorDetails`) → the printed line carries the parsed `errorType`/`errorMessage`
|
|
75
|
+
- `4` — request is **still processing** (non-terminal suffix) → proceed to Phase 3 to poll, or report in-progress for a one-shot check
|
|
76
|
+
- `1` — query/usage error (bad token, auth, or missing dependency)
|
|
77
|
+
|
|
78
|
+
### Phase 3 — Poll until terminal (only when asked to wait)
|
|
79
|
+
|
|
80
|
+
4. **Poll with a bounded loop** when the user asks to wait for completion. Run `scripts/poll-status.sh` and report the final status it prints:
|
|
81
|
+
```bash
|
|
82
|
+
scripts/poll-status.sh <request-token> <target-org-alias> [interval-seconds] [timeout-seconds]
|
|
83
|
+
```
|
|
84
|
+
- The script polls every `interval-seconds` (default 10), never sleeps past `timeout-seconds`, stops on a terminal request state, and applies the same two-level outcome check as `--once`. Exit codes: `0` = finished + succeeded (`errorDetails` null), `2` = finished but the operation failed (`errorDetails` set, or status suffix `*FAILED*`/`*ERROR*`/`*CANCELED*`), `3` = timeout, `1` = query/usage error
|
|
85
|
+
- It is a read-only loop — it issues only `sf devops request status` queries, never mutations
|
|
86
|
+
- Do NOT hand-roll a polling loop in prose; the script enforces the interval floor, exact timeout, terminal-state detection, and the `errorDetails` outcome check deterministically
|
|
87
|
+
|
|
88
|
+
### Phase 4 — Report
|
|
89
|
+
|
|
90
|
+
5. **Report the outcome**:
|
|
91
|
+
- On success (finished, `errorDetails` empty): "Request `<token>` completed successfully." — then remind the caller that promotion finalization (`sf devops promotion complete`) is the next step, owned by `dx-devops-promote`
|
|
92
|
+
- On failure (finished, `errorDetails` set — even if `status == SUCCESS`): "Request `<token>` failed." plus the `errorType` / `errorMessage` parsed from `errorDetails` and the `message` field — do NOT retry or remediate here; that is the caller's decision
|
|
93
|
+
- On timeout (still processing): report the last observed request status and the elapsed wait; suggest polling again later — do NOT report success or failure for a request that has not finished processing
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Rules / Constraints
|
|
98
|
+
|
|
99
|
+
| Constraint | Rationale |
|
|
100
|
+
|-----------|-----------|
|
|
101
|
+
| Read-only — never mutate pipeline state | This skill only reports status; promotion/deploy/complete are owned by other skills |
|
|
102
|
+
| A request token is mandatory | Status cannot be checked without the `-i/--request-token` from the promote response; never fabricate one |
|
|
103
|
+
| `sf devops request status` must use `--json` | Structured output is required for headless consumption; human-readable output is unreliable to parse |
|
|
104
|
+
| Read `.result.status` and `.result.errorDetails` via `jq`, never by eyeballing | Deterministic parsing prevents misreading a still-processing request as done |
|
|
105
|
+
| A `*SUCCESS*` status is NOT proof of success — check `errorDetails` | `.result.status` reports the async request finished, not that the deploy succeeded; a `PROMOTE_SUCCESS` request can carry a failed deploy in `errorDetails` |
|
|
106
|
+
| Non-null `.result.errorDetails` means the operation FAILED | `errorDetails` is the outcome oracle; it is an escaped JSON string (`errorType`/`errorMessage`) that must be parsed with `jq`/`fromjson` |
|
|
107
|
+
| `.result.status` is operation-prefixed — match the suffix, not a bare token | Real values are `PROMOTE_IN_PROGRESS`/`PROMOTE_SUCCESS`/`DEPLOY_FAILED`; exact-matching bare `IN_PROGRESS`/`SUCCESS` would misclassify (and a poller would hang until timeout) |
|
|
108
|
+
| A request is only "done" at a terminal suffix (`*SUCCESS*`/`*FAILED*`/`*ERROR*`/`*CANCELED*`) | Reporting an `*_IN_PROGRESS`/`*_PENDING`/`*_QUEUED` request as done corrupts the caller's release decision |
|
|
109
|
+
| Never poll faster than every 5 seconds | DOCe API rate limits; unbounded fast polling risks throttling |
|
|
110
|
+
| Bound every polling loop with a timeout | Prevents infinite waits and turn/timeout exhaustion in CI |
|
|
111
|
+
| Never run `sf devops promotion complete` from this skill | Finalization is the caller's step after this skill confirms success |
|
|
112
|
+
| Pass the token as a CLI flag, never interpolate into shell strings | Prevents prompt/command injection via crafted tokens |
|
|
113
|
+
| Never use interactive prompts | Skills run headless; all inputs must be CLI flags |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Gotchas
|
|
118
|
+
|
|
119
|
+
| Issue | Resolution |
|
|
120
|
+
|-------|------------|
|
|
121
|
+
| **No request token provided** | STOP and ask for it, or obtain it from the prior `dx-devops-promote` promote response. Never guess |
|
|
122
|
+
| **`status: "*SUCCESS*"` but the deploy actually failed** | The most important trap: a `*SUCCESS*` status only means the request finished. Check `.result.errorDetails` — if non-null, the operation FAILED. Parse it: `jq -r '.result.errorDetails \| fromjson \| "\(.errorType): \(.errorMessage)"'` |
|
|
123
|
+
| **`errorDetails` is a string, not an object** | It is escaped JSON (e.g. `"{\"errorType\":\"DEPLOYMENT_FAILURE\",...}"`); pipe through `fromjson` before reading `.errorType`/`.errorMessage` |
|
|
124
|
+
| **Status is operation-prefixed (`PROMOTE_SUCCESS`, `DEPLOY_FAILED`)** | Match on the suffix with globs (`*SUCCESS*`, `*FAILED*`); exact-matching bare `SUCCESS`/`FAILED` misclassifies a prefixed value — a poller would treat `PROMOTE_IN_PROGRESS` as unknown and hang until timeout |
|
|
125
|
+
| **Reporting a still-processing request as complete** | Terminal suffixes are `*SUCCESS*`/`*FAILED*`/`*ERROR*`/`*CANCELED*`; treat `*_IN_PROGRESS`/`*_PENDING`/`*_QUEUED`/`*_NEW`/`*_STARTED` as not done — keep polling or report in-progress |
|
|
126
|
+
| **No default org set** | Run `sf org display --json`; if it fails, instruct the user to run `sf org login web --set-default` |
|
|
127
|
+
| **Rate-limit / throttle errors while polling** | Increase the interval (back off); never poll below the 5-second floor |
|
|
128
|
+
| **Infinite wait** | Always pass a timeout to `scripts/poll-status.sh`; on timeout, report the last status rather than blocking |
|
|
129
|
+
| **Confusing request failure with skill failure** | A `Failed` request status is a valid result — report it clearly; do not treat it as a skill error or retry blindly |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Output Expectations
|
|
134
|
+
|
|
135
|
+
Deliverables vary by mode:
|
|
136
|
+
|
|
137
|
+
- **Single check**: `.result.status` (request-processing state) plus the derived outcome — on failure, the `errorType`/`errorMessage` parsed from `.result.errorDetails` and the `.result.message` field
|
|
138
|
+
- **Poll-to-completion**: the derived terminal outcome (succeeded or failed, per the `errorDetails` check) plus elapsed wait, or the last observed request status if the timeout was reached first
|
|
139
|
+
|
|
140
|
+
Outputs are derived from `sf devops request status`. This skill produces no artifacts and mutates nothing.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Cross-Skill Integration
|
|
145
|
+
|
|
146
|
+
| When | Action |
|
|
147
|
+
|------|--------|
|
|
148
|
+
| A promotion or deploy must be initiated first to get a request token | Delegate to `dx-devops-promote` |
|
|
149
|
+
| Outcome is success (finished, `errorDetails` null) and the promotion still needs finalizing | Hand back to `dx-devops-promote` to run `sf devops promotion complete` |
|
|
150
|
+
| Status reports `Failed` due to a metadata conflict | Report the conflict from `errorDetails`; hand back to `dx-devops-promote` to resolve and re-promote |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Reference File Index
|
|
155
|
+
|
|
156
|
+
| File | When to read |
|
|
157
|
+
|------|-------------|
|
|
158
|
+
| `references/cli-commands.md` | When you need the `sf devops request status` flags, JSON output schema, status-value vocabulary, or error-handling patterns |
|
|
159
|
+
| `examples/polling-workflows.md` | When the user's request matches a common pattern (one-shot check, poll-until-done after a promote, timeout handling, failure reporting) |
|
|
160
|
+
| `scripts/poll-status.sh` | Phase 2 — invoke with `--once` for a single deterministic status check; Phase 3 — invoke without `--once` to poll a request token with a bounded interval and exact timeout until it reaches a terminal state |
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Request Status Polling Examples
|
|
2
|
+
|
|
3
|
+
Common patterns for checking the status of an asynchronous DevOps Center request via `sf devops request status`. Every pattern is **read-only** — it issues only status queries and never mutates pipeline state. The request token is returned by `dx-devops-promote` in the promote response.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Example 1 — One-shot status check (with the two-level outcome check)
|
|
8
|
+
|
|
9
|
+
**User prompt:** "What's the status of request 708b2286-bbf3-4621-9531-6d94334ff763?"
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# 1. Verify auth
|
|
13
|
+
sf org display --json
|
|
14
|
+
|
|
15
|
+
# 2. Single deterministic status check. --once queries once and derives the TRUE
|
|
16
|
+
# outcome (.result.status alone is not enough — the status is operation-prefixed
|
|
17
|
+
# and a *SUCCESS* status can carry a failed deploy in errorDetails). The script
|
|
18
|
+
# owns the two-level rule so it stays consistent with the polling path.
|
|
19
|
+
scripts/poll-status.sh --once 708b2286-bbf3-4621-9531-6d94334ff763 my-devops-org
|
|
20
|
+
# Exit codes: 0 succeeded · 2 operation failed · 4 still processing · 1 query error
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For the real response above, `status` is a `*SUCCESS*` value but `errorDetails` is populated, so the script exits `2` and prints the derived failure: **`DEPLOYMENT_FAILURE: classes/HelloMCP.cls-meta.xml: Invalid api version:0.0`**.
|
|
24
|
+
|
|
25
|
+
**Report:** "Request `708b2286…` finished but the deploy FAILED — `DEPLOYMENT_FAILURE`: invalid API version on `HelloMCP.cls-meta.xml`." Never report success from a `*SUCCESS*` status alone.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Example 2 — Poll until the request completes
|
|
30
|
+
|
|
31
|
+
**User prompt:** "Poll request a0B000000000200 until it finishes."
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# scripts/poll-status.sh polls every 10s (default), caps at 30 min (default),
|
|
35
|
+
# stops on a terminal state, and exits non-zero on failure or timeout.
|
|
36
|
+
scripts/poll-status.sh a0B000000000200 my-devops-org
|
|
37
|
+
# Custom interval/timeout: scripts/poll-status.sh a0B000000000200 my-devops-org 15 900
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The script prints progress lines while polling and a final line. It applies the two-level outcome check (request-finished AND `errorDetails` null). Exit codes:
|
|
41
|
+
- `0` — request finished and the operation succeeded (`errorDetails` null)
|
|
42
|
+
- `2` — request finished but the operation FAILED (`errorDetails` set, or status suffix `*FAILED*`/`*ERROR*`/`*CANCELED*`) — reason printed to stderr
|
|
43
|
+
- `3` — timeout reached, still processing
|
|
44
|
+
|
|
45
|
+
**Report:** on exit `0`, "Request `a0B000000000200` completed successfully. Run `sf devops promotion complete` to finalize (owned by `dx-devops-promote`)."
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Example 3 — Hand-off from a promotion
|
|
50
|
+
|
|
51
|
+
**Scenario:** `dx-devops-promote` initiated a promotion and returned a request token. Confirm completion before finalizing.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# REQUEST_TOKEN was captured by dx-devops-promote from the promote response.
|
|
55
|
+
|
|
56
|
+
# Poll it to a terminal state.
|
|
57
|
+
if scripts/poll-status.sh "$REQUEST_TOKEN" my-devops-org; then
|
|
58
|
+
echo "Request $REQUEST_TOKEN succeeded — ready to finalize."
|
|
59
|
+
# Finalization is the caller's step (dx-devops-promote), NOT this skill:
|
|
60
|
+
# sf devops promotion complete --target-stage-id <target-stage-id> --target-org my-devops-org --json
|
|
61
|
+
else
|
|
62
|
+
echo "Request $REQUEST_TOKEN did not succeed — see status output above." >&2
|
|
63
|
+
fi
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Report:** relay the terminal status. Do not run `promotion complete` from this skill — hand back to `dx-devops-promote`.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Example 4 — Timeout while still processing
|
|
71
|
+
|
|
72
|
+
**User prompt:** "Check request a0B000000000300, wait up to 5 minutes."
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# 300s timeout, 15s interval
|
|
76
|
+
scripts/poll-status.sh a0B000000000300 my-devops-org 15 300
|
|
77
|
+
# Exit code 3 means the request was still processing at the 5-minute cap.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Report:** "Request `a0B000000000300` was still in progress (e.g. `PROMOTE_IN_PROGRESS`) after 5 minutes. It has not failed — poll again later to confirm completion." Do NOT report success or failure for a request that has not finished processing.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Example 5 — Failed operation vs. failed query
|
|
85
|
+
|
|
86
|
+
**Scenario:** distinguish a failed *query* (bad token / auth) from a failed *operation* (request finished, but `errorDetails` set).
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# The exit code distinguishes the two failure modes: 1 = the QUERY failed (bad
|
|
90
|
+
# token / auth), 2 = the query succeeded but the OPERATION failed (errorDetails
|
|
91
|
+
# set, even when .result.status is a *SUCCESS* value).
|
|
92
|
+
scripts/poll-status.sh --once a0B000000000400 my-devops-org
|
|
93
|
+
case $? in
|
|
94
|
+
1) echo "Query itself failed — check the request token and org auth." >&2 ;;
|
|
95
|
+
2) echo "Operation failed — see the parsed errorType/errorMessage above." ;;
|
|
96
|
+
0) echo "Operation succeeded." ;;
|
|
97
|
+
4) echo "Still processing — poll to completion (Example 2)." ;;
|
|
98
|
+
esac
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Report:** a failed operation (non-null `errorDetails`) is a valid result — report the parsed `errorType`/`errorMessage`. If it failed on a metadata conflict, hand back to `dx-devops-promote` to resolve and re-promote.
|