ardent-cli 0.0.53 → 0.0.55
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 +35 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -568,6 +568,9 @@ function operationStageDisplay(stage) {
|
|
|
568
568
|
const label = STAGE_DISPLAY[base] ?? humanizeRawStage(base);
|
|
569
569
|
return suffix ? `${label} (for ${suffix})` : label;
|
|
570
570
|
}
|
|
571
|
+
function operationStageLabel(op) {
|
|
572
|
+
return op.stage_label ?? operationStageDisplay(op.stage);
|
|
573
|
+
}
|
|
571
574
|
|
|
572
575
|
// src/lib/resource_name_validation.ts
|
|
573
576
|
var RESERVED_SUFFIXES = ["pooler", "readonly", "direct"];
|
|
@@ -978,7 +981,7 @@ async function pollBranchCreate(operationId, idempotencyScopeKey, mode) {
|
|
|
978
981
|
consecutiveTransientFailures = 0;
|
|
979
982
|
if (op.stage && op.stage !== lastStage && mode !== "json" && mode !== "print-url") {
|
|
980
983
|
const progressLabel = op.progress != null ? ` (${op.progress}%)` : "";
|
|
981
|
-
console.log(` ${
|
|
984
|
+
console.log(` ${operationStageLabel(op)}${progressLabel}`);
|
|
982
985
|
lastStage = op.stage;
|
|
983
986
|
}
|
|
984
987
|
if (op.status === "completed") {
|
|
@@ -1348,7 +1351,7 @@ async function runDiscoveryWithPolling(connectorId, options) {
|
|
|
1348
1351
|
}
|
|
1349
1352
|
if (op.stage && op.stage !== lastStage) {
|
|
1350
1353
|
const progressLabel = op.progress != null ? ` (${op.progress}%)` : "";
|
|
1351
|
-
console.log(` ${
|
|
1354
|
+
console.log(` ${operationStageLabel(op)}${progressLabel}`);
|
|
1352
1355
|
lastStage = op.stage;
|
|
1353
1356
|
}
|
|
1354
1357
|
if (op.status === "completed") {
|
|
@@ -1469,14 +1472,32 @@ var EngineSetupTimeoutError = class extends Error {
|
|
|
1469
1472
|
};
|
|
1470
1473
|
var EngineSetupOperationFailedError = class extends Error {
|
|
1471
1474
|
operationError;
|
|
1472
|
-
|
|
1475
|
+
connectorId;
|
|
1476
|
+
connectorName;
|
|
1477
|
+
operationId;
|
|
1478
|
+
constructor(operationError, connectorIdOrName, connectorName, operationId) {
|
|
1479
|
+
const recoveryHandle = connectorName && operationId ? `${engineSetupRecoveryHandle(connectorIdOrName, connectorName, operationId)} ` : "";
|
|
1480
|
+
const retryName = connectorName ?? connectorIdOrName;
|
|
1473
1481
|
super(
|
|
1474
|
-
`Engine setup failed: ${operationError ?? "unknown error"}. Inspect connector state with \`ardent connector list\`, then retry with \`ardent connector retry-setup ${
|
|
1482
|
+
`Engine setup failed: ${operationError ?? "unknown error"}. ` + recoveryHandle + `Inspect connector state with \`ardent connector list\`, then retry with \`ardent connector retry-setup ${retryName}\` once the underlying issue is resolved.`
|
|
1475
1483
|
);
|
|
1476
1484
|
this.name = "EngineSetupOperationFailedError";
|
|
1477
1485
|
this.operationError = operationError;
|
|
1486
|
+
this.connectorId = connectorName ? connectorIdOrName : null;
|
|
1487
|
+
this.connectorName = connectorName ?? connectorIdOrName;
|
|
1488
|
+
this.operationId = operationId ?? null;
|
|
1478
1489
|
}
|
|
1479
1490
|
};
|
|
1491
|
+
function engineSetupRecoveryHandle(connectorId, connectorName, operationId) {
|
|
1492
|
+
return `For recovery, reference operation id ${operationId} for connector ${connectorId} (${connectorName}).`;
|
|
1493
|
+
}
|
|
1494
|
+
function formatNextEngineSetupPollAction(pollIntervalMs) {
|
|
1495
|
+
if (pollIntervalMs <= 0) {
|
|
1496
|
+
return "The next check runs immediately";
|
|
1497
|
+
}
|
|
1498
|
+
const nextPollSeconds = Math.ceil(pollIntervalMs / 1e3);
|
|
1499
|
+
return `The next check runs in ${nextPollSeconds}s`;
|
|
1500
|
+
}
|
|
1480
1501
|
async function runEngineSetupWithPolling(connectorId, connectorName, options = {}) {
|
|
1481
1502
|
let dispatch;
|
|
1482
1503
|
try {
|
|
@@ -1511,7 +1532,7 @@ async function runEngineSetupWithPolling(connectorId, connectorName, options = {
|
|
|
1511
1532
|
consecutiveTransientFailures += 1;
|
|
1512
1533
|
if (consecutiveTransientFailures % ENGINE_SETUP_TRANSIENT_WARN_EVERY === 0) {
|
|
1513
1534
|
console.warn(
|
|
1514
|
-
` \u26A0 Status check has failed ${consecutiveTransientFailures} times in a row. Setup is still running server-side and the CLI will keep waiting \u2014 do NOT delete the connector.`
|
|
1535
|
+
` \u26A0 Status check has failed ${consecutiveTransientFailures} times in a row. ${engineSetupRecoveryHandle(connectorId, connectorName, operationId)} Setup is still running server-side and the CLI will keep waiting \u2014 do NOT delete the connector. ${formatNextEngineSetupPollAction(pollIntervalMs)}; if this continues, contact Ardent support with that operation id.`
|
|
1515
1536
|
);
|
|
1516
1537
|
}
|
|
1517
1538
|
continue;
|
|
@@ -1521,7 +1542,7 @@ async function runEngineSetupWithPolling(connectorId, connectorName, options = {
|
|
|
1521
1542
|
consecutiveTransientFailures = 0;
|
|
1522
1543
|
if (op.stage && op.stage !== lastStage) {
|
|
1523
1544
|
const progressLabel = op.progress != null ? ` (${op.progress}%)` : "";
|
|
1524
|
-
console.log(` ${
|
|
1545
|
+
console.log(` ${operationStageLabel(op)}${progressLabel}`);
|
|
1525
1546
|
lastStage = op.stage;
|
|
1526
1547
|
}
|
|
1527
1548
|
if (op.status === "completed") {
|
|
@@ -1532,7 +1553,12 @@ async function runEngineSetupWithPolling(connectorId, connectorName, options = {
|
|
|
1532
1553
|
return { dispatched: true };
|
|
1533
1554
|
}
|
|
1534
1555
|
if (op.status === "failed") {
|
|
1535
|
-
throw new EngineSetupOperationFailedError(
|
|
1556
|
+
throw new EngineSetupOperationFailedError(
|
|
1557
|
+
op.error,
|
|
1558
|
+
connectorId,
|
|
1559
|
+
connectorName,
|
|
1560
|
+
operationId
|
|
1561
|
+
);
|
|
1536
1562
|
}
|
|
1537
1563
|
}
|
|
1538
1564
|
throw new EngineSetupTimeoutError(
|
|
@@ -2757,7 +2783,7 @@ async function waitForConnectorDelete(operationId) {
|
|
|
2757
2783
|
consecutiveTransientFailures = 0;
|
|
2758
2784
|
if (operation.stage && operation.stage !== lastStage) {
|
|
2759
2785
|
const progressLabel = operation.progress != null ? ` (${operation.progress}%)` : "";
|
|
2760
|
-
console.log(` ${
|
|
2786
|
+
console.log(` ${operationStageLabel(operation)}${progressLabel}`);
|
|
2761
2787
|
lastStage = operation.stage;
|
|
2762
2788
|
}
|
|
2763
2789
|
if (operation.status === "completed") {
|
|
@@ -3277,7 +3303,7 @@ connectorCommand.command("update <name>").description("Update a connector's conf
|
|
|
3277
3303
|
).action(updateAction);
|
|
3278
3304
|
connectorCommand.command("delete <name>").description("Delete a connector by name").option(
|
|
3279
3305
|
"--force",
|
|
3280
|
-
"Skip the in-flight
|
|
3306
|
+
"Skip the wait for in-flight changes to finish replicating. Any un-replicated changes are abandoned."
|
|
3281
3307
|
).action(deleteAction2);
|
|
3282
3308
|
|
|
3283
3309
|
// src/commands/invite/index.ts
|