ardent-cli 0.0.36 → 0.0.37

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.
Files changed (2) hide show
  1. package/dist/index.js +78 -13
  2. 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
- The underlying CDC service (branching-replay-service + StarRocks) was
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}If you need the current state of a branch:${reset2} \`ardent branch info <name>\`
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,31 @@ 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
+ };
810
+ var CONNECTION_STATUS_DISPLAY = {
811
+ connected: "connected",
812
+ failed: "connection failed",
813
+ unknown: "unknown"
814
+ };
815
+ function engineStatusDisplay(status) {
816
+ if (!status) return "not ready";
817
+ return ENGINE_STATUS_DISPLAY[status] ?? "not ready";
818
+ }
819
+ function connectorStatusDisplay(status) {
820
+ if (!status) return "unknown";
821
+ return CONNECTION_STATUS_DISPLAY[status] ?? ENGINE_STATUS_DISPLAY[status] ?? "not ready";
822
+ }
823
+
801
824
  // src/lib/engine_setup_result.ts
802
825
  var SUCCESS_ENGINE_STATUSES = /* @__PURE__ */ new Set(["healthy", "degraded"]);
803
826
  var RETRYABLE_ENGINE_STATUSES = /* @__PURE__ */ new Set(["configuration_verified"]);
@@ -836,23 +859,63 @@ function assertEngineSetupCompleted(operation, connectorName) {
836
859
  throw new EngineSetupTerminalStatusError(
837
860
  "retryable_engine_status",
838
861
  engineStatus,
839
- `Engine setup needs retry (status: ${engineStatus}). Run \`ardent connector retry-setup ${connectorName}\` to retry, or \`ardent connector list\` to inspect connector state first.`
862
+ `Engine setup needs retry (${engineStatusDisplay(engineStatus)}). Run \`ardent connector retry-setup ${connectorName}\` to retry, or \`ardent connector list\` to inspect connector state first.`
840
863
  );
841
864
  }
842
865
  if (FAILED_ENGINE_STATUSES.has(engineStatus)) {
843
866
  throw new EngineSetupTerminalStatusError(
844
867
  "failed_engine_status",
845
868
  engineStatus,
846
- `Engine setup failed (status: ${engineStatus}). Run \`ardent connector list\` to inspect connector state.`
869
+ `Engine setup failed (${engineStatusDisplay(engineStatus)}). Run \`ardent connector list\` to inspect connector state.`
847
870
  );
848
871
  }
849
872
  throw new EngineSetupTerminalStatusError(
850
873
  "unexpected_engine_status",
851
874
  engineStatus,
852
- `Engine setup completed with unexpected status: ${engineStatus}.`
875
+ "Engine setup completed in an unexpected state. Contact Ardent support."
853
876
  );
854
877
  }
855
878
 
879
+ // src/lib/operation_stage_display.ts
880
+ var STAGE_DISPLAY = {
881
+ // engine_setup_worker / postgres_engine_setup
882
+ "dispatched": "Starting",
883
+ "preparing": "Preparing",
884
+ "creating-neon-project": "Provisioning the branch target",
885
+ "preparing-target-databases": "Preparing target databases",
886
+ "deploying-pgstream": "Starting replication",
887
+ "applying-rls": "Applying RLS policies",
888
+ "storing-credentials": "Storing connection credentials",
889
+ "validating": "Validating the branch target",
890
+ // reset_worker / reset_connector
891
+ "resetting": "Resetting",
892
+ "deleting-pgstream": "Stopping replication",
893
+ "rediscovering-source": "Re-checking the source database",
894
+ "resetting-neon-main": "Resetting the branch target",
895
+ "creating-target-schemas": "Recreating target schemas",
896
+ "redeploying-pgstream": "Restarting replication",
897
+ // environment deploy_worker
898
+ "loading_config": "Loading environment configuration",
899
+ "deploying_infrastructure": "Provisioning environment infrastructure",
900
+ "recording_success": "Finalizing environment",
901
+ "cleaning_failed_deploy": "Cleaning up failed environment provisioning",
902
+ // environment destroy_worker
903
+ "deleting_private_links": "Removing private network links",
904
+ "destroying_infrastructure": "Tearing down environment infrastructure",
905
+ "recording_destroy_success": "Finalizing environment teardown"
906
+ };
907
+ function humanizeRawStage(_raw) {
908
+ return "Working";
909
+ }
910
+ function operationStageDisplay(stage) {
911
+ if (!stage) return "Working";
912
+ const colonIndex = stage.indexOf(":");
913
+ const base = colonIndex === -1 ? stage : stage.slice(0, colonIndex);
914
+ const suffix = colonIndex === -1 ? "" : stage.slice(colonIndex + 1);
915
+ const label = STAGE_DISPLAY[base] ?? humanizeRawStage(base);
916
+ return suffix ? `${label} (for ${suffix})` : label;
917
+ }
918
+
856
919
  // src/lib/engine_setup.ts
857
920
  var EngineSetupTimeoutError = class extends Error {
858
921
  constructor(message) {
@@ -904,7 +967,7 @@ async function runEngineSetupWithPolling(connectorId, connectorName) {
904
967
  }
905
968
  if (op.stage && op.stage !== lastStage) {
906
969
  const progressLabel = op.progress != null ? ` (${op.progress}%)` : "";
907
- console.log(` ${op.stage}${progressLabel}`);
970
+ console.log(` ${operationStageDisplay(op.stage)}${progressLabel}`);
908
971
  lastStage = op.stage;
909
972
  }
910
973
  if (op.status === "completed") {
@@ -919,7 +982,7 @@ async function runEngineSetupWithPolling(connectorId, connectorName) {
919
982
  }
920
983
  }
921
984
  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 (operation ${operationId})`
985
+ `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
986
  );
924
987
  }
925
988
 
@@ -1258,7 +1321,9 @@ function logSubmissionDisallowed() {
1258
1321
  console.error(
1259
1322
  " Wait for the current setup attempt to finish, then retry setup if the connector still shows setup pending."
1260
1323
  );
1261
- console.error(" Contact Ardent support if the connector stays validating.");
1324
+ console.error(
1325
+ " Contact Ardent support if the connector's setup does not progress within a few minutes."
1326
+ );
1262
1327
  }
1263
1328
  function logNonInteractiveRequired(decisionsNeeded) {
1264
1329
  const noun = decisionsNeeded === 1 ? "table" : "tables";
@@ -1462,7 +1527,7 @@ async function promptForUnsupportedExtensions(connectorId, unsupported, alreadyP
1462
1527
  await api.put(`/v1/connectors/${connectorId}`, {
1463
1528
  drop_extensions: merged2
1464
1529
  });
1465
- console.log(`\u2713 Saved drop selection: ${merged2.join(", ")}`);
1530
+ console.log(`\u2713 Saved extension exclusions: ${merged2.join(", ")}`);
1466
1531
  return "applied";
1467
1532
  }
1468
1533
  console.log(
@@ -1489,7 +1554,7 @@ async function promptForUnsupportedExtensions(connectorId, unsupported, alreadyP
1489
1554
  await api.put(`/v1/connectors/${connectorId}`, {
1490
1555
  drop_extensions: merged
1491
1556
  });
1492
- console.log(`\u2713 Saved drop selection: ${merged.join(", ")}`);
1557
+ console.log(`\u2713 Saved extension exclusions: ${merged.join(", ")}`);
1493
1558
  return "applied";
1494
1559
  }
1495
1560
  function printUnloggedTablesPreflight(preflight) {
@@ -1845,7 +1910,7 @@ async function listAction2() {
1845
1910
  if (render.kind === "engine_pending") enginePendingCount += 1;
1846
1911
  const warnings = connector.warnings ?? [];
1847
1912
  const warningSuffix = warnings.length > 0 ? ` ${yellow}\u26A0 ${warnings.length}${reset2}` : "";
1848
- const statusSuffix = render.kind === "ready" ? "" : ` ${render.color}[${connector.status}]${reset2}`;
1913
+ const statusSuffix = render.kind === "ready" ? "" : ` ${render.color}[${connectorStatusDisplay(connector.status)}]${reset2}`;
1849
1914
  const nameLine = isCurrent ? `${green2}* ${render.color}${render.icon}${green2} ${connector.name}${reset2}${warningSuffix}${statusSuffix}` : ` ${render.color}${render.icon}${reset2} ${connector.name}${warningSuffix}${statusSuffix}`;
1850
1915
  console.log(nameLine);
1851
1916
  if (isCurrent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ardent-cli",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "Git for Data infrastructure",
5
5
  "type": "module",
6
6
  "bin": {