@jterrats/smart-deployment 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -0
- package/lib/ai/agentforce-error-handler.d.ts +81 -0
- package/lib/ai/agentforce-error-handler.js +196 -0
- package/lib/ai/agentforce-error-handler.js.map +1 -0
- package/lib/ai/agentforce-priority-service.d.ts +82 -0
- package/lib/ai/agentforce-priority-service.js +257 -0
- package/lib/ai/agentforce-priority-service.js.map +1 -0
- package/lib/ai/agentforce-service.d.ts +99 -0
- package/lib/ai/agentforce-service.js +300 -0
- package/lib/ai/agentforce-service.js.map +1 -0
- package/lib/ai/circuit-breaker.d.ts +115 -0
- package/lib/ai/circuit-breaker.js +277 -0
- package/lib/ai/circuit-breaker.js.map +1 -0
- package/lib/ai/dependency-inference-service.d.ts +76 -0
- package/lib/ai/dependency-inference-service.js +220 -0
- package/lib/ai/dependency-inference-service.js.map +1 -0
- package/lib/ai/llm-provider-factory.d.ts +15 -0
- package/lib/ai/llm-provider-factory.js +36 -0
- package/lib/ai/llm-provider-factory.js.map +1 -0
- package/lib/ai/llm-provider.d.ts +27 -0
- package/lib/ai/llm-provider.js +2 -0
- package/lib/ai/llm-provider.js.map +1 -0
- package/lib/ai/openai-service.d.ts +20 -0
- package/lib/ai/openai-service.js +89 -0
- package/lib/ai/openai-service.js.map +1 -0
- package/lib/ai/prompt-builder.d.ts +79 -0
- package/lib/ai/prompt-builder.js +180 -0
- package/lib/ai/prompt-builder.js.map +1 -0
- package/lib/ai/response-parser.d.ts +67 -0
- package/lib/ai/response-parser.js +234 -0
- package/lib/ai/response-parser.js.map +1 -0
- package/lib/ai/wave-validation-service.d.ts +111 -0
- package/lib/ai/wave-validation-service.js +381 -0
- package/lib/ai/wave-validation-service.js.map +1 -0
- package/lib/analysis/analysis-reporter.d.ts +56 -0
- package/lib/analysis/analysis-reporter.js +170 -0
- package/lib/analysis/analysis-reporter.js.map +1 -0
- package/lib/analytics/error-analytics.d.ts +80 -0
- package/lib/analytics/error-analytics.js +162 -0
- package/lib/analytics/error-analytics.js.map +1 -0
- package/lib/commands/analyze.d.ts +49 -0
- package/lib/commands/analyze.js +232 -0
- package/lib/commands/analyze.js.map +1 -0
- package/lib/commands/config.d.ts +42 -0
- package/lib/commands/config.js +219 -0
- package/lib/commands/config.js.map +1 -0
- package/lib/commands/resume.d.ts +26 -0
- package/lib/commands/resume.js +69 -0
- package/lib/commands/resume.js.map +1 -0
- package/lib/commands/start.d.ts +70 -0
- package/lib/commands/start.js +659 -0
- package/lib/commands/start.js.map +1 -0
- package/lib/commands/status.d.ts +37 -0
- package/lib/commands/status.js +69 -0
- package/lib/commands/status.js.map +1 -0
- package/lib/commands/validate.d.ts +33 -0
- package/lib/commands/validate.js +66 -0
- package/lib/commands/validate.js.map +1 -0
- package/lib/config/repo-config.d.ts +22 -0
- package/lib/config/repo-config.js +31 -0
- package/lib/config/repo-config.js.map +1 -0
- package/lib/constants/agentforce-limits.d.ts +174 -0
- package/lib/constants/agentforce-limits.js +262 -0
- package/lib/constants/agentforce-limits.js.map +1 -0
- package/lib/constants/api-version.d.ts +70 -0
- package/lib/constants/api-version.js +122 -0
- package/lib/constants/api-version.js.map +1 -0
- package/lib/constants/deployment-order.d.ts +68 -0
- package/lib/constants/deployment-order.js +162 -0
- package/lib/constants/deployment-order.js.map +1 -0
- package/lib/constants/salesforce-limits.d.ts +107 -0
- package/lib/constants/salesforce-limits.js +104 -0
- package/lib/constants/salesforce-limits.js.map +1 -0
- package/lib/dependencies/circular-dependency-detector.d.ts +137 -0
- package/lib/dependencies/circular-dependency-detector.js +329 -0
- package/lib/dependencies/circular-dependency-detector.js.map +1 -0
- package/lib/dependencies/cycle-remediation-planner.d.ts +50 -0
- package/lib/dependencies/cycle-remediation-planner.js +192 -0
- package/lib/dependencies/cycle-remediation-planner.js.map +1 -0
- package/lib/dependencies/dependency-cache.d.ts +134 -0
- package/lib/dependencies/dependency-cache.js +303 -0
- package/lib/dependencies/dependency-cache.js.map +1 -0
- package/lib/dependencies/dependency-depth-calculator.d.ts +145 -0
- package/lib/dependencies/dependency-depth-calculator.js +368 -0
- package/lib/dependencies/dependency-depth-calculator.js.map +1 -0
- package/lib/dependencies/dependency-graph-builder.d.ts +151 -0
- package/lib/dependencies/dependency-graph-builder.js +411 -0
- package/lib/dependencies/dependency-graph-builder.js.map +1 -0
- package/lib/dependencies/dependency-impact-analyzer.d.ts +145 -0
- package/lib/dependencies/dependency-impact-analyzer.js +330 -0
- package/lib/dependencies/dependency-impact-analyzer.js.map +1 -0
- package/lib/dependencies/dependency-merger.d.ts +122 -0
- package/lib/dependencies/dependency-merger.js +245 -0
- package/lib/dependencies/dependency-merger.js.map +1 -0
- package/lib/dependencies/dependency-resolver.d.ts +157 -0
- package/lib/dependencies/dependency-resolver.js +298 -0
- package/lib/dependencies/dependency-resolver.js.map +1 -0
- package/lib/dependencies/dependency-validator.d.ts +123 -0
- package/lib/dependencies/dependency-validator.js +291 -0
- package/lib/dependencies/dependency-validator.js.map +1 -0
- package/lib/dependencies/graph-visualizer.d.ts +110 -0
- package/lib/dependencies/graph-visualizer.js +262 -0
- package/lib/dependencies/graph-visualizer.js.map +1 -0
- package/lib/dependencies/heuristic-inference.d.ts +136 -0
- package/lib/dependencies/heuristic-inference.js +430 -0
- package/lib/dependencies/heuristic-inference.js.map +1 -0
- package/lib/deployment/cycle-source-editor.d.ts +34 -0
- package/lib/deployment/cycle-source-editor.js +121 -0
- package/lib/deployment/cycle-source-editor.js.map +1 -0
- package/lib/deployment/deployment-error-handler.d.ts +38 -0
- package/lib/deployment/deployment-error-handler.js +79 -0
- package/lib/deployment/deployment-error-handler.js.map +1 -0
- package/lib/deployment/deployment-reporter.d.ts +63 -0
- package/lib/deployment/deployment-reporter.js +150 -0
- package/lib/deployment/deployment-reporter.js.map +1 -0
- package/lib/deployment/deployment-state-summary.d.ts +38 -0
- package/lib/deployment/deployment-state-summary.js +209 -0
- package/lib/deployment/deployment-state-summary.js.map +1 -0
- package/lib/deployment/deployment-status-service.d.ts +36 -0
- package/lib/deployment/deployment-status-service.js +128 -0
- package/lib/deployment/deployment-status-service.js.map +1 -0
- package/lib/deployment/deployment-tracker.d.ts +42 -0
- package/lib/deployment/deployment-tracker.js +79 -0
- package/lib/deployment/deployment-tracker.js.map +1 -0
- package/lib/deployment/deployment-validation-service.d.ts +28 -0
- package/lib/deployment/deployment-validation-service.js +161 -0
- package/lib/deployment/deployment-validation-service.js.map +1 -0
- package/lib/deployment/retry-handler.d.ts +37 -0
- package/lib/deployment/retry-handler.js +86 -0
- package/lib/deployment/retry-handler.js.map +1 -0
- package/lib/deployment/sf-cli-integration.d.ts +42 -0
- package/lib/deployment/sf-cli-integration.js +105 -0
- package/lib/deployment/sf-cli-integration.js.map +1 -0
- package/lib/deployment/state-manager.d.ts +61 -0
- package/lib/deployment/state-manager.js +83 -0
- package/lib/deployment/state-manager.js.map +1 -0
- package/lib/deployment/test-executor.d.ts +41 -0
- package/lib/deployment/test-executor.js +87 -0
- package/lib/deployment/test-executor.js.map +1 -0
- package/lib/errors/base-error.d.ts +24 -0
- package/lib/errors/base-error.js +66 -0
- package/lib/errors/base-error.js.map +1 -0
- package/lib/errors/dependency-error.d.ts +37 -0
- package/lib/errors/dependency-error.js +76 -0
- package/lib/errors/dependency-error.js.map +1 -0
- package/lib/errors/deployment-error.d.ts +55 -0
- package/lib/errors/deployment-error.js +132 -0
- package/lib/errors/deployment-error.js.map +1 -0
- package/lib/errors/index.d.ts +45 -0
- package/lib/errors/index.js +71 -0
- package/lib/errors/index.js.map +1 -0
- package/lib/errors/network-error.d.ts +53 -0
- package/lib/errors/network-error.js +111 -0
- package/lib/errors/network-error.js.map +1 -0
- package/lib/errors/parsing-error.d.ts +41 -0
- package/lib/errors/parsing-error.js +69 -0
- package/lib/errors/parsing-error.js.map +1 -0
- package/lib/errors/validation-error-reporter.d.ts +34 -0
- package/lib/errors/validation-error-reporter.js +99 -0
- package/lib/errors/validation-error-reporter.js.map +1 -0
- package/lib/errors/validation-error.d.ts +58 -0
- package/lib/errors/validation-error.js +131 -0
- package/lib/errors/validation-error.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/monitoring/performance-monitor.d.ts +98 -0
- package/lib/monitoring/performance-monitor.js +260 -0
- package/lib/monitoring/performance-monitor.js.map +1 -0
- package/lib/parsers/apex-class-parser.d.ts +47 -0
- package/lib/parsers/apex-class-parser.js +368 -0
- package/lib/parsers/apex-class-parser.js.map +1 -0
- package/lib/parsers/apex-trigger-parser.d.ts +48 -0
- package/lib/parsers/apex-trigger-parser.js +229 -0
- package/lib/parsers/apex-trigger-parser.js.map +1 -0
- package/lib/parsers/aura-parser.d.ts +55 -0
- package/lib/parsers/aura-parser.js +229 -0
- package/lib/parsers/aura-parser.js.map +1 -0
- package/lib/parsers/bot-parser.d.ts +65 -0
- package/lib/parsers/bot-parser.js +225 -0
- package/lib/parsers/bot-parser.js.map +1 -0
- package/lib/parsers/custom-metadata-parser.d.ts +94 -0
- package/lib/parsers/custom-metadata-parser.js +199 -0
- package/lib/parsers/custom-metadata-parser.js.map +1 -0
- package/lib/parsers/custom-object-parser.d.ts +62 -0
- package/lib/parsers/custom-object-parser.js +297 -0
- package/lib/parsers/custom-object-parser.js.map +1 -0
- package/lib/parsers/email-template-parser.d.ts +64 -0
- package/lib/parsers/email-template-parser.js +238 -0
- package/lib/parsers/email-template-parser.js.map +1 -0
- package/lib/parsers/error-resilient-parser.d.ts +110 -0
- package/lib/parsers/error-resilient-parser.js +277 -0
- package/lib/parsers/error-resilient-parser.js.map +1 -0
- package/lib/parsers/flexipage-parser.d.ts +64 -0
- package/lib/parsers/flexipage-parser.js +196 -0
- package/lib/parsers/flexipage-parser.js.map +1 -0
- package/lib/parsers/flow-parser.d.ts +54 -0
- package/lib/parsers/flow-parser.js +287 -0
- package/lib/parsers/flow-parser.js.map +1 -0
- package/lib/parsers/genai-prompt-parser.d.ts +67 -0
- package/lib/parsers/genai-prompt-parser.js +160 -0
- package/lib/parsers/genai-prompt-parser.js.map +1 -0
- package/lib/parsers/layout-parser.d.ts +64 -0
- package/lib/parsers/layout-parser.js +267 -0
- package/lib/parsers/layout-parser.js.map +1 -0
- package/lib/parsers/lwc-parser.d.ts +60 -0
- package/lib/parsers/lwc-parser.js +264 -0
- package/lib/parsers/lwc-parser.js.map +1 -0
- package/lib/parsers/permission-set-parser.d.ts +86 -0
- package/lib/parsers/permission-set-parser.js +152 -0
- package/lib/parsers/permission-set-parser.js.map +1 -0
- package/lib/parsers/profile-parser.d.ts +81 -0
- package/lib/parsers/profile-parser.js +141 -0
- package/lib/parsers/profile-parser.js.map +1 -0
- package/lib/parsers/visualforce-parser.d.ts +47 -0
- package/lib/parsers/visualforce-parser.js +180 -0
- package/lib/parsers/visualforce-parser.js.map +1 -0
- package/lib/provisioning/data-provisioner.d.ts +88 -0
- package/lib/provisioning/data-provisioner.js +257 -0
- package/lib/provisioning/data-provisioner.js.map +1 -0
- package/lib/scanner/custom-structure-scanner.d.ts +66 -0
- package/lib/scanner/custom-structure-scanner.js +229 -0
- package/lib/scanner/custom-structure-scanner.js.map +1 -0
- package/lib/scanner/forceignore-parser.d.ts +69 -0
- package/lib/scanner/forceignore-parser.js +195 -0
- package/lib/scanner/forceignore-parser.js.map +1 -0
- package/lib/scanner/metadata-format-scanner.d.ts +77 -0
- package/lib/scanner/metadata-format-scanner.js +282 -0
- package/lib/scanner/metadata-format-scanner.js.map +1 -0
- package/lib/scanner/monorepo-scanner.d.ts +71 -0
- package/lib/scanner/monorepo-scanner.js +225 -0
- package/lib/scanner/monorepo-scanner.js.map +1 -0
- package/lib/scanner/project-validator.d.ts +55 -0
- package/lib/scanner/project-validator.js +235 -0
- package/lib/scanner/project-validator.js.map +1 -0
- package/lib/scanner/sfdx-project-detector.d.ts +86 -0
- package/lib/scanner/sfdx-project-detector.js +240 -0
- package/lib/scanner/sfdx-project-detector.js.map +1 -0
- package/lib/scanner/structure-validator.d.ts +64 -0
- package/lib/scanner/structure-validator.js +296 -0
- package/lib/scanner/structure-validator.js.map +1 -0
- package/lib/services/metadata-scanner-service.d.ts +64 -0
- package/lib/services/metadata-scanner-service.js +651 -0
- package/lib/services/metadata-scanner-service.js.map +1 -0
- package/lib/types/agentforce.d.ts +157 -0
- package/lib/types/agentforce.js +2 -0
- package/lib/types/agentforce.js.map +1 -0
- package/lib/types/dependency.d.ts +98 -0
- package/lib/types/dependency.js +5 -0
- package/lib/types/dependency.js.map +1 -0
- package/lib/types/deployment-plan.d.ts +81 -0
- package/lib/types/deployment-plan.js +6 -0
- package/lib/types/deployment-plan.js.map +1 -0
- package/lib/types/deployment.d.ts +88 -0
- package/lib/types/deployment.js +5 -0
- package/lib/types/deployment.js.map +1 -0
- package/lib/types/graph.d.ts +35 -0
- package/lib/types/graph.js +5 -0
- package/lib/types/graph.js.map +1 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/index.js +17 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/metadata.d.ts +101 -0
- package/lib/types/metadata.js +13 -0
- package/lib/types/metadata.js.map +1 -0
- package/lib/types/project.d.ts +156 -0
- package/lib/types/project.js +56 -0
- package/lib/types/project.js.map +1 -0
- package/lib/types/salesforce/apex.d.ts +94 -0
- package/lib/types/salesforce/apex.js +6 -0
- package/lib/types/salesforce/apex.js.map +1 -0
- package/lib/types/salesforce/aura.d.ts +150 -0
- package/lib/types/salesforce/aura.js +6 -0
- package/lib/types/salesforce/aura.js.map +1 -0
- package/lib/types/salesforce/bot.d.ts +293 -0
- package/lib/types/salesforce/bot.js +6 -0
- package/lib/types/salesforce/bot.js.map +1 -0
- package/lib/types/salesforce/common.d.ts +15 -0
- package/lib/types/salesforce/common.js +5 -0
- package/lib/types/salesforce/common.js.map +1 -0
- package/lib/types/salesforce/custom-metadata.d.ts +92 -0
- package/lib/types/salesforce/custom-metadata.js +6 -0
- package/lib/types/salesforce/custom-metadata.js.map +1 -0
- package/lib/types/salesforce/email.d.ts +56 -0
- package/lib/types/salesforce/email.js +6 -0
- package/lib/types/salesforce/email.js.map +1 -0
- package/lib/types/salesforce/flexipage.d.ts +149 -0
- package/lib/types/salesforce/flexipage.js +6 -0
- package/lib/types/salesforce/flexipage.js.map +1 -0
- package/lib/types/salesforce/flow.d.ts +516 -0
- package/lib/types/salesforce/flow.js +6 -0
- package/lib/types/salesforce/flow.js.map +1 -0
- package/lib/types/salesforce/genai.d.ts +67 -0
- package/lib/types/salesforce/genai.js +6 -0
- package/lib/types/salesforce/genai.js.map +1 -0
- package/lib/types/salesforce/index.d.ts +27 -0
- package/lib/types/salesforce/index.js +43 -0
- package/lib/types/salesforce/index.js.map +1 -0
- package/lib/types/salesforce/layout.d.ts +236 -0
- package/lib/types/salesforce/layout.js +6 -0
- package/lib/types/salesforce/layout.js.map +1 -0
- package/lib/types/salesforce/lwc.d.ts +123 -0
- package/lib/types/salesforce/lwc.js +6 -0
- package/lib/types/salesforce/lwc.js.map +1 -0
- package/lib/types/salesforce/object.d.ts +427 -0
- package/lib/types/salesforce/object.js +6 -0
- package/lib/types/salesforce/object.js.map +1 -0
- package/lib/types/salesforce/parser-types.d.ts +79 -0
- package/lib/types/salesforce/parser-types.js +80 -0
- package/lib/types/salesforce/parser-types.js.map +1 -0
- package/lib/types/salesforce/permission.d.ts +289 -0
- package/lib/types/salesforce/permission.js +6 -0
- package/lib/types/salesforce/permission.js.map +1 -0
- package/lib/types/salesforce/resource.d.ts +93 -0
- package/lib/types/salesforce/resource.js +6 -0
- package/lib/types/salesforce/resource.js.map +1 -0
- package/lib/types/salesforce/visualforce.d.ts +70 -0
- package/lib/types/salesforce/visualforce.js +6 -0
- package/lib/types/salesforce/visualforce.js.map +1 -0
- package/lib/utils/cache-manager.d.ts +158 -0
- package/lib/utils/cache-manager.js +429 -0
- package/lib/utils/cache-manager.js.map +1 -0
- package/lib/utils/deployment-plan-manager.d.ts +40 -0
- package/lib/utils/deployment-plan-manager.js +183 -0
- package/lib/utils/deployment-plan-manager.js.map +1 -0
- package/lib/utils/error-aggregator.d.ts +117 -0
- package/lib/utils/error-aggregator.js +268 -0
- package/lib/utils/error-aggregator.js.map +1 -0
- package/lib/utils/file-system.d.ts +62 -0
- package/lib/utils/file-system.js +167 -0
- package/lib/utils/file-system.js.map +1 -0
- package/lib/utils/functional.d.ts +52 -0
- package/lib/utils/functional.js +61 -0
- package/lib/utils/functional.js.map +1 -0
- package/lib/utils/graph-algorithms.d.ts +53 -0
- package/lib/utils/graph-algorithms.js +177 -0
- package/lib/utils/graph-algorithms.js.map +1 -0
- package/lib/utils/logger.d.ts +154 -0
- package/lib/utils/logger.js +327 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/network-handler.d.ts +64 -0
- package/lib/utils/network-handler.js +147 -0
- package/lib/utils/network-handler.js.map +1 -0
- package/lib/utils/performance.d.ts +148 -0
- package/lib/utils/performance.js +294 -0
- package/lib/utils/performance.js.map +1 -0
- package/lib/utils/string.d.ts +197 -0
- package/lib/utils/string.js +331 -0
- package/lib/utils/string.js.map +1 -0
- package/lib/utils/xml.d.ts +97 -0
- package/lib/utils/xml.js +227 -0
- package/lib/utils/xml.js.map +1 -0
- package/lib/validators/xml-metadata-validator.d.ts +106 -0
- package/lib/validators/xml-metadata-validator.js +509 -0
- package/lib/validators/xml-metadata-validator.js.map +1 -0
- package/lib/waves/priority-wave-generator-ai.d.ts +85 -0
- package/lib/waves/priority-wave-generator-ai.js +191 -0
- package/lib/waves/priority-wave-generator-ai.js.map +1 -0
- package/lib/waves/priority-wave-generator.d.ts +47 -0
- package/lib/waves/priority-wave-generator.js +88 -0
- package/lib/waves/priority-wave-generator.js.map +1 -0
- package/lib/waves/test-optimizer.d.ts +155 -0
- package/lib/waves/test-optimizer.js +290 -0
- package/lib/waves/test-optimizer.js.map +1 -0
- package/lib/waves/wave-builder.d.ts +147 -0
- package/lib/waves/wave-builder.js +286 -0
- package/lib/waves/wave-builder.js.map +1 -0
- package/lib/waves/wave-diff-generator.d.ts +17 -0
- package/lib/waves/wave-diff-generator.js +6 -0
- package/lib/waves/wave-diff-generator.js.map +1 -0
- package/lib/waves/wave-executor.d.ts +33 -0
- package/lib/waves/wave-executor.js +50 -0
- package/lib/waves/wave-executor.js.map +1 -0
- package/lib/waves/wave-merger.d.ts +96 -0
- package/lib/waves/wave-merger.js +181 -0
- package/lib/waves/wave-merger.js.map +1 -0
- package/lib/waves/wave-metadata-generator.d.ts +13 -0
- package/lib/waves/wave-metadata-generator.js +12 -0
- package/lib/waves/wave-metadata-generator.js.map +1 -0
- package/lib/waves/wave-splitter.d.ts +154 -0
- package/lib/waves/wave-splitter.js +307 -0
- package/lib/waves/wave-splitter.js.map +1 -0
- package/lib/waves/wave-validator.d.ts +17 -0
- package/lib/waves/wave-validator.js +15 -0
- package/lib/waves/wave-validator.js.map +1 -0
- package/messages/analyze.json +18 -0
- package/messages/config.json +29 -0
- package/messages/resume.json +9 -0
- package/messages/start.json +24 -0
- package/messages/status.json +8 -0
- package/messages/validate.json +9 -0
- package/npm-shrinkwrap.json +25676 -0
- package/oclif.lock +11988 -0
- package/oclif.manifest.json +589 -0
- package/package.json +224 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Execution Management - US-087
|
|
3
|
+
* Manages intelligent test execution per wave
|
|
4
|
+
*
|
|
5
|
+
* @ac US-087-AC-1: Run tests only in Apex waves
|
|
6
|
+
* @ac US-087-AC-2: Support RunLocalTests
|
|
7
|
+
* @ac US-087-AC-3: Support RunSpecifiedTests
|
|
8
|
+
* @ac US-087-AC-4: Support NoTestRun (sandbox)
|
|
9
|
+
* @ac US-087-AC-5: Track test results
|
|
10
|
+
* @ac US-087-AC-6: Report coverage
|
|
11
|
+
* @issue #87
|
|
12
|
+
*/
|
|
13
|
+
import { getLogger } from '../utils/logger.js';
|
|
14
|
+
const logger = getLogger('TestExecutor');
|
|
15
|
+
/**
|
|
16
|
+
* @ac US-087-AC-1: Run tests only in Apex waves
|
|
17
|
+
* @ac US-087-AC-2: Support RunLocalTests
|
|
18
|
+
* @ac US-087-AC-3: Support RunSpecifiedTests
|
|
19
|
+
* @ac US-087-AC-4: Support NoTestRun (sandbox)
|
|
20
|
+
*/
|
|
21
|
+
export class TestExecutor {
|
|
22
|
+
determineTestLevel(wave, isSandbox) {
|
|
23
|
+
// AC-1: Only run tests in Apex waves
|
|
24
|
+
const hasApex = wave.metadata.types.some((type) => type === 'ApexClass' || type === 'ApexTrigger');
|
|
25
|
+
// AC-4: No tests in sandbox
|
|
26
|
+
if (isSandbox) {
|
|
27
|
+
return {
|
|
28
|
+
testLevel: 'NoTestRun',
|
|
29
|
+
tests: [],
|
|
30
|
+
reason: 'Sandbox deployment - tests not required',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (!hasApex) {
|
|
34
|
+
return {
|
|
35
|
+
testLevel: 'NoTestRun',
|
|
36
|
+
tests: [],
|
|
37
|
+
reason: 'No Apex code in wave',
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
// AC-3: Run specified tests if available
|
|
41
|
+
const apexComponents = wave.components.filter((component) => component.startsWith('ApexClass:') || component.startsWith('ApexTrigger:'));
|
|
42
|
+
if (apexComponents.length > 0 && apexComponents.length <= 10) {
|
|
43
|
+
const tests = this.findRelatedTests(apexComponents);
|
|
44
|
+
if (tests.length > 0) {
|
|
45
|
+
return {
|
|
46
|
+
testLevel: 'RunSpecifiedTests',
|
|
47
|
+
tests,
|
|
48
|
+
reason: `Running ${tests.length} related tests`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// AC-2: Default to RunLocalTests
|
|
53
|
+
return {
|
|
54
|
+
testLevel: 'RunLocalTests',
|
|
55
|
+
tests: [],
|
|
56
|
+
reason: 'Running all local tests',
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
findRelatedTests(apexComponents) {
|
|
60
|
+
// Placeholder: In real implementation, this would analyze test classes
|
|
61
|
+
// and match them to the components being deployed
|
|
62
|
+
return apexComponents
|
|
63
|
+
.filter((component) => component.startsWith('ApexClass:'))
|
|
64
|
+
.map((component) => component.replace('ApexClass:', '') + 'Test');
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @ac US-087-AC-5: Track test results
|
|
68
|
+
* @ac US-087-AC-6: Report coverage
|
|
69
|
+
*/
|
|
70
|
+
analyzeTestResults(testsRun, testFailures, coverage) {
|
|
71
|
+
logger.info('Analyzing test results', { testsRun, testFailures, coverage });
|
|
72
|
+
return {
|
|
73
|
+
testsRun,
|
|
74
|
+
testFailures,
|
|
75
|
+
coverage,
|
|
76
|
+
failedTests: [], // Would be populated from actual results
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
formatTestResults(results) {
|
|
80
|
+
const lines = [`Tests Run: ${results.testsRun}`, `Failures: ${results.testFailures}`];
|
|
81
|
+
if (results.coverage !== undefined) {
|
|
82
|
+
lines.push(`Coverage: ${results.coverage}%`);
|
|
83
|
+
}
|
|
84
|
+
return lines.join(' | ');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=test-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-executor.js","sourceRoot":"","sources":["../../src/deployment/test-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,MAAM,MAAM,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC;AAezC;;;;;GAKG;AACH,MAAM,OAAO,YAAY;IAChB,kBAAkB,CAAC,IAAU,EAAE,SAAkB;QACtD,qCAAqC;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,aAAa,CAAC,CAAC;QAEnG,4BAA4B;QA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M,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,kBAAkB,CAAC,QAAgB,EAAE,YAAoB,EAAE,QAAiB;QACjF,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE5E,OAAO;YACL,QAAQ;YACR,YAAY;YACZ,QAAQ;YACR,WAAW,EAAE,EAAE,EAAE,yCAAyC;SAC3D,CAAC;IACJ,CAAC;IAEM,iBAAiB,CAAC,OAAoB;QAC3C,MAAM,KAAK,GAAG,CAAC,cAAc,OAAO,CAAC,QAAQ,EAAE,EAAE,aAAa,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;QAEtF,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,aAAa,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base custom error class with context and suggestions
|
|
3
|
+
*
|
|
4
|
+
* All plugin errors extend this base class to provide:
|
|
5
|
+
* - Structured error context
|
|
6
|
+
* - Actionable suggestions
|
|
7
|
+
* - JSON serialization
|
|
8
|
+
* - Stack trace preservation
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class SmartDeploymentError extends Error {
|
|
11
|
+
readonly code: string;
|
|
12
|
+
readonly context: Record<string, unknown>;
|
|
13
|
+
readonly suggestions: string[];
|
|
14
|
+
readonly timestamp: Date;
|
|
15
|
+
constructor(message: string, code: string, context?: Record<string, unknown>, suggestions?: string[]);
|
|
16
|
+
/**
|
|
17
|
+
* Serialize error to JSON for logging/reporting
|
|
18
|
+
*/
|
|
19
|
+
toJSON(): Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Format error for display to user
|
|
22
|
+
*/
|
|
23
|
+
toString(): string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base custom error class with context and suggestions
|
|
3
|
+
*
|
|
4
|
+
* All plugin errors extend this base class to provide:
|
|
5
|
+
* - Structured error context
|
|
6
|
+
* - Actionable suggestions
|
|
7
|
+
* - JSON serialization
|
|
8
|
+
* - Stack trace preservation
|
|
9
|
+
*/
|
|
10
|
+
export class SmartDeploymentError extends Error {
|
|
11
|
+
code;
|
|
12
|
+
context;
|
|
13
|
+
suggestions;
|
|
14
|
+
timestamp;
|
|
15
|
+
constructor(message, code, context = {}, suggestions = []) {
|
|
16
|
+
super(message);
|
|
17
|
+
// Maintain proper stack trace (V8 engines)
|
|
18
|
+
if (Error.captureStackTrace) {
|
|
19
|
+
Error.captureStackTrace(this, this.constructor);
|
|
20
|
+
}
|
|
21
|
+
this.name = this.constructor.name;
|
|
22
|
+
this.code = code;
|
|
23
|
+
this.context = context;
|
|
24
|
+
this.suggestions = suggestions;
|
|
25
|
+
this.timestamp = new Date();
|
|
26
|
+
// Ensure instanceof works correctly
|
|
27
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Serialize error to JSON for logging/reporting
|
|
31
|
+
*/
|
|
32
|
+
toJSON() {
|
|
33
|
+
return {
|
|
34
|
+
name: this.name,
|
|
35
|
+
code: this.code,
|
|
36
|
+
message: this.message,
|
|
37
|
+
context: this.context,
|
|
38
|
+
suggestions: this.suggestions,
|
|
39
|
+
timestamp: this.timestamp.toISOString(),
|
|
40
|
+
stack: this.stack,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Format error for display to user
|
|
45
|
+
*/
|
|
46
|
+
toString() {
|
|
47
|
+
const lines = [`${this.name} [${this.code}]: ${this.message}`, ''];
|
|
48
|
+
// Add context if present
|
|
49
|
+
if (Object.keys(this.context).length > 0) {
|
|
50
|
+
lines.push('Context:');
|
|
51
|
+
for (const [key, value] of Object.entries(this.context)) {
|
|
52
|
+
lines.push(` ${key}: ${JSON.stringify(value)}`);
|
|
53
|
+
}
|
|
54
|
+
lines.push('');
|
|
55
|
+
}
|
|
56
|
+
// Add suggestions if present
|
|
57
|
+
if (this.suggestions.length > 0) {
|
|
58
|
+
lines.push('Suggestions:');
|
|
59
|
+
for (const suggestion of this.suggestions) {
|
|
60
|
+
lines.push(` • ${suggestion}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return lines.join('\n');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=base-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-error.js","sourceRoot":"","sources":["../../src/errors/base-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,OAAgB,oBAAqB,SAAQ,KAAK;IACtC,IAAI,CAAS;IACb,OAAO,CAA0B;IACjC,WAAW,CAAW;IACtB,SAAS,CAAO;IAEhC,YAAmB,OAAe,EAAE,IAAY,EAAE,UAAmC,EAAE,EAAE,cAAwB,EAAE;QACjH,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,2CAA2C;QAC3C,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAE5B,oCAAoC;QACpC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CA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,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SmartDeploymentError } from './base-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when dependency analysis or resolution fails
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* throw new DependencyError('Circular dependency detected', {
|
|
8
|
+
* cycle: ['ApexClass:A', 'ApexClass:B', 'ApexClass:C', 'ApexClass:A'],
|
|
9
|
+
* affectedComponents: 3
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare class DependencyError extends SmartDeploymentError {
|
|
14
|
+
constructor(message: string, context?: Record<string, unknown>);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Error thrown when circular dependencies are detected
|
|
18
|
+
*/
|
|
19
|
+
export declare class CircularDependencyError extends DependencyError {
|
|
20
|
+
constructor(cycle: string[], context?: Record<string, unknown>);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Error thrown when a required dependency is missing
|
|
24
|
+
*/
|
|
25
|
+
export declare class MissingDependencyError extends DependencyError {
|
|
26
|
+
constructor(component: string, missingDependency: string, context?: Record<string, unknown>);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Error thrown when dependency graph is too complex
|
|
30
|
+
*/
|
|
31
|
+
export declare class DependencyComplexityError extends DependencyError {
|
|
32
|
+
constructor(message: string, context?: {
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
totalComponents?: number;
|
|
35
|
+
maxDepth?: number;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { SmartDeploymentError } from './base-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when dependency analysis or resolution fails
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* throw new DependencyError('Circular dependency detected', {
|
|
8
|
+
* cycle: ['ApexClass:A', 'ApexClass:B', 'ApexClass:C', 'ApexClass:A'],
|
|
9
|
+
* affectedComponents: 3
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export class DependencyError extends SmartDeploymentError {
|
|
14
|
+
constructor(message, context = {}) {
|
|
15
|
+
const suggestions = [];
|
|
16
|
+
// Add context-specific suggestions
|
|
17
|
+
if (context.cycle) {
|
|
18
|
+
suggestions.push('Break the circular dependency by refactoring shared logic');
|
|
19
|
+
suggestions.push('Consider using dependency injection or interfaces');
|
|
20
|
+
}
|
|
21
|
+
if (context.missingDependency) {
|
|
22
|
+
suggestions.push(`Add missing dependency: ${String(context.missingDependency)}`);
|
|
23
|
+
suggestions.push('Check if the component exists in your project');
|
|
24
|
+
}
|
|
25
|
+
if (context.affectedComponents) {
|
|
26
|
+
suggestions.push(`Review ${String(context.affectedComponents)} affected components`);
|
|
27
|
+
}
|
|
28
|
+
super(message, 'DEPENDENCY_ERROR', context, suggestions);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Error thrown when circular dependencies are detected
|
|
33
|
+
*/
|
|
34
|
+
export class CircularDependencyError extends DependencyError {
|
|
35
|
+
constructor(cycle, context = {}) {
|
|
36
|
+
super(`Circular dependency detected: ${cycle.join(' → ')}`, {
|
|
37
|
+
...context,
|
|
38
|
+
cycle,
|
|
39
|
+
cycleLength: cycle.length,
|
|
40
|
+
});
|
|
41
|
+
this.suggestions.push('Visualize the dependency graph to identify the cycle');
|
|
42
|
+
this.suggestions.push('Extract shared code into a common utility');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Error thrown when a required dependency is missing
|
|
47
|
+
*/
|
|
48
|
+
export class MissingDependencyError extends DependencyError {
|
|
49
|
+
constructor(component, missingDependency, context = {}) {
|
|
50
|
+
super(`Component '${component}' depends on missing '${missingDependency}'`, {
|
|
51
|
+
...context,
|
|
52
|
+
component,
|
|
53
|
+
missingDependency,
|
|
54
|
+
});
|
|
55
|
+
this.suggestions.push(`Include '${missingDependency}' in your deployment`);
|
|
56
|
+
this.suggestions.push('Check if the dependency was deleted or renamed');
|
|
57
|
+
this.suggestions.push('Verify metadata type spelling and casing');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Error thrown when dependency graph is too complex
|
|
62
|
+
*/
|
|
63
|
+
export class DependencyComplexityError extends DependencyError {
|
|
64
|
+
constructor(message, context = {}) {
|
|
65
|
+
super(message, context);
|
|
66
|
+
if (context.maxDepth && context.maxDepth > 50) {
|
|
67
|
+
this.suggestions.push('Dependency depth > 50 indicates over-coupling');
|
|
68
|
+
this.suggestions.push('Refactor to reduce dependency chains');
|
|
69
|
+
}
|
|
70
|
+
if (context.totalComponents && context.totalComponents > 10_000) {
|
|
71
|
+
this.suggestions.push('Consider splitting into multiple deployments');
|
|
72
|
+
this.suggestions.push('Use selective deployment for changed components only');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=dependency-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-error.js","sourceRoot":"","sources":["../../src/errors/dependency-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eAAgB,SAAQ,oBAAoB;IACvD,YAAmB,OAAe,EAAE,UAAmC,EAAE;QACvE,MAAM,WAAW,GAAa,EAAE,CAAC;QAEjC,mCAAmC;QACnC,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,WAAW,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;YAC9E,WAAW,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QACxE,CAAC;QAED,IAAI,OAAO,C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0C,CAAC,CAAC;IACpE,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,eAAe;IAC5D,YACE,OAAe,EACf,UAII,EAAE;QAEN,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,GAAG,EAAE,EAAE,CAAC;YAC9C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YACvE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,GAAG,MAAM,EAAE,CAAC;YAChE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YACtE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { SmartDeploymentError } from './base-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when Salesforce deployment fails
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* throw new DeploymentError('Deployment failed due to test failures', {
|
|
8
|
+
* deploymentId: '0Af...',
|
|
9
|
+
* failedTests: ['AccountServiceTest.testInsert'],
|
|
10
|
+
* testCoverage: 68
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare class DeploymentError extends SmartDeploymentError {
|
|
15
|
+
constructor(message: string, context?: Record<string, unknown>);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Error thrown when deployment validation fails
|
|
19
|
+
*/
|
|
20
|
+
export declare class DeploymentValidationError extends DeploymentError {
|
|
21
|
+
constructor(message: string, context?: Record<string, unknown>);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown when test execution fails during deployment
|
|
25
|
+
*/
|
|
26
|
+
export declare class TestFailureError extends DeploymentError {
|
|
27
|
+
constructor(failedTests: string[], context?: {
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
totalTests?: number;
|
|
30
|
+
passedTests?: number;
|
|
31
|
+
testCoverage?: number;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Error thrown when deployment times out
|
|
36
|
+
*/
|
|
37
|
+
export declare class DeploymentTimeoutError extends DeploymentError {
|
|
38
|
+
constructor(timeoutMs: number, context?: Record<string, unknown>);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Error thrown when deployment exceeds Salesforce limits
|
|
42
|
+
*/
|
|
43
|
+
export declare class DeploymentLimitError extends DeploymentError {
|
|
44
|
+
constructor(limitType: 'files' | 'size' | 'components', limit: number, actual: number, context?: Record<string, unknown>);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Error thrown when Salesforce API returns an error
|
|
48
|
+
*/
|
|
49
|
+
export declare class SalesforceApiError extends DeploymentError {
|
|
50
|
+
constructor(apiError: string, context?: {
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
statusCode?: number;
|
|
53
|
+
errorCode?: string;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { SmartDeploymentError } from './base-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when Salesforce deployment fails
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* throw new DeploymentError('Deployment failed due to test failures', {
|
|
8
|
+
* deploymentId: '0Af...',
|
|
9
|
+
* failedTests: ['AccountServiceTest.testInsert'],
|
|
10
|
+
* testCoverage: 68
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export class DeploymentError extends SmartDeploymentError {
|
|
15
|
+
constructor(message, context = {}) {
|
|
16
|
+
const suggestions = [];
|
|
17
|
+
// Add context-specific suggestions
|
|
18
|
+
if (context.deploymentId) {
|
|
19
|
+
suggestions.push(`Check deployment status: sf project deploy report -i ${String(context.deploymentId)}`);
|
|
20
|
+
}
|
|
21
|
+
if (context.failedTests) {
|
|
22
|
+
suggestions.push('Review and fix failing test classes');
|
|
23
|
+
suggestions.push('Run tests locally: sf apex run test');
|
|
24
|
+
}
|
|
25
|
+
if (context.testCoverage && typeof context.testCoverage === 'number' && context.testCoverage < 75) {
|
|
26
|
+
suggestions.push('Increase test coverage to at least 75%');
|
|
27
|
+
suggestions.push('Add test methods for untested code paths');
|
|
28
|
+
}
|
|
29
|
+
if (context.componentFailures) {
|
|
30
|
+
suggestions.push('Review component-specific errors in the deployment report');
|
|
31
|
+
}
|
|
32
|
+
super(message, 'DEPLOYMENT_ERROR', context, suggestions);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Error thrown when deployment validation fails
|
|
37
|
+
*/
|
|
38
|
+
export class DeploymentValidationError extends DeploymentError {
|
|
39
|
+
constructor(message, context = {}) {
|
|
40
|
+
super(`Deployment validation failed: ${message}`, {
|
|
41
|
+
...context,
|
|
42
|
+
validationError: true,
|
|
43
|
+
});
|
|
44
|
+
this.suggestions.push('Run validation before deploying: sf project deploy validate');
|
|
45
|
+
this.suggestions.push('Fix validation errors and retry');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Error thrown when test execution fails during deployment
|
|
50
|
+
*/
|
|
51
|
+
export class TestFailureError extends DeploymentError {
|
|
52
|
+
constructor(failedTests, context = {}) {
|
|
53
|
+
super(`${failedTests.length} test(s) failed`, {
|
|
54
|
+
...context,
|
|
55
|
+
failedTests,
|
|
56
|
+
});
|
|
57
|
+
this.suggestions.push('Review failed test methods:');
|
|
58
|
+
for (const test of failedTests.slice(0, 5)) {
|
|
59
|
+
// Show max 5
|
|
60
|
+
this.suggestions.push(` - ${test}`);
|
|
61
|
+
}
|
|
62
|
+
if (failedTests.length > 5) {
|
|
63
|
+
this.suggestions.push(` ... and ${failedTests.length - 5} more`);
|
|
64
|
+
}
|
|
65
|
+
this.suggestions.push('Run failed tests locally to debug');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Error thrown when deployment times out
|
|
70
|
+
*/
|
|
71
|
+
export class DeploymentTimeoutError extends DeploymentError {
|
|
72
|
+
constructor(timeoutMs, context = {}) {
|
|
73
|
+
super(`Deployment timed out after ${timeoutMs}ms`, {
|
|
74
|
+
...context,
|
|
75
|
+
timeoutMs,
|
|
76
|
+
});
|
|
77
|
+
this.suggestions.push('Large deployments may exceed timeout limits');
|
|
78
|
+
this.suggestions.push('Consider splitting into smaller waves');
|
|
79
|
+
this.suggestions.push('Increase timeout if appropriate for your org');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Error thrown when deployment exceeds Salesforce limits
|
|
84
|
+
*/
|
|
85
|
+
export class DeploymentLimitError extends DeploymentError {
|
|
86
|
+
constructor(limitType, limit, actual, context = {}) {
|
|
87
|
+
super(`Deployment exceeds ${limitType} limit: ${actual} > ${limit}`, {
|
|
88
|
+
...context,
|
|
89
|
+
limitType,
|
|
90
|
+
limit,
|
|
91
|
+
actual,
|
|
92
|
+
});
|
|
93
|
+
if (limitType === 'files') {
|
|
94
|
+
this.suggestions.push('Split deployment to stay under 10,000 file limit');
|
|
95
|
+
}
|
|
96
|
+
if (limitType === 'size') {
|
|
97
|
+
this.suggestions.push('Reduce deployment size (max 39MB compressed)');
|
|
98
|
+
this.suggestions.push('Remove unnecessary static resources or large files');
|
|
99
|
+
}
|
|
100
|
+
if (limitType === 'components') {
|
|
101
|
+
this.suggestions.push('Deploy in multiple waves');
|
|
102
|
+
this.suggestions.push('Use smart-deployment wave generation');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Error thrown when Salesforce API returns an error
|
|
108
|
+
*/
|
|
109
|
+
export class SalesforceApiError extends DeploymentError {
|
|
110
|
+
constructor(apiError, context = {}) {
|
|
111
|
+
super(`Salesforce API error: ${apiError}`, {
|
|
112
|
+
...context,
|
|
113
|
+
apiError,
|
|
114
|
+
});
|
|
115
|
+
if (context.statusCode === 401) {
|
|
116
|
+
this.suggestions.push('Authentication failed - check your credentials');
|
|
117
|
+
this.suggestions.push('Run: sf org login web');
|
|
118
|
+
}
|
|
119
|
+
if (context.statusCode === 403) {
|
|
120
|
+
this.suggestions.push('Insufficient permissions - check user permissions');
|
|
121
|
+
}
|
|
122
|
+
if (context.statusCode === 429) {
|
|
123
|
+
this.suggestions.push('API rate limit exceeded - wait and retry');
|
|
124
|
+
this.suggestions.push('Reduce concurrent API calls');
|
|
125
|
+
}
|
|
126
|
+
if (context.statusCode && context.statusCode >= 500) {
|
|
127
|
+
this.suggestions.push('Salesforce server error - retry later');
|
|
128
|
+
this.suggestions.push('Check Salesforce status: https://status.salesforce.com');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=deployment-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-error.js","sourceRoot":"","sources":["../../src/errors/deployment-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,eAAgB,SAAQ,oBAAoB;IACvD,YAAmB,OAAe,EAAE,UAAmC,EAAE;QACvE,MAAM,WAAW,GAAa,EAAE,CAAC;QAEjC,mCAAmC;QACnC,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACzB,WAAW,CAAC,IAAI,CAAC,wDAAwD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC3G,CAAC;QAED,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YAC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|
|
3
|
+
*
|
|
4
|
+
* All errors extend SmartDeploymentError and provide:
|
|
5
|
+
* - Error codes for programmatic handling
|
|
6
|
+
* - Contextual information about the failure
|
|
7
|
+
* - Actionable suggestions for resolution
|
|
8
|
+
* - JSON serialization for logging
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { ParsingError, DeploymentError } from './errors/index.js';
|
|
13
|
+
*
|
|
14
|
+
* try {
|
|
15
|
+
* await parseXml(file);
|
|
16
|
+
* } catch (error) {
|
|
17
|
+
* throw new ParsingError('Failed to parse XML', {
|
|
18
|
+
* filePath: file,
|
|
19
|
+
* originalError: error.message
|
|
20
|
+
* });
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
import { SmartDeploymentError as BaseError } from './base-error.js';
|
|
25
|
+
export { SmartDeploymentError } from './base-error.js';
|
|
26
|
+
export { ParsingError, XmlParsingError, JsonParsingError, ProjectStructureError } from './parsing-error.js';
|
|
27
|
+
export { DependencyError, CircularDependencyError, MissingDependencyError, DependencyComplexityError, } from './dependency-error.js';
|
|
28
|
+
export { DeploymentError, DeploymentValidationError, TestFailureError, DeploymentTimeoutError, DeploymentLimitError, SalesforceApiError, } from './deployment-error.js';
|
|
29
|
+
export { ValidationError, ConfigurationError, ApiVersionError, UnknownMetadataTypeError, ComponentCountError, MissingMetadataError, FileNotFoundError, PermissionError, } from './validation-error.js';
|
|
30
|
+
/**
|
|
31
|
+
* Type guard to check if error is a SmartDeploymentError
|
|
32
|
+
*/
|
|
33
|
+
export declare function isSmartDeploymentError(error: unknown): error is BaseError;
|
|
34
|
+
/**
|
|
35
|
+
* Extract error message safely from unknown error
|
|
36
|
+
*/
|
|
37
|
+
export declare function getErrorMessage(error: unknown): string;
|
|
38
|
+
/**
|
|
39
|
+
* Extract error context safely
|
|
40
|
+
*/
|
|
41
|
+
export declare function getErrorContext(error: unknown): Record<string, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* Get suggestions from error if available
|
|
44
|
+
*/
|
|
45
|
+
export declare function getErrorSuggestions(error: unknown): string[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Error Types for Smart Deployment Plugin
|
|
3
|
+
*
|
|
4
|
+
* All errors extend SmartDeploymentError and provide:
|
|
5
|
+
* - Error codes for programmatic handling
|
|
6
|
+
* - Contextual information about the failure
|
|
7
|
+
* - Actionable suggestions for resolution
|
|
8
|
+
* - JSON serialization for logging
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { ParsingError, DeploymentError } from './errors/index.js';
|
|
13
|
+
*
|
|
14
|
+
* try {
|
|
15
|
+
* await parseXml(file);
|
|
16
|
+
* } catch (error) {
|
|
17
|
+
* throw new ParsingError('Failed to parse XML', {
|
|
18
|
+
* filePath: file,
|
|
19
|
+
* originalError: error.message
|
|
20
|
+
* });
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
// Base error
|
|
25
|
+
import { SmartDeploymentError as BaseError } from './base-error.js';
|
|
26
|
+
export { SmartDeploymentError } from './base-error.js';
|
|
27
|
+
// Parsing errors
|
|
28
|
+
export { ParsingError, XmlParsingError, JsonParsingError, ProjectStructureError } from './parsing-error.js';
|
|
29
|
+
// Dependency errors
|
|
30
|
+
export { DependencyError, CircularDependencyError, MissingDependencyError, DependencyComplexityError, } from './dependency-error.js';
|
|
31
|
+
// Deployment errors
|
|
32
|
+
export { DeploymentError, DeploymentValidationError, TestFailureError, DeploymentTimeoutError, DeploymentLimitError, SalesforceApiError, } from './deployment-error.js';
|
|
33
|
+
// Validation errors
|
|
34
|
+
export { ValidationError, ConfigurationError, ApiVersionError, UnknownMetadataTypeError, ComponentCountError, MissingMetadataError, FileNotFoundError, PermissionError, } from './validation-error.js';
|
|
35
|
+
/**
|
|
36
|
+
* Type guard to check if error is a SmartDeploymentError
|
|
37
|
+
*/
|
|
38
|
+
export function isSmartDeploymentError(error) {
|
|
39
|
+
return error instanceof BaseError;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Extract error message safely from unknown error
|
|
43
|
+
*/
|
|
44
|
+
export function getErrorMessage(error) {
|
|
45
|
+
if (error instanceof Error) {
|
|
46
|
+
return error.message;
|
|
47
|
+
}
|
|
48
|
+
if (typeof error === 'string') {
|
|
49
|
+
return error;
|
|
50
|
+
}
|
|
51
|
+
return 'Unknown error occurred';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Extract error context safely
|
|
55
|
+
*/
|
|
56
|
+
export function getErrorContext(error) {
|
|
57
|
+
if (isSmartDeploymentError(error)) {
|
|
58
|
+
return error.context;
|
|
59
|
+
}
|
|
60
|
+
return {};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get suggestions from error if available
|
|
64
|
+
*/
|
|
65
|
+
export function getErrorSuggestions(error) {
|
|
66
|
+
if (isSmartDeploymentError(error)) {
|
|
67
|
+
return error.suggestions;
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,aAAa;AACb,OAAO,EAAE,oBAAoB,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,iBAAiB;AACjB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE5G,oBAAoB;AACpB,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,oBAAoB;AACpB,OAA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