@revoengine/cli 1.0.25 → 1.0.26
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 +7 -0
- package/dist/src/cli.js +1 -1
- package/dist/src/commands/migrate.js +7 -0
- package/dist/src/migration.d.ts +3 -0
- package/dist/src/migration.js +26 -7
- package/dist/src/resource-syncs/event-sync.js +5 -0
- package/dist/src/ui.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -313,6 +313,13 @@ The JSON extension retains schema version 2, raw family `status`/`counts`, and `
|
|
|
313
313
|
|
|
314
314
|
Repository deployment uses desired-source-wins upsert: it can adopt a missing baseline or overwrite target content drift with the repository state. Its Database Table policy permits supported table renames, column additions and changes, and copying foreign-reference declarations as metadata. Copying those declarations does not create physical SQL foreign-key constraints.
|
|
315
315
|
|
|
316
|
+
Use `--activate` on both repository `plan` and `deploy` to align tracked Event and Schedule `active` values with the manifests. The saved plan includes this activation policy; changing the flag between planning and deployment is rejected before writes. Automation is activated or disabled only after all definition writes and pruning succeed, using verified candidates and readback. Without this flag, target activation is preserved; new automations are created inactive and a remaining activation difference fails deployment verification. Named migrations and dedicated resource commands keep their existing activation behavior.
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
revo plan --prune --activate --out reviewed-plan.json
|
|
320
|
+
revo deploy --prune --activate --yes --reviewed-plan reviewed-plan.json
|
|
321
|
+
```
|
|
322
|
+
|
|
316
323
|
`deploy --force` additionally approves supported high-impact operations reported by `plan`, including column removal, managed partition deletion, Materialized View Schedule writes, Schedule target-type changes, and Group or Role Group writes. Review them with `revo plan --force` before deployment. Force does not bypass invalid identity, missing dependencies, unsupported DDL, ambiguity, or failed verification. Full repository reconciliation explicitly selects these supported operations with `--prune`; it does not require `--force`.
|
|
317
324
|
|
|
318
325
|
To reconcile all tracked families, review the complete plan and approve its deletion list:
|
package/dist/src/cli.js
CHANGED
|
@@ -198,7 +198,7 @@ async function runMain(args, argv) {
|
|
|
198
198
|
const command = args._[0];
|
|
199
199
|
const noPositionals = args._.length === 0;
|
|
200
200
|
if (command === 'version' || ((args.version !== undefined || args.V !== undefined) && noPositionals)) {
|
|
201
|
-
print(args.json ? { version: packageVersion, capabilities: { workspacePrune: true, reviewedPrunePlan: true, reviewedDeploymentPlan: true, componentMutationReview: true } } : packageVersion);
|
|
201
|
+
print(args.json ? { version: packageVersion, capabilities: { workspacePrune: true, reviewedPrunePlan: true, reviewedDeploymentPlan: true, componentMutationReview: true, reviewedAutomationActivation: true } } : packageVersion);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
if (command === 'info' || ((args.i === true || args.info === true) && noPositionals)) {
|
|
@@ -125,6 +125,8 @@ function printMigrationPlan(context, plan) {
|
|
|
125
125
|
context.println(`Changes required: ${plan.needsChanges ? 'yes' : 'no'}; verdict: ${plan.verdict}.`);
|
|
126
126
|
context.println(`Summary: create ${plan.operations.create}, update ${plan.operations.update}${plan.prune ? `, delete ${plan.operations.delete || 0}` : ''}, adopt ${plan.operations.adopt}, unchanged ${plan.operations.noop}, excluded ${plan.operations.excluded}, blocked ${plan.operations.blocked}.`);
|
|
127
127
|
context.println(`Diagnostics: ${plan.warnings.length} warning(s), ${plan.blockers.length} blocker(s).`);
|
|
128
|
+
if (plan.policy.activateAutomations)
|
|
129
|
+
context.println('Automation activation: align tracked Events and Schedules with repository active values after verified writes and pruning.');
|
|
128
130
|
if (plan.sourcePull.mode === 'repository') {
|
|
129
131
|
context.println('Source snapshot: repository workspace (no remote source pull).');
|
|
130
132
|
}
|
|
@@ -391,6 +393,7 @@ async function readWorkspaceDeploymentInput(context) {
|
|
|
391
393
|
resources,
|
|
392
394
|
withStats: readBoolFlag(context.args, ['with-stats']),
|
|
393
395
|
allowDestructive: readBoolFlag(context.args, ['force', 'f']) || readBoolFlag(context.args, ['prune']),
|
|
396
|
+
activateAutomations: readBoolFlag(context.args, ['activate']),
|
|
394
397
|
prune: readBoolFlag(context.args, ['prune']),
|
|
395
398
|
sourceMode: 'workspace',
|
|
396
399
|
targetClient: context.client,
|
|
@@ -550,6 +553,10 @@ function printRunResult(context, result, showPlan = true) {
|
|
|
550
553
|
reason: ('error' in item ? item.error : undefined) || item.reason,
|
|
551
554
|
});
|
|
552
555
|
}
|
|
556
|
+
if (result.verdict !== 'succeeded' && result.verification) {
|
|
557
|
+
context.println('Post-deployment verification:');
|
|
558
|
+
printMigrationPlan(context, result.verification);
|
|
559
|
+
}
|
|
553
560
|
context.println(`Final verdict: ${result.verdict}.`);
|
|
554
561
|
}
|
|
555
562
|
export async function handleDeployCommand(context) {
|
package/dist/src/migration.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export type MigrationPlan = {
|
|
|
50
50
|
pruneTargetKey?: string;
|
|
51
51
|
policy: DatabaseSchemaMigrationPolicy & {
|
|
52
52
|
mode: 'upsert' | 'reconcile';
|
|
53
|
+
activateAutomations?: boolean;
|
|
53
54
|
};
|
|
54
55
|
needsChanges: boolean;
|
|
55
56
|
readyToMigrate: boolean;
|
|
@@ -84,6 +85,7 @@ export type MigrationRun = {
|
|
|
84
85
|
resources: MigrationResource[];
|
|
85
86
|
policy: DatabaseSchemaMigrationPolicy & {
|
|
86
87
|
mode: 'upsert' | 'reconcile';
|
|
88
|
+
activateAutomations?: boolean;
|
|
87
89
|
};
|
|
88
90
|
verdict: 'succeeded' | 'blocked' | 'failed';
|
|
89
91
|
sourcePull: {
|
|
@@ -112,6 +114,7 @@ type MigrationInputBase = {
|
|
|
112
114
|
resources?: MigrationResource[];
|
|
113
115
|
withStats?: boolean;
|
|
114
116
|
allowDestructive?: boolean;
|
|
117
|
+
activateAutomations?: boolean;
|
|
115
118
|
detailedDiff?: boolean;
|
|
116
119
|
prune?: boolean;
|
|
117
120
|
reviewedPrune?: WorkspacePrunePlan;
|
package/dist/src/migration.js
CHANGED
|
@@ -17,10 +17,10 @@ import { REVO_METADATA_FILE, readProjectComponentIdentity, readProjectMetadata,
|
|
|
17
17
|
import { DATABASE_SCHEMAS_DIRECTORY, buildDatabaseSchemasPlan, pullDatabaseSchemasToWorkspace, pushDatabaseSchemas, readWorkspaceDatabaseSchemas, } from "./resource-syncs/database-table-sync.js";
|
|
18
18
|
import { DATABASE_VIEWS_DIRECTORY, buildDatabaseViewsPlan, pullDatabaseViewsToWorkspace, pushDatabaseViews, readWorkspaceDatabaseViews, } from "./resource-syncs/database-view-sync.js";
|
|
19
19
|
import { ENDPOINTS_DIRECTORY, buildEndpointsPlan, pullEndpointsToWorkspace, pushEndpoints, } from "./resource-syncs/endpoint-sync.js";
|
|
20
|
-
import { EVENTS_DIRECTORY, buildEventsPlan, pullEventsToWorkspace, pushEvents, } from "./resource-syncs/event-sync.js";
|
|
20
|
+
import { EVENTS_DIRECTORY, activateVerifiedEvents, buildEventsPlan, pullEventsToWorkspace, pushEvents, } from "./resource-syncs/event-sync.js";
|
|
21
21
|
import { GROUPS_DIRECTORY, buildGroupsPlan, pullGroupsToWorkspace, pushGroups, } from "./resource-syncs/group-sync.js";
|
|
22
22
|
import { JOB_TEMPLATES_DIRECTORY, buildJobTemplatesPlan, pullJobTemplatesToWorkspace, pushJobTemplates, } from "./resource-syncs/job-template-sync.js";
|
|
23
|
-
import { SCHEDULES_DIRECTORY, buildSchedulesPlan, pullSchedulesToWorkspace, pushSchedules, } from "./resource-syncs/schedule-sync.js";
|
|
23
|
+
import { SCHEDULES_DIRECTORY, activateVerifiedSchedules, buildSchedulesPlan, pullSchedulesToWorkspace, pushSchedules, } from "./resource-syncs/schedule-sync.js";
|
|
24
24
|
import { ROLE_GROUPS_DIRECTORY, buildRoleGroupsPlan, pullRoleGroupsToWorkspace, pushRoleGroups, } from "./resource-syncs/role-group-sync.js";
|
|
25
25
|
const RESOURCE_ORDER = [
|
|
26
26
|
'database-table',
|
|
@@ -286,7 +286,7 @@ function summarizeEventPhase(plan) {
|
|
|
286
286
|
.map((item) => `Event "${item.stableKey || item.name}" has no target lock baseline; source-wins migration will align or adopt it.`),
|
|
287
287
|
...plan.items
|
|
288
288
|
.filter((item) => item.status === 'activation-drift')
|
|
289
|
-
.map((item) => `Event "${item.stableKey || item.name}" has activation drift;
|
|
289
|
+
.map((item) => `Event "${item.stableKey || item.name}" has activation drift; activation requires repository plan/deploy --activate or the dedicated events push --activate step.`),
|
|
290
290
|
])];
|
|
291
291
|
const blockers = [...new Set(plan.blockers)];
|
|
292
292
|
return {
|
|
@@ -585,10 +585,10 @@ function combinePlan(input) {
|
|
|
585
585
|
input.endpoints = { ...input.endpoints, items: projectRepositoryItems(input.endpoints.items, endpointItemAction, (item) => item.stableKey ? lock.endpoints[item.stableKey]?.environments[environment]?.remoteHash : undefined) };
|
|
586
586
|
}
|
|
587
587
|
if (input.schedules) {
|
|
588
|
-
input.schedules = { ...input.schedules, items: projectRepositoryItems(input.schedules.items, scheduleItemAction, (item) => item.stableKey ? lock.schedules[item.stableKey]?.environments[environment]?.remoteHash : undefined) };
|
|
588
|
+
input.schedules = { ...input.schedules, items: projectRepositoryItems(input.schedules.items, item => input.migrationInput.activateAutomations && item.status === 'activation-drift' && !item.blocked ? 'update' : scheduleItemAction(item), (item) => item.stableKey ? lock.schedules[item.stableKey]?.environments[environment]?.remoteHash : undefined) };
|
|
589
589
|
}
|
|
590
590
|
if (input.events) {
|
|
591
|
-
input.events = { ...input.events, items: projectRepositoryItems(input.events.items, eventItemAction, (item) => item.stableKey ? lock.events[item.stableKey]?.environments[environment]?.remoteHash : undefined) };
|
|
591
|
+
input.events = { ...input.events, items: projectRepositoryItems(input.events.items, item => input.migrationInput.activateAutomations && item.status === 'activation-drift' && !item.blocked ? 'update' : eventItemAction(item), (item) => item.stableKey ? lock.events[item.stableKey]?.environments[environment]?.remoteHash : undefined) };
|
|
592
592
|
}
|
|
593
593
|
if (input.groups) {
|
|
594
594
|
input.groups = { ...input.groups, items: projectRepositoryItems(input.groups.items, groupItemAction, baselineByKey(lock.groups)) };
|
|
@@ -701,7 +701,7 @@ function combinePlan(input) {
|
|
|
701
701
|
from: input.migrationInput.from,
|
|
702
702
|
to: input.migrationInput.to,
|
|
703
703
|
resources: selectedResources(input.migrationInput),
|
|
704
|
-
policy: { ...migrationPolicy(input.migrationInput), mode: 'upsert' },
|
|
704
|
+
policy: { ...migrationPolicy(input.migrationInput), mode: 'upsert', ...(input.migrationInput.activateAutomations ? { activateAutomations: true } : {}) },
|
|
705
705
|
needsChanges: phases.some((phase) => phase.needsChanges),
|
|
706
706
|
readyToMigrate: blockers.length === 0,
|
|
707
707
|
verdict: phaseVerdict(blockers, warnings),
|
|
@@ -1289,7 +1289,7 @@ export async function runMigration(input) {
|
|
|
1289
1289
|
from: input.from,
|
|
1290
1290
|
to: input.to,
|
|
1291
1291
|
resources,
|
|
1292
|
-
policy: { ...migrationPolicy(input), mode: 'upsert' },
|
|
1292
|
+
policy: { ...migrationPolicy(input), mode: 'upsert', ...(input.activateAutomations ? { activateAutomations: true } : {}) },
|
|
1293
1293
|
sourcePull: pulls,
|
|
1294
1294
|
plan: initialPlan,
|
|
1295
1295
|
};
|
|
@@ -1300,6 +1300,8 @@ export async function runMigration(input) {
|
|
|
1300
1300
|
const environmentKey = targetKey(input);
|
|
1301
1301
|
const phaseResults = {};
|
|
1302
1302
|
const results = [];
|
|
1303
|
+
const pendingEvents = [];
|
|
1304
|
+
const pendingSchedules = [];
|
|
1303
1305
|
let remainingPrune = initialPlan.prune;
|
|
1304
1306
|
if (remainingPrune?.items.some((item) => item.beforeUpserts)) {
|
|
1305
1307
|
const pruned = await applyWorkspacePrune({ cwd: input.cwd, client: targetClient,
|
|
@@ -1559,6 +1561,7 @@ export async function runMigration(input) {
|
|
|
1559
1561
|
stableKeyName,
|
|
1560
1562
|
force: true,
|
|
1561
1563
|
});
|
|
1564
|
+
pendingSchedules.push(...pushed.verifiedActivationCandidates);
|
|
1562
1565
|
phaseResults.schedule = pushed.results;
|
|
1563
1566
|
results.push(...pushed.results);
|
|
1564
1567
|
if (!scheduleResultsAreComplete(pushed.results)) {
|
|
@@ -1593,6 +1596,7 @@ export async function runMigration(input) {
|
|
|
1593
1596
|
stableKeyName,
|
|
1594
1597
|
force: true,
|
|
1595
1598
|
});
|
|
1599
|
+
pendingEvents.push(...pushed.verifiedActivationCandidates);
|
|
1596
1600
|
phaseResults.event = pushed.results;
|
|
1597
1601
|
results.push(...pushed.results);
|
|
1598
1602
|
if (!eventResultsAreComplete(pushed.results)) {
|
|
@@ -1686,6 +1690,21 @@ export async function runMigration(input) {
|
|
|
1686
1690
|
const pruneResults = await applyWorkspacePrune({ cwd: input.cwd, client: targetClient,
|
|
1687
1691
|
resources, envName: environmentKey, plan: remainingPrune });
|
|
1688
1692
|
results.push(...pruneResults);
|
|
1693
|
+
if (!resultsAreComplete(pruneResults))
|
|
1694
|
+
return { ...base, verdict: 'failed', results, phaseResults };
|
|
1695
|
+
}
|
|
1696
|
+
// Enable automation only after every definition write and obsolete consumer deletion succeeded.
|
|
1697
|
+
if (input.activateAutomations) {
|
|
1698
|
+
for (const [family, activate] of [
|
|
1699
|
+
['event', () => activateVerifiedEvents({ client: targetClient, candidates: pendingEvents })],
|
|
1700
|
+
['schedule', () => activateVerifiedSchedules({ client: targetClient, candidates: pendingSchedules })],
|
|
1701
|
+
]) {
|
|
1702
|
+
const activated = await activate();
|
|
1703
|
+
results.push(...activated);
|
|
1704
|
+
phaseResults[family] = [...(phaseResults[family] || []), ...activated];
|
|
1705
|
+
if (!resultsAreComplete(activated))
|
|
1706
|
+
return { ...base, verdict: 'failed', results, phaseResults };
|
|
1707
|
+
}
|
|
1689
1708
|
}
|
|
1690
1709
|
const verification = await planWorkspace({
|
|
1691
1710
|
...input,
|
|
@@ -847,6 +847,11 @@ export async function activateVerifiedEvents(input) {
|
|
|
847
847
|
});
|
|
848
848
|
continue;
|
|
849
849
|
}
|
|
850
|
+
// Check the complete verified definition again before enabling its side effects.
|
|
851
|
+
await verifyEventWrite({ client: input.client, stableKeyName: candidate.stableKeyName,
|
|
852
|
+
manifest: candidate.manifest, eventId: candidate.eventId,
|
|
853
|
+
jobTemplateId: String(current.targetId || ''), expectedActive: current.active === true,
|
|
854
|
+
jobTemplatesById: jobTemplatesCache });
|
|
850
855
|
if (candidate.manifest.active) {
|
|
851
856
|
await input.client.activateEvent(candidate.eventId);
|
|
852
857
|
}
|
package/dist/src/ui.js
CHANGED
|
@@ -179,8 +179,8 @@ function renderCommandCatalog() {
|
|
|
179
179
|
commandRow('revo metadata apply [--project <name>] --yes [--skip-partitions]', 'Populate missing stable-key metadata'),
|
|
180
180
|
commandRow('revo pull --all|--resources <list> --yes [--skip-groups] [--force] [--json]', 'Build the repository workspace from the configured runtime source'),
|
|
181
181
|
commandRow('revo diff [--json]', 'Show only workspace-to-target resource differences without writes'),
|
|
182
|
-
commandRow('revo plan [--prune] [--out file] [--force] [--strict] [--json] [--hints]', 'Plan tracked workspace upserts and optional Stable Key deletions without writes'),
|
|
183
|
-
commandRow('revo deploy [--yes] [--prune] [--reviewed-plan file] [--force] [--json]', 'Review, confirm, deploy and prune tracked resources in dependency order'),
|
|
182
|
+
commandRow('revo plan [--activate] [--prune] [--out file] [--force] [--strict] [--json] [--hints]', 'Plan tracked workspace upserts and optional Stable Key deletions without writes'),
|
|
183
|
+
commandRow('revo deploy [--yes] [--activate] [--prune] [--reviewed-plan file] [--force] [--json]', 'Review, confirm, deploy and prune tracked resources in dependency order'),
|
|
184
184
|
commandRow('revo migrate plan --from <env> --to <env> [--resources <list>] [--skip-groups] [--force] [--json] [--hints]', 'Preview twelve resource families and identity dependencies'),
|
|
185
185
|
commandRow('revo migrate run --from <env> --to <env> [--resources <list>] [--skip-groups] --yes [--force] [--json]', 'Pull, plan, migrate, and verify resources in dependency order'),
|
|
186
186
|
commandRow('revo migrate verify --from <env> --to <env> [--resources <list>] [--json]', 'Verify target resources against a fresh temporary source pull'),
|