gencow 0.1.291 → 0.1.292
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/lib/deploy-command.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { resolveCloudAppTargetWithServerEnvironment } from "./cloud-target-envir
|
|
|
10
10
|
import { cloudTargetRejectionMessage, prodRetryCommandLine } from "./deploy-app-target.mjs";
|
|
11
11
|
import { readJsonValueResponse } from "./http-response-json.mjs";
|
|
12
12
|
import { renderDeployFailureDiagnosticLines } from "./deploy-failure-diagnostic.mjs";
|
|
13
|
+
import { renderDeploymentOperationNotFoundLines } from "./deploy-status-operation-not-found.mjs";
|
|
13
14
|
import { credentialEnvNameOf } from "./prod-create-auth-diagnostic.mjs";
|
|
14
15
|
import { formatAppLogDiagnosis } from "./deploy-logs-diagnostic.mjs";
|
|
15
16
|
import { formatDeploymentOperationPhase } from "./deployment-operation-poll.mjs";
|
|
@@ -277,6 +278,16 @@ export async function handleDeployReadonlySubcommand(params) {
|
|
|
277
278
|
return true;
|
|
278
279
|
}
|
|
279
280
|
if (!res.ok) {
|
|
281
|
+
const notFoundLines = renderDeploymentOperationNotFoundLines({
|
|
282
|
+
status: res.status,
|
|
283
|
+
body,
|
|
284
|
+
deploymentId,
|
|
285
|
+
});
|
|
286
|
+
if (notFoundLines) {
|
|
287
|
+
for (const line of notFoundLines) errorImpl(line);
|
|
288
|
+
exitImpl(1);
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
280
291
|
for (const line of renderDeployFailureDiagnosticLines(body, res.statusText, {
|
|
281
292
|
credentialEnvName: credentialEnvNameOf(creds),
|
|
282
293
|
})) {
|
|
@@ -55,7 +55,7 @@ const SELF_SERVICE_RETRY_POLICIES = new Set([
|
|
|
55
55
|
"AFTER_STATUS",
|
|
56
56
|
]);
|
|
57
57
|
const SAFE_SELF_SERVICE_COMMAND =
|
|
58
|
-
/^gencow (?:(?:deploy status(?: --prod)?(?: --deployment [1-9][0-9]*| --release-attempt [a-f0-9-]{36})?|deploy status --app [a-z][a-z0-9]*(?:-[a-z0-9]+)*(?: --prod)? --release-attempt [a-f0-9-]{36}|deploy status --app [a-z][a-z0-9]*(?:-[a-z0-9]+)*(?: --prod)?)|(?:deploy --app [a-z][a-z0-9]*(?:-[a-z0-9]+)*(?: --prod)? --resume [A-Za-z0-9_-]{16,128})|(?:db:check(?: --prod)? --inspect-state)|(?:deploy logs(?: --prod)?)|whoami)$/u;
|
|
58
|
+
/^gencow (?:(?:deploy status(?: --prod)?(?: --deployment [1-9][0-9]*| --release-attempt [a-f0-9-]{36})?|deploy status --app [a-z][a-z0-9]*(?:-[a-z0-9]+)*(?: --prod)? --release-attempt [a-f0-9-]{36}|deploy status --app [a-z][a-z0-9]*(?:-[a-z0-9]+)*(?: --prod)?)|(?:deploy --app [a-z][a-z0-9]*(?:-[a-z0-9]+)*(?: --prod)? --resume [A-Za-z0-9_-]{16,128})|(?:db:check(?: --prod)? --inspect-state)|(?:deploy logs(?: --prod)?)|(?:deploy(?: --prod)?)|(?:static(?: --prod)?)|whoami)$/u;
|
|
59
59
|
|
|
60
60
|
// These known Platform-side failures are already terminal. The diagnostic
|
|
61
61
|
// asks for no source edits and authorizes no retry; `gencow deploy status` is
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Typed diagnosis for `gencow deploy status --deployment <id>` when the Platform reports the operation
|
|
2
|
+
// as unknown (HTTP 404 with only the legacy error text). Other 404 shapes keep the generic renderer.
|
|
3
|
+
const OPERATION_NOT_FOUND_TEXT = "Deployment operation not found";
|
|
4
|
+
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
7
|
+
const proto = Object.getPrototypeOf(value);
|
|
8
|
+
return proto === Object.prototype || proto === null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function isExactOperationNotFoundBody(body) {
|
|
12
|
+
if (!isPlainObject(body)) return false;
|
|
13
|
+
const keys = Object.keys(body);
|
|
14
|
+
return keys.length === 1 && keys[0] === "error" && body.error === OPERATION_NOT_FOUND_TEXT;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function renderDeploymentOperationNotFoundLines({ status, body, deploymentId }) {
|
|
18
|
+
if (status !== 404) return null;
|
|
19
|
+
if (!isExactOperationNotFoundBody(body)) return null;
|
|
20
|
+
if (!Number.isSafeInteger(deploymentId) || deploymentId <= 0) return null;
|
|
21
|
+
return [
|
|
22
|
+
`DEPLOYMENT_OPERATION_NOT_FOUND: Deployment ${deploymentId} was not found for this account.`,
|
|
23
|
+
"Stage: status_lookup",
|
|
24
|
+
"Changed: nothing; status is read-only.",
|
|
25
|
+
"Why: the id may be wrong, belong to another account, or belong to an app that was deleted.",
|
|
26
|
+
"Retry: no, until the id or app is corrected.",
|
|
27
|
+
"Next command: gencow app list",
|
|
28
|
+
];
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gencow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.292",
|
|
4
4
|
"description": "Gencow — AI Backend Engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"ai": "^6.0.326",
|
|
41
41
|
"better-auth": "1.7.11",
|
|
42
42
|
"postgres": "^3.4.9",
|
|
43
|
-
"@gencow/core": "0.1.48",
|
|
44
43
|
"@gencow/client": "0.2.8",
|
|
45
|
-
"@gencow/
|
|
44
|
+
"@gencow/core": "0.1.48",
|
|
46
45
|
"@gencow/server": "0.1.3",
|
|
47
|
-
"@gencow/shared": "0.0.0"
|
|
46
|
+
"@gencow/shared": "0.0.0",
|
|
47
|
+
"@gencow/react": "0.2.8"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "node scripts/bundle-core.mjs && node scripts/bundle-shared.mjs && node scripts/bundle-server.mjs",
|