ardent-cli 0.0.30 → 0.0.31
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 +68 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -762,6 +762,42 @@ branchCommand.command("diff [name]", { hidden: true }).description("(removed) Sh
|
|
|
762
762
|
// src/commands/connector/index.ts
|
|
763
763
|
import { Command as Command2 } from "commander";
|
|
764
764
|
|
|
765
|
+
// src/lib/connector_warnings.ts
|
|
766
|
+
var YELLOW = "\x1B[33m";
|
|
767
|
+
var RESET = "\x1B[0m";
|
|
768
|
+
async function fetchConnectorWarnings(projectId, connectorId) {
|
|
769
|
+
const listed = await api.get(
|
|
770
|
+
`/v1/cli/connectors?project_id=${encodeURIComponent(projectId)}`
|
|
771
|
+
);
|
|
772
|
+
if (!listed.connectors) {
|
|
773
|
+
throw new Error("connector list response missing connectors array");
|
|
774
|
+
}
|
|
775
|
+
for (const connector of listed.connectors) {
|
|
776
|
+
if (connector.id === connectorId) {
|
|
777
|
+
return connector.warnings ?? [];
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
throw new Error(
|
|
781
|
+
`connector ${connectorId} absent from /v1/cli/connectors response`
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
function printDegradedWarnings(warnings) {
|
|
785
|
+
if (warnings.length > 0) {
|
|
786
|
+
console.log(
|
|
787
|
+
`${YELLOW}\u26A0 This connector is degraded \u2014 some source objects are excluded from branches:${RESET}`
|
|
788
|
+
);
|
|
789
|
+
for (const warning of warnings) {
|
|
790
|
+
console.log(`${YELLOW} \u2022 ${warning}${RESET}`);
|
|
791
|
+
}
|
|
792
|
+
} else {
|
|
793
|
+
console.log(
|
|
794
|
+
`${YELLOW}\u26A0 This connector is degraded \u2014 some source objects are excluded from branches.${RESET}`
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
console.log("");
|
|
798
|
+
console.log(" Review this connector with: ardent connector list");
|
|
799
|
+
}
|
|
800
|
+
|
|
765
801
|
// src/lib/engine_setup_result.ts
|
|
766
802
|
var SUCCESS_ENGINE_STATUSES = /* @__PURE__ */ new Set(["healthy", "degraded"]);
|
|
767
803
|
var RETRYABLE_ENGINE_STATUSES = /* @__PURE__ */ new Set(["configuration_verified"]);
|
|
@@ -1663,13 +1699,30 @@ async function createAction2(type, url, options) {
|
|
|
1663
1699
|
setCacheEntry("connectors", cachedConnectors);
|
|
1664
1700
|
setConfig("currentConnectorId", connectorId);
|
|
1665
1701
|
setConfig("currentConnectorName", connectorName);
|
|
1702
|
+
const isDegraded = finalConnector.branching_engine_status === "degraded";
|
|
1666
1703
|
trackEvent("CLI: connector create succeeded", {
|
|
1667
1704
|
db_type: type,
|
|
1668
1705
|
byoc: isByoc,
|
|
1669
|
-
deployment_model: deploymentModel
|
|
1706
|
+
deployment_model: deploymentModel,
|
|
1707
|
+
degraded: isDegraded
|
|
1670
1708
|
});
|
|
1671
|
-
|
|
1672
|
-
|
|
1709
|
+
if (isDegraded) {
|
|
1710
|
+
console.log("\u2713 Connector created");
|
|
1711
|
+
console.log(` ID: ${connectorId}`);
|
|
1712
|
+
console.log("");
|
|
1713
|
+
let warnings = [];
|
|
1714
|
+
try {
|
|
1715
|
+
warnings = await fetchConnectorWarnings(currentProjectId, connectorId);
|
|
1716
|
+
} catch (warningsErr) {
|
|
1717
|
+
trackEvent("CLI: connector create degraded warnings unavailable", {
|
|
1718
|
+
reason: warningsErr instanceof Error ? warningsErr.message : "unknown"
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
printDegradedWarnings(warnings);
|
|
1722
|
+
} else {
|
|
1723
|
+
console.log("\u2713 Connector created and ready");
|
|
1724
|
+
console.log(` ID: ${connectorId}`);
|
|
1725
|
+
}
|
|
1673
1726
|
showNextStep();
|
|
1674
1727
|
} catch (err) {
|
|
1675
1728
|
if (isPermissionError(err)) {
|
|
@@ -1689,6 +1742,7 @@ async function createAction2(type, url, options) {
|
|
|
1689
1742
|
|
|
1690
1743
|
// src/lib/connector_render.ts
|
|
1691
1744
|
var GREEN = "\x1B[32m";
|
|
1745
|
+
var YELLOW2 = "\x1B[33m";
|
|
1692
1746
|
var CYAN = "\x1B[36m";
|
|
1693
1747
|
var RED = "\x1B[31m";
|
|
1694
1748
|
function pendingHint(state, connectorName) {
|
|
@@ -1712,6 +1766,9 @@ function renderConnectorIcon(connector) {
|
|
|
1712
1766
|
if (connector.status === "healthy") {
|
|
1713
1767
|
return { kind: "ready", icon: "\u25CF", color: GREEN };
|
|
1714
1768
|
}
|
|
1769
|
+
if (connector.status === "degraded") {
|
|
1770
|
+
return { kind: "degraded", icon: "\u25CF", color: YELLOW2 };
|
|
1771
|
+
}
|
|
1715
1772
|
return { kind: "broken", icon: "\u25CB", color: RED };
|
|
1716
1773
|
}
|
|
1717
1774
|
|
|
@@ -1951,12 +2008,16 @@ async function retrySetupAction(name, options = {}) {
|
|
|
1951
2008
|
connector_id: connector.id,
|
|
1952
2009
|
dispatched
|
|
1953
2010
|
});
|
|
2011
|
+
let postSetupConnector;
|
|
1954
2012
|
try {
|
|
1955
2013
|
const refreshed = await api.get(
|
|
1956
2014
|
`/v1/cli/connectors?project_id=${currentProjectId}`
|
|
1957
2015
|
);
|
|
1958
2016
|
if (refreshed.connectors) {
|
|
1959
2017
|
setCacheEntry("connectors", refreshed.connectors);
|
|
2018
|
+
postSetupConnector = refreshed.connectors.find(
|
|
2019
|
+
(candidate) => candidate.id === connector.id
|
|
2020
|
+
);
|
|
1960
2021
|
}
|
|
1961
2022
|
} catch {
|
|
1962
2023
|
}
|
|
@@ -1965,6 +2026,10 @@ async function retrySetupAction(name, options = {}) {
|
|
|
1965
2026
|
} else {
|
|
1966
2027
|
console.log("\u2713 Engine setup complete");
|
|
1967
2028
|
}
|
|
2029
|
+
if (postSetupConnector?.branching_engine_status === "degraded") {
|
|
2030
|
+
console.log("");
|
|
2031
|
+
printDegradedWarnings(postSetupConnector.warnings ?? []);
|
|
2032
|
+
}
|
|
1968
2033
|
} catch (err) {
|
|
1969
2034
|
const failureTelemetry = connectorRetrySetupFailureTelemetry(err);
|
|
1970
2035
|
if (isPermissionError(err)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ardent-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "Git for Data infrastructure",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"build": "tsup",
|
|
11
11
|
"dev": "tsup --watch",
|
|
12
12
|
"start": "node dist/index.js",
|
|
13
|
-
"test": "
|
|
13
|
+
"//test": "Keep --test-concurrency=1: the *.test.ts files mutate process-wide globals (process.env.HOME, globalThis.fetch) and race if run in parallel. Remove only after introducing per-file process isolation.",
|
|
14
|
+
"test": "tsx --test --test-concurrency=1 src/lib/*.test.ts"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"dist"
|