ardent-cli 0.0.36 → 0.0.38
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/dist/index.js +84 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -740,11 +740,9 @@ function diffAction() {
|
|
|
740
740
|
console.error(
|
|
741
741
|
`${red}error:${reset2} \`ardent branch diff\` has been removed.
|
|
742
742
|
|
|
743
|
-
|
|
744
|
-
deprecated in favour of pgstream. A pgstream-backed diff view is on the
|
|
745
|
-
roadmap but not yet shipped.
|
|
743
|
+
A replacement is on the roadmap.
|
|
746
744
|
|
|
747
|
-
${yellow}
|
|
745
|
+
${yellow}To view the current state of a branch:${reset2} \`ardent branch info <name>\`
|
|
748
746
|
`
|
|
749
747
|
);
|
|
750
748
|
process.exit(2);
|
|
@@ -798,6 +796,37 @@ function printDegradedWarnings(warnings) {
|
|
|
798
796
|
console.log(" Review this connector with: ardent connector list");
|
|
799
797
|
}
|
|
800
798
|
|
|
799
|
+
// src/lib/connector_status_display.ts
|
|
800
|
+
var ENGINE_STATUS_DISPLAY = {
|
|
801
|
+
healthy: "ready",
|
|
802
|
+
degraded: "ready (with warnings)",
|
|
803
|
+
configuration_verified: "setup pending",
|
|
804
|
+
configuration_failed: "configuration check failed",
|
|
805
|
+
validating: "validation in progress",
|
|
806
|
+
failed_validation: "validation failed",
|
|
807
|
+
unhealthy: "unhealthy",
|
|
808
|
+
unchecked: "not yet configured",
|
|
809
|
+
// ARD-1181: kafka2pg apply halt due to missing target relation. Phrase is
|
|
810
|
+
// deliberately operator-action-oriented and free of vendor names (Neon,
|
|
811
|
+
// Kafka, pgstream) and internal config keys per the CLAUDE.md
|
|
812
|
+
// customer-facing terseness rules. The internal error string + quarantine
|
|
813
|
+
// row count are logged by the detector for operator triage.
|
|
814
|
+
target_schema_lost: "needs reset (contact Ardent support)"
|
|
815
|
+
};
|
|
816
|
+
var CONNECTION_STATUS_DISPLAY = {
|
|
817
|
+
connected: "connected",
|
|
818
|
+
failed: "connection failed",
|
|
819
|
+
unknown: "unknown"
|
|
820
|
+
};
|
|
821
|
+
function engineStatusDisplay(status) {
|
|
822
|
+
if (!status) return "not ready";
|
|
823
|
+
return ENGINE_STATUS_DISPLAY[status] ?? "not ready";
|
|
824
|
+
}
|
|
825
|
+
function connectorStatusDisplay(status) {
|
|
826
|
+
if (!status) return "unknown";
|
|
827
|
+
return CONNECTION_STATUS_DISPLAY[status] ?? ENGINE_STATUS_DISPLAY[status] ?? "not ready";
|
|
828
|
+
}
|
|
829
|
+
|
|
801
830
|
// src/lib/engine_setup_result.ts
|
|
802
831
|
var SUCCESS_ENGINE_STATUSES = /* @__PURE__ */ new Set(["healthy", "degraded"]);
|
|
803
832
|
var RETRYABLE_ENGINE_STATUSES = /* @__PURE__ */ new Set(["configuration_verified"]);
|
|
@@ -836,23 +865,63 @@ function assertEngineSetupCompleted(operation, connectorName) {
|
|
|
836
865
|
throw new EngineSetupTerminalStatusError(
|
|
837
866
|
"retryable_engine_status",
|
|
838
867
|
engineStatus,
|
|
839
|
-
`Engine setup needs retry (
|
|
868
|
+
`Engine setup needs retry (${engineStatusDisplay(engineStatus)}). Run \`ardent connector retry-setup ${connectorName}\` to retry, or \`ardent connector list\` to inspect connector state first.`
|
|
840
869
|
);
|
|
841
870
|
}
|
|
842
871
|
if (FAILED_ENGINE_STATUSES.has(engineStatus)) {
|
|
843
872
|
throw new EngineSetupTerminalStatusError(
|
|
844
873
|
"failed_engine_status",
|
|
845
874
|
engineStatus,
|
|
846
|
-
`Engine setup failed (
|
|
875
|
+
`Engine setup failed (${engineStatusDisplay(engineStatus)}). Run \`ardent connector list\` to inspect connector state.`
|
|
847
876
|
);
|
|
848
877
|
}
|
|
849
878
|
throw new EngineSetupTerminalStatusError(
|
|
850
879
|
"unexpected_engine_status",
|
|
851
880
|
engineStatus,
|
|
852
|
-
|
|
881
|
+
"Engine setup completed in an unexpected state. Contact Ardent support."
|
|
853
882
|
);
|
|
854
883
|
}
|
|
855
884
|
|
|
885
|
+
// src/lib/operation_stage_display.ts
|
|
886
|
+
var STAGE_DISPLAY = {
|
|
887
|
+
// engine_setup_worker / postgres_engine_setup
|
|
888
|
+
"dispatched": "Starting",
|
|
889
|
+
"preparing": "Preparing",
|
|
890
|
+
"creating-neon-project": "Provisioning the branch target",
|
|
891
|
+
"preparing-target-databases": "Preparing target databases",
|
|
892
|
+
"deploying-pgstream": "Starting replication",
|
|
893
|
+
"applying-rls": "Applying RLS policies",
|
|
894
|
+
"storing-credentials": "Storing connection credentials",
|
|
895
|
+
"validating": "Validating the branch target",
|
|
896
|
+
// reset_worker / reset_connector
|
|
897
|
+
"resetting": "Resetting",
|
|
898
|
+
"deleting-pgstream": "Stopping replication",
|
|
899
|
+
"rediscovering-source": "Re-checking the source database",
|
|
900
|
+
"resetting-neon-main": "Resetting the branch target",
|
|
901
|
+
"creating-target-schemas": "Recreating target schemas",
|
|
902
|
+
"redeploying-pgstream": "Restarting replication",
|
|
903
|
+
// environment deploy_worker
|
|
904
|
+
"loading_config": "Loading environment configuration",
|
|
905
|
+
"deploying_infrastructure": "Provisioning environment infrastructure",
|
|
906
|
+
"recording_success": "Finalizing environment",
|
|
907
|
+
"cleaning_failed_deploy": "Cleaning up failed environment provisioning",
|
|
908
|
+
// environment destroy_worker
|
|
909
|
+
"deleting_private_links": "Removing private network links",
|
|
910
|
+
"destroying_infrastructure": "Tearing down environment infrastructure",
|
|
911
|
+
"recording_destroy_success": "Finalizing environment teardown"
|
|
912
|
+
};
|
|
913
|
+
function humanizeRawStage(_raw) {
|
|
914
|
+
return "Working";
|
|
915
|
+
}
|
|
916
|
+
function operationStageDisplay(stage) {
|
|
917
|
+
if (!stage) return "Working";
|
|
918
|
+
const colonIndex = stage.indexOf(":");
|
|
919
|
+
const base = colonIndex === -1 ? stage : stage.slice(0, colonIndex);
|
|
920
|
+
const suffix = colonIndex === -1 ? "" : stage.slice(colonIndex + 1);
|
|
921
|
+
const label = STAGE_DISPLAY[base] ?? humanizeRawStage(base);
|
|
922
|
+
return suffix ? `${label} (for ${suffix})` : label;
|
|
923
|
+
}
|
|
924
|
+
|
|
856
925
|
// src/lib/engine_setup.ts
|
|
857
926
|
var EngineSetupTimeoutError = class extends Error {
|
|
858
927
|
constructor(message) {
|
|
@@ -904,7 +973,7 @@ async function runEngineSetupWithPolling(connectorId, connectorName) {
|
|
|
904
973
|
}
|
|
905
974
|
if (op.stage && op.stage !== lastStage) {
|
|
906
975
|
const progressLabel = op.progress != null ? ` (${op.progress}%)` : "";
|
|
907
|
-
console.log(` ${op.stage}${progressLabel}`);
|
|
976
|
+
console.log(` ${operationStageDisplay(op.stage)}${progressLabel}`);
|
|
908
977
|
lastStage = op.stage;
|
|
909
978
|
}
|
|
910
979
|
if (op.status === "completed") {
|
|
@@ -919,7 +988,7 @@ async function runEngineSetupWithPolling(connectorId, connectorName) {
|
|
|
919
988
|
}
|
|
920
989
|
}
|
|
921
990
|
throw new EngineSetupTimeoutError(
|
|
922
|
-
`Engine setup did not complete within ${maxWaitMs / 6e4} minutes. Setup may still be running server-side \u2014 do NOT delete the connector. Check status with: ardent connector list
|
|
991
|
+
`Engine setup did not complete within ${maxWaitMs / 6e4} minutes. Setup may still be running server-side \u2014 do NOT delete the connector. Check status with: ardent connector list. If you contact Ardent support, reference operation id ${operationId}.`
|
|
923
992
|
);
|
|
924
993
|
}
|
|
925
994
|
|
|
@@ -1258,7 +1327,9 @@ function logSubmissionDisallowed() {
|
|
|
1258
1327
|
console.error(
|
|
1259
1328
|
" Wait for the current setup attempt to finish, then retry setup if the connector still shows setup pending."
|
|
1260
1329
|
);
|
|
1261
|
-
console.error(
|
|
1330
|
+
console.error(
|
|
1331
|
+
" Contact Ardent support if the connector's setup does not progress within a few minutes."
|
|
1332
|
+
);
|
|
1262
1333
|
}
|
|
1263
1334
|
function logNonInteractiveRequired(decisionsNeeded) {
|
|
1264
1335
|
const noun = decisionsNeeded === 1 ? "table" : "tables";
|
|
@@ -1462,7 +1533,7 @@ async function promptForUnsupportedExtensions(connectorId, unsupported, alreadyP
|
|
|
1462
1533
|
await api.put(`/v1/connectors/${connectorId}`, {
|
|
1463
1534
|
drop_extensions: merged2
|
|
1464
1535
|
});
|
|
1465
|
-
console.log(`\u2713 Saved
|
|
1536
|
+
console.log(`\u2713 Saved extension exclusions: ${merged2.join(", ")}`);
|
|
1466
1537
|
return "applied";
|
|
1467
1538
|
}
|
|
1468
1539
|
console.log(
|
|
@@ -1489,7 +1560,7 @@ async function promptForUnsupportedExtensions(connectorId, unsupported, alreadyP
|
|
|
1489
1560
|
await api.put(`/v1/connectors/${connectorId}`, {
|
|
1490
1561
|
drop_extensions: merged
|
|
1491
1562
|
});
|
|
1492
|
-
console.log(`\u2713 Saved
|
|
1563
|
+
console.log(`\u2713 Saved extension exclusions: ${merged.join(", ")}`);
|
|
1493
1564
|
return "applied";
|
|
1494
1565
|
}
|
|
1495
1566
|
function printUnloggedTablesPreflight(preflight) {
|
|
@@ -1845,7 +1916,7 @@ async function listAction2() {
|
|
|
1845
1916
|
if (render.kind === "engine_pending") enginePendingCount += 1;
|
|
1846
1917
|
const warnings = connector.warnings ?? [];
|
|
1847
1918
|
const warningSuffix = warnings.length > 0 ? ` ${yellow}\u26A0 ${warnings.length}${reset2}` : "";
|
|
1848
|
-
const statusSuffix = render.kind === "ready" ? "" : ` ${render.color}[${connector.status}]${reset2}`;
|
|
1919
|
+
const statusSuffix = render.kind === "ready" ? "" : ` ${render.color}[${connectorStatusDisplay(connector.status)}]${reset2}`;
|
|
1849
1920
|
const nameLine = isCurrent ? `${green2}* ${render.color}${render.icon}${green2} ${connector.name}${reset2}${warningSuffix}${statusSuffix}` : ` ${render.color}${render.icon}${reset2} ${connector.name}${warningSuffix}${statusSuffix}`;
|
|
1850
1921
|
console.log(nameLine);
|
|
1851
1922
|
if (isCurrent) {
|