chore: close quality-gate coverage gaps (#1689) (#1766)
Some checks failed
Run install, format, lint, build, and test on every push / build (push) Has been cancelled
Run install, format, lint, build, and test on every push / publish (push) Has been cancelled
Run install, format, lint, build, and test on every push / publish-github-container-registry (push) Has been cancelled

Closes #1689. Typecheck cli/tui src, add a core/ format+lint gate, and gate core/json + core/client coverage. See PR #1766 for the full review history.
This commit is contained in:
Cliff Hall 2026-07-24 17:20:12 -04:00 • committed by GitHub
commit 373f346e5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,11 +65,7 @@ export class AuthChallengeError extends Error {
readonly authChallenge: AuthChallenge;
readonly status: number;
constructor(
authChallenge: AuthChallenge,
status: number,
message?: string,
) {
constructor(authChallenge: AuthChallenge, status: number, message?: string) {
super(message ?? `Auth challenge: ${authChallenge.reason}`);
this.name = "AuthChallengeError";
this.authChallenge = authChallenge;
@ -262,8 +258,7 @@ export function parseAuthChallengeFromError(
}
const status =
(err as { status?: number }).status ??
(err as { code?: number }).code;
(err as { status?: number }).status ?? (err as { code?: number }).code;
if (status !== 401 && status !== 403) {
return undefined;
}
@ -271,8 +266,9 @@ export function parseAuthChallengeFromError(
const wwwAuthenticate =
authChallenge?.raw?.wwwAuthenticate ??
(err as { wwwAuthenticate?: string }).wwwAuthenticate ??
(err as { headers?: { get?: (name: string) => string | null } }).headers
?.get?.("WWW-Authenticate") ??
(
err as { headers?: { get?: (name: string) => string | null } }
).headers?.get?.("WWW-Authenticate") ??
undefined;
if (!wwwAuthenticate?.length) {
@ -309,7 +305,8 @@ export function isAuthChallengeError(err: unknown): boolean {
return false;
}
const authChallenge = (err as { authChallenge?: AuthChallenge }).authChallenge;
const authChallenge = (err as { authChallenge?: AuthChallenge })
.authChallenge;
if (authChallenge?.reason) {
return true;
}
@ -323,8 +320,9 @@ export function isAuthChallengeError(err: unknown): boolean {
const wwwAuthenticate =
authChallenge?.raw?.wwwAuthenticate ??
(err as { wwwAuthenticate?: string }).wwwAuthenticate ??
(err as { headers?: { get?: (name: string) => string | null } }).headers
?.get?.("WWW-Authenticate") ??
(
err as { headers?: { get?: (name: string) => string | null } }
).headers?.get?.("WWW-Authenticate") ??
undefined;
return wwwAuthenticate !== undefined && wwwAuthenticate.length > 0;