@jterrats/smart-deployment 1.2.2 → 1.2.4
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 +14 -0
- package/lib/commands/ci-publish.d.ts +2 -0
- package/lib/commands/ci-publish.js +32 -3
- package/lib/commands/ci-publish.js.map +1 -1
- package/lib/deployment/deployment-runner.d.ts +3 -0
- package/lib/deployment/deployment-runner.js +52 -41
- package/lib/deployment/deployment-runner.js.map +1 -1
- package/lib/deployment/forceignore-staging-service.d.ts +11 -0
- package/lib/deployment/forceignore-staging-service.js +120 -0
- package/lib/deployment/forceignore-staging-service.js.map +1 -0
- package/lib/deployment/special-deployment-executor.d.ts +37 -0
- package/lib/deployment/special-deployment-executor.js +235 -0
- package/lib/deployment/special-deployment-executor.js.map +1 -0
- package/lib/deployment/special-deployment-plan.d.ts +4 -0
- package/lib/deployment/special-deployment-plan.js +24 -13
- package/lib/deployment/special-deployment-plan.js.map +1 -1
- package/lib/deployment/special-deployment-target-lookup.d.ts +7 -0
- package/lib/deployment/special-deployment-target-lookup.js +26 -0
- package/lib/deployment/special-deployment-target-lookup.js.map +1 -0
- package/npm-shrinkwrap.json +488 -2236
- package/oclif.lock +115 -59
- package/oclif.manifest.json +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ What is working today:
|
|
|
29
29
|
- `sf smart-deployment status`
|
|
30
30
|
- `sf smart-deployment resume`
|
|
31
31
|
- `sf smart-deployment config`
|
|
32
|
+
- `sf smart-deployment ci-publish`
|
|
32
33
|
- JSON and HTML analysis reports
|
|
33
34
|
- repo-level AI configuration via `.smart-deployment.json`
|
|
34
35
|
|
|
@@ -126,6 +127,19 @@ sf smart-deployment config \
|
|
|
126
127
|
--set-llm-model gpt-4o-mini
|
|
127
128
|
```
|
|
128
129
|
|
|
130
|
+
Build a coordinated CI publish plan for metadata, Agentforce authoring bundles, LWR publish, and optional activation:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
sf smart-deployment ci-publish \
|
|
134
|
+
--source-path force-app \
|
|
135
|
+
--target-org release \
|
|
136
|
+
--since origin/main \
|
|
137
|
+
--dry-run
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
When executing deploy phases, Smart Deployment respects `.forceignore` by building from a temporary sanitized Salesforce project. Ignored files stay in the working tree but are not visible to package generation or `sf project deploy start`.
|
|
141
|
+
When `--target-org` is provided, the coordinated publish flow also passes the org through to Salesforce CLI commands and checks AI evaluation subjects against source metadata or the target org before deploy.
|
|
142
|
+
|
|
129
143
|
## Commands
|
|
130
144
|
|
|
131
145
|
See:
|
|
@@ -6,9 +6,11 @@ export default class CiPublish extends SfCommand<SpecialDeploymentPlan> {
|
|
|
6
6
|
static readonly flags: {
|
|
7
7
|
'source-path': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
since: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
'auto-activate': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
run(): Promise<SpecialDeploymentPlan>;
|
|
13
14
|
private reportPlan;
|
|
15
|
+
private reportExecutionFailure;
|
|
14
16
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { SpecialDeploymentPlanExecutor } from '../deployment/special-deployment-executor.js';
|
|
2
3
|
import { SpecialDeploymentPlanService } from '../deployment/special-deployment-plan.js';
|
|
3
4
|
import { getLogger } from '../utils/logger.js';
|
|
4
5
|
const logger = getLogger('CiPublishCommand');
|
|
@@ -6,7 +7,7 @@ export default class CiPublish extends SfCommand {
|
|
|
6
7
|
static summary = 'Build a coordinated metadata, Agentforce, LWR, and OmniStudio publish plan for CI.';
|
|
7
8
|
static examples = [
|
|
8
9
|
'<%= config.bin %> <%= command.id %> --since origin/main --dry-run',
|
|
9
|
-
'<%= config.bin %> <%= command.id %> --source-path force-app --since HEAD~1 --json',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --source-path force-app --target-org release --since HEAD~1 --json',
|
|
10
11
|
];
|
|
11
12
|
static flags = {
|
|
12
13
|
'source-path': Flags.string({
|
|
@@ -15,6 +16,10 @@ export default class CiPublish extends SfCommand {
|
|
|
15
16
|
since: Flags.string({
|
|
16
17
|
summary: 'Git revision used as the previous green deploy SHA for change detection.',
|
|
17
18
|
}),
|
|
19
|
+
'target-org': Flags.string({
|
|
20
|
+
char: 'o',
|
|
21
|
+
summary: 'Target org alias or username used for deploy commands and org preflight checks.',
|
|
22
|
+
}),
|
|
18
23
|
'dry-run': Flags.boolean({
|
|
19
24
|
summary: 'Print the coordinated publish plan without executing external commands.',
|
|
20
25
|
default: true,
|
|
@@ -29,25 +34,45 @@ export default class CiPublish extends SfCommand {
|
|
|
29
34
|
const { flags } = await this.parse(CiPublish);
|
|
30
35
|
const sourcePath = typeof flags['source-path'] === 'string' ? flags['source-path'] : undefined;
|
|
31
36
|
const since = typeof flags.since === 'string' ? flags.since : undefined;
|
|
37
|
+
const targetOrg = typeof flags['target-org'] === 'string' ? flags['target-org'] : undefined;
|
|
32
38
|
const dryRun = flags['dry-run'] !== false;
|
|
33
39
|
const autoActivate = flags['auto-activate'] === true;
|
|
34
|
-
logger.info('Building CI publish plan', { sourcePath, since, dryRun, autoActivate });
|
|
40
|
+
logger.info('Building CI publish plan', { sourcePath, since, targetOrg, dryRun, autoActivate });
|
|
35
41
|
const plan = await new SpecialDeploymentPlanService().buildPlan({
|
|
36
42
|
sourcePath,
|
|
37
43
|
since,
|
|
44
|
+
targetOrg,
|
|
38
45
|
dryRun,
|
|
39
46
|
autoActivate,
|
|
40
47
|
});
|
|
41
48
|
this.reportPlan(plan);
|
|
49
|
+
if (!dryRun) {
|
|
50
|
+
const execution = await new SpecialDeploymentPlanExecutor().execute(plan);
|
|
51
|
+
if (!execution.success) {
|
|
52
|
+
const message = execution.errors[0] ?? 'Coordinated publish failed.';
|
|
53
|
+
const failedPlan = {
|
|
54
|
+
...plan,
|
|
55
|
+
success: false,
|
|
56
|
+
errors: [...plan.errors, message],
|
|
57
|
+
};
|
|
58
|
+
this.reportExecutionFailure(execution.failedPhase, execution.exitCode, message);
|
|
59
|
+
return failedPlan;
|
|
60
|
+
}
|
|
61
|
+
this.log('');
|
|
62
|
+
this.log('Coordinated publish execution completed successfully.');
|
|
63
|
+
}
|
|
42
64
|
return plan;
|
|
43
65
|
}
|
|
44
66
|
reportPlan(plan) {
|
|
45
67
|
this.log('Coordinated publish plan');
|
|
46
68
|
this.log(`Project: ${plan.projectRoot}`);
|
|
47
|
-
this.log(`Mode: ${plan.dryRun ? 'dry-run' : '
|
|
69
|
+
this.log(`Mode: ${plan.dryRun ? 'dry-run' : 'execute'}`);
|
|
48
70
|
if (plan.since) {
|
|
49
71
|
this.log(`Since: ${plan.since}`);
|
|
50
72
|
}
|
|
73
|
+
if (plan.targetOrg) {
|
|
74
|
+
this.log(`Target Org: ${plan.targetOrg}`);
|
|
75
|
+
}
|
|
51
76
|
for (const phase of plan.phases) {
|
|
52
77
|
this.log('');
|
|
53
78
|
this.log(`${phase.label}${phase.skipped ? ' (skipped)' : ''}`);
|
|
@@ -65,5 +90,9 @@ export default class CiPublish extends SfCommand {
|
|
|
65
90
|
}
|
|
66
91
|
}
|
|
67
92
|
}
|
|
93
|
+
reportExecutionFailure(failedPhase, exitCode, message) {
|
|
94
|
+
this.log('');
|
|
95
|
+
this.error(`Coordinated publish failed in phase ${failedPhase ?? 'unknown'} with exit code ${exitCode ?? 'unknown'}: ${message}`);
|
|
96
|
+
}
|
|
68
97
|
}
|
|
69
98
|
//# sourceMappingURL=ci-publish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-publish.js","sourceRoot":"","sources":["../../src/commands/ci-publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAA8B,MAAM,0CAA0C,CAAC;AACpH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAgC;IAC9D,MAAM,CAAU,OAAO,GAAG,oFAAoF,CAAC;IAE/G,MAAM,CAAU,QAAQ,GAAG;QAChC,mEAAmE;QACnE,
|
|
1
|
+
{"version":3,"file":"ci-publish.js","sourceRoot":"","sources":["../../src/commands/ci-publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAA8B,MAAM,0CAA0C,CAAC;AACpH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAgC;IAC9D,MAAM,CAAU,OAAO,GAAG,oFAAoF,CAAC;IAE/G,MAAM,CAAU,QAAQ,GAAG;QAChC,mEAAmE;QACnE,wGAAwG;KACzG,CAAC;IAEK,MAAM,CAAU,KAAK,GAAG;QAC7B,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,8CAA8C;SACxD,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,OAAO,EAAE,0EAA0E;SACpF,CAAC;QACF,YAAY,EAAE,KAAK,CA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,CAAC;QAC5C,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/D,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;gBACrB,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;YACpC,CAAC;YACD,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACrC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IAEO,sBAAsB,CAAC,WAA+B,EAAE,QAA4B,EAAE,OAAe;QAC3G,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,CACR,uCAAuC,WAAW,IAAI,SAAS,mBAC7D,QAAQ,IAAI,SACd,KAAK,OAAO,EAAE,CACf,CAAC;IACJ,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { SfCliIntegration } from './sf-cli-integration.js';
|
|
|
6
6
|
import { StateManager } from './state-manager.js';
|
|
7
7
|
import { TestPlanService } from './test-plan-service.js';
|
|
8
8
|
import { WaveManifestService } from './wave-manifest-service.js';
|
|
9
|
+
import { ForceIgnoreStagingService } from './forceignore-staging-service.js';
|
|
9
10
|
import type { TestExecutor } from './test-executor.js';
|
|
10
11
|
import type { DeploymentAIContext } from './deployment-context-service.js';
|
|
11
12
|
export type DeploymentRunnerParams = {
|
|
@@ -27,10 +28,12 @@ export type DeploymentRunnerParams = {
|
|
|
27
28
|
type DeploymentRunnerDependencies = {
|
|
28
29
|
testPlanService?: TestPlanService;
|
|
29
30
|
waveManifestService?: WaveManifestService;
|
|
31
|
+
forceIgnoreStagingService?: ForceIgnoreStagingService;
|
|
30
32
|
};
|
|
31
33
|
export declare class DeploymentRunner {
|
|
32
34
|
private readonly testPlanService;
|
|
33
35
|
private readonly waveManifestService;
|
|
36
|
+
private readonly forceIgnoreStagingService;
|
|
34
37
|
constructor(dependencies?: DeploymentRunnerDependencies);
|
|
35
38
|
execute(params: DeploymentRunnerParams): Promise<void>;
|
|
36
39
|
private buildAIMetadata;
|
|
@@ -1,47 +1,72 @@
|
|
|
1
1
|
import { TestPlanService } from './test-plan-service.js';
|
|
2
2
|
import { WaveManifestService } from './wave-manifest-service.js';
|
|
3
|
+
import { ForceIgnoreStagingService } from './forceignore-staging-service.js';
|
|
3
4
|
import { buildPersistedWaveGraphContext } from './wave-graph-state.js';
|
|
4
5
|
export class DeploymentRunner {
|
|
5
6
|
testPlanService;
|
|
6
7
|
waveManifestService;
|
|
8
|
+
forceIgnoreStagingService;
|
|
7
9
|
constructor(dependencies = {}) {
|
|
8
10
|
this.testPlanService = dependencies.testPlanService ?? new TestPlanService();
|
|
9
11
|
this.waveManifestService = dependencies.waveManifestService ?? new WaveManifestService();
|
|
12
|
+
this.forceIgnoreStagingService = dependencies.forceIgnoreStagingService ?? new ForceIgnoreStagingService();
|
|
10
13
|
}
|
|
11
14
|
async execute(params) {
|
|
12
15
|
const { deploymentId, targetOrg, sourcePath, orderedWaves, dependencyGraph, componentMap, apiVersion, skipTests, testExecutor, tracker, stateManager, sfCli, aiContext, log, } = params;
|
|
13
16
|
await this.forEachSequentially(orderedWaves, async (wave) => {
|
|
14
17
|
log(`\n🌊 Deploying Wave ${wave.number}/${orderedWaves.length} (${wave.components.length} components)...`);
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
waveNumber: wave.number,
|
|
18
|
-
components: wave.components,
|
|
19
|
-
componentMap,
|
|
20
|
-
apiVersion,
|
|
18
|
+
const workspace = await this.forceIgnoreStagingService.prepare({
|
|
19
|
+
projectRoot: sourcePath ?? process.cwd(),
|
|
21
20
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
try {
|
|
22
|
+
const manifestPath = await this.waveManifestService.generateManifest({
|
|
23
|
+
baseDir: workspace.projectRoot,
|
|
24
|
+
waveNumber: wave.number,
|
|
25
|
+
components: wave.components,
|
|
26
|
+
componentMap,
|
|
27
|
+
apiVersion,
|
|
28
|
+
});
|
|
29
|
+
const testPlan = this.testPlanService.resolveTestPlan(wave, skipTests, testExecutor);
|
|
30
|
+
tracker.startTracking(deploymentId, wave.number, orderedWaves.length);
|
|
31
|
+
const result = await sfCli.deploy({
|
|
32
|
+
manifestPath,
|
|
33
|
+
targetOrg,
|
|
34
|
+
workingDirectory: workspace.projectRoot,
|
|
35
|
+
testLevel: testPlan.testLevel,
|
|
36
|
+
tests: testPlan.testLevel === 'RunSpecifiedTests' ? testPlan.tests : undefined,
|
|
37
|
+
});
|
|
38
|
+
tracker.updateProgress(deploymentId, result);
|
|
39
|
+
if (!result.success) {
|
|
40
|
+
await stateManager.saveState({
|
|
41
|
+
deploymentId,
|
|
42
|
+
targetOrg,
|
|
43
|
+
timestamp: new Date().toISOString(),
|
|
44
|
+
totalWaves: orderedWaves.length,
|
|
45
|
+
completedWaves: Array.from({ length: Math.max(0, wave.number - 1) }, (_, i) => i + 1),
|
|
46
|
+
currentWave: wave.number,
|
|
47
|
+
failedWave: {
|
|
48
|
+
waveNumber: wave.number,
|
|
49
|
+
error: result.output,
|
|
50
|
+
timestamp: new Date().toISOString(),
|
|
51
|
+
},
|
|
52
|
+
metadata: {
|
|
53
|
+
lastKnownStatus: result.status,
|
|
54
|
+
testsRun: result.testsRun,
|
|
55
|
+
testFailures: result.testFailures,
|
|
56
|
+
testLevel: testPlan.testLevel,
|
|
57
|
+
waveGraphContext: buildPersistedWaveGraphContext(orderedWaves, dependencyGraph),
|
|
58
|
+
...this.buildAIMetadata(aiContext),
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
throw new Error(`Wave ${wave.number} failed: ${result.output}`);
|
|
62
|
+
}
|
|
33
63
|
await stateManager.saveState({
|
|
34
64
|
deploymentId,
|
|
35
65
|
targetOrg,
|
|
36
66
|
timestamp: new Date().toISOString(),
|
|
37
67
|
totalWaves: orderedWaves.length,
|
|
38
|
-
completedWaves: Array.from({ length:
|
|
68
|
+
completedWaves: Array.from({ length: wave.number }, (_, i) => i + 1),
|
|
39
69
|
currentWave: wave.number,
|
|
40
|
-
failedWave: {
|
|
41
|
-
waveNumber: wave.number,
|
|
42
|
-
error: result.output,
|
|
43
|
-
timestamp: new Date().toISOString(),
|
|
44
|
-
},
|
|
45
70
|
metadata: {
|
|
46
71
|
lastKnownStatus: result.status,
|
|
47
72
|
testsRun: result.testsRun,
|
|
@@ -51,25 +76,11 @@ export class DeploymentRunner {
|
|
|
51
76
|
...this.buildAIMetadata(aiContext),
|
|
52
77
|
},
|
|
53
78
|
});
|
|
54
|
-
|
|
79
|
+
log(`✅ Wave ${wave.number} deployed successfully`);
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
await workspace.cleanup();
|
|
55
83
|
}
|
|
56
|
-
await stateManager.saveState({
|
|
57
|
-
deploymentId,
|
|
58
|
-
targetOrg,
|
|
59
|
-
timestamp: new Date().toISOString(),
|
|
60
|
-
totalWaves: orderedWaves.length,
|
|
61
|
-
completedWaves: Array.from({ length: wave.number }, (_, i) => i + 1),
|
|
62
|
-
currentWave: wave.number,
|
|
63
|
-
metadata: {
|
|
64
|
-
lastKnownStatus: result.status,
|
|
65
|
-
testsRun: result.testsRun,
|
|
66
|
-
testFailures: result.testFailures,
|
|
67
|
-
testLevel: testPlan.testLevel,
|
|
68
|
-
waveGraphContext: buildPersistedWaveGraphContext(orderedWaves, dependencyGraph),
|
|
69
|
-
...this.buildAIMetadata(aiContext),
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
log(`✅ Wave ${wave.number} deployed successfully`);
|
|
73
84
|
});
|
|
74
85
|
await stateManager.clearState();
|
|
75
86
|
log('\n✅ All waves deployed successfully!');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment-runner.js","sourceRoot":"","sources":["../../src/deployment/deployment-runner.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"deployment-runner.js","sourceRoot":"","sources":["../../src/deployment/deployment-runner.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAyBvE,MAAM,OAAO,gBAAgB;IACV,eAAe,CAAkB;IACjC,mBAAmB,CAAsB;IACzC,yBAAyB,CAA4B;IAEtE,YAAmB,eAA6C,EAAE;QAChE,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC,eAAe,IAAI,IAAI,eAAe,EAAE,CAAC;QAC7E,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,IAAI,IAAI,m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Aa,EAAE,SAAS,CAAC,aAAa;YACtC,cAAc,EAAE,SAAS,CAAC,YAAY;YACtC,mBAAmB,EAAE,SAAS,CAAC,iBAAiB;YAChD,sBAAsB,EAAE,SAAS,CAAC,oBAAoB;SACvD,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,mBAAmB,CAC/B,KAAmB,EACnB,QAAmD;QAEnD,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QAC9B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC5B,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ForceIgnoreStagingOptions = {
|
|
2
|
+
projectRoot: string;
|
|
3
|
+
};
|
|
4
|
+
export type DeploymentWorkspace = {
|
|
5
|
+
projectRoot: string;
|
|
6
|
+
isStaged: boolean;
|
|
7
|
+
cleanup: () => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export declare class ForceIgnoreStagingService {
|
|
10
|
+
prepare(options: ForceIgnoreStagingOptions): Promise<DeploymentWorkspace>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { access, copyFile, mkdir, mkdtemp, readFile, rm } from 'node:fs/promises';
|
|
2
|
+
import * as os from 'node:os';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { glob } from 'glob';
|
|
5
|
+
import { ForceIgnoreParser } from '../scanner/forceignore-parser.js';
|
|
6
|
+
const PROJECT_ROOT_MARKERS = ['sfdx-project.json', '.forceignore'];
|
|
7
|
+
const DEFAULT_PACKAGE_DIRECTORY = 'force-app';
|
|
8
|
+
const PROJECT_FILES = ['sfdx-project.json', '.forceignore'];
|
|
9
|
+
export class ForceIgnoreStagingService {
|
|
10
|
+
async prepare(options) {
|
|
11
|
+
const projectRoot = await findProjectRoot(options.projectRoot);
|
|
12
|
+
const parser = new ForceIgnoreParser();
|
|
13
|
+
const loadResult = await parser.load(projectRoot);
|
|
14
|
+
if (!loadResult.found || parser.getRules().length === 0) {
|
|
15
|
+
return originalWorkspace(projectRoot);
|
|
16
|
+
}
|
|
17
|
+
const packageDirectories = await readPackageDirectories(projectRoot);
|
|
18
|
+
const sourceFiles = await listSourceFiles(projectRoot, packageDirectories);
|
|
19
|
+
const filteredSourceFiles = sourceFiles.filter((file) => !parser.isIgnored(path.join(projectRoot, file)));
|
|
20
|
+
if (filteredSourceFiles.length === sourceFiles.length) {
|
|
21
|
+
return originalWorkspace(projectRoot);
|
|
22
|
+
}
|
|
23
|
+
const stagingRoot = await mkdtemp(path.join(os.tmpdir(), 'smart-deployment-forceignore-'));
|
|
24
|
+
try {
|
|
25
|
+
await copyProjectFiles(projectRoot, stagingRoot);
|
|
26
|
+
await copyFiles(projectRoot, stagingRoot, filteredSourceFiles);
|
|
27
|
+
return {
|
|
28
|
+
projectRoot: stagingRoot,
|
|
29
|
+
isStaged: true,
|
|
30
|
+
cleanup: async () => {
|
|
31
|
+
await rm(stagingRoot, { recursive: true, force: true });
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
await rm(stagingRoot, { recursive: true, force: true });
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function originalWorkspace(projectRoot) {
|
|
42
|
+
return {
|
|
43
|
+
projectRoot,
|
|
44
|
+
isStaged: false,
|
|
45
|
+
cleanup: () => Promise.resolve(),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
async function findProjectRoot(startPath) {
|
|
49
|
+
let current = path.resolve(startPath);
|
|
50
|
+
while (current !== path.dirname(current)) {
|
|
51
|
+
for (const marker of PROJECT_ROOT_MARKERS) {
|
|
52
|
+
if (await exists(path.join(current, marker))) {
|
|
53
|
+
return current;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
current = path.dirname(current);
|
|
57
|
+
}
|
|
58
|
+
return path.resolve(startPath);
|
|
59
|
+
}
|
|
60
|
+
async function readPackageDirectories(projectRoot) {
|
|
61
|
+
const projectFile = path.join(projectRoot, 'sfdx-project.json');
|
|
62
|
+
if (!(await exists(projectFile))) {
|
|
63
|
+
return [DEFAULT_PACKAGE_DIRECTORY];
|
|
64
|
+
}
|
|
65
|
+
const parsed = JSON.parse(await readFile(projectFile, 'utf8'));
|
|
66
|
+
const directories = parsed.packageDirectories
|
|
67
|
+
?.map((directory) => directory.path)
|
|
68
|
+
.filter((directory) => typeof directory === 'string' && directory.length > 0)
|
|
69
|
+
.map((directory) => normalizePackageDirectory(projectRoot, directory));
|
|
70
|
+
return directories && directories.length > 0 ? directories : [DEFAULT_PACKAGE_DIRECTORY];
|
|
71
|
+
}
|
|
72
|
+
async function listSourceFiles(projectRoot, packageDirectories) {
|
|
73
|
+
const files = await Promise.all(packageDirectories.map((directory) => glob(`${normalizeGlobSegment(directory)}/**/*`, {
|
|
74
|
+
cwd: projectRoot,
|
|
75
|
+
nodir: true,
|
|
76
|
+
dot: true,
|
|
77
|
+
ignore: ['**/node_modules/**', '**/.git/**', '**/.smart-deployment/**'],
|
|
78
|
+
})));
|
|
79
|
+
return [...new Set(files.flat().map(normalizeRelativePath))].sort();
|
|
80
|
+
}
|
|
81
|
+
async function copyProjectFiles(projectRoot, stagingRoot) {
|
|
82
|
+
for (const file of PROJECT_FILES) {
|
|
83
|
+
const source = path.join(projectRoot, file);
|
|
84
|
+
if (await exists(source)) {
|
|
85
|
+
await copyFile(source, path.join(stagingRoot, file));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function copyFiles(projectRoot, stagingRoot, files) {
|
|
90
|
+
for (const file of files) {
|
|
91
|
+
const source = path.join(projectRoot, file);
|
|
92
|
+
const destination = path.join(stagingRoot, file);
|
|
93
|
+
await mkdir(path.dirname(destination), { recursive: true });
|
|
94
|
+
await copyFile(source, destination);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function exists(filePath) {
|
|
98
|
+
try {
|
|
99
|
+
await access(filePath);
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function normalizeGlobSegment(segment) {
|
|
107
|
+
return normalizeRelativePath(segment).replace(/[?*[\\\]]/gu, '\\$&');
|
|
108
|
+
}
|
|
109
|
+
function normalizePackageDirectory(projectRoot, directory) {
|
|
110
|
+
const absoluteDirectory = path.resolve(projectRoot, directory);
|
|
111
|
+
const relativeDirectory = path.relative(projectRoot, absoluteDirectory);
|
|
112
|
+
if (relativeDirectory.startsWith('..') || path.isAbsolute(relativeDirectory)) {
|
|
113
|
+
throw new Error(`Package directory must stay inside the Salesforce project: ${directory}`);
|
|
114
|
+
}
|
|
115
|
+
return normalizeRelativePath(relativeDirectory);
|
|
116
|
+
}
|
|
117
|
+
function normalizeRelativePath(filePath) {
|
|
118
|
+
return filePath.split(path.sep).join('/');
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=forceignore-staging-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forceignore-staging-service.js","sourceRoot":"","sources":["../../src/deployment/forceignore-staging-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kC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AC,WAAmB,EAAE,SAAiB;IACvE,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/D,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACxE,IAAI,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,8DAA8D,SAAS,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { SpecialDeploymentCommand, SpecialDeploymentPlan } from './special-deployment-plan.js';
|
|
2
|
+
import { ForceIgnoreStagingService } from './forceignore-staging-service.js';
|
|
3
|
+
export type SpecialDeploymentCommandResult = {
|
|
4
|
+
phaseKind: string;
|
|
5
|
+
phaseLabel: string;
|
|
6
|
+
command: SpecialDeploymentCommand;
|
|
7
|
+
success: boolean;
|
|
8
|
+
stdout: string;
|
|
9
|
+
stderr: string;
|
|
10
|
+
exitCode?: number;
|
|
11
|
+
};
|
|
12
|
+
export type SpecialDeploymentExecutionResult = {
|
|
13
|
+
success: boolean;
|
|
14
|
+
completedPhases: string[];
|
|
15
|
+
skippedPhases: string[];
|
|
16
|
+
failedPhase?: string;
|
|
17
|
+
exitCode?: number;
|
|
18
|
+
errors: string[];
|
|
19
|
+
commands: SpecialDeploymentCommandResult[];
|
|
20
|
+
};
|
|
21
|
+
export type SpecialDeploymentCommandRunner = (command: SpecialDeploymentCommand, cwd: string) => Promise<{
|
|
22
|
+
stdout: string;
|
|
23
|
+
stderr: string;
|
|
24
|
+
}>;
|
|
25
|
+
export type SpecialDeploymentPlanExecutorDependencies = {
|
|
26
|
+
runCommand?: SpecialDeploymentCommandRunner;
|
|
27
|
+
forceIgnoreStagingService?: ForceIgnoreStagingService;
|
|
28
|
+
};
|
|
29
|
+
export declare class SpecialDeploymentPlanExecutor {
|
|
30
|
+
private readonly runCommand;
|
|
31
|
+
private readonly forceIgnoreStagingService;
|
|
32
|
+
private readonly publishedVersions;
|
|
33
|
+
constructor(dependencies?: SpecialDeploymentCommandRunner | SpecialDeploymentPlanExecutorDependencies);
|
|
34
|
+
execute(plan: SpecialDeploymentPlan): Promise<SpecialDeploymentExecutionResult>;
|
|
35
|
+
private executeCommand;
|
|
36
|
+
private capturePublishedVersion;
|
|
37
|
+
}
|