fix: expose safe Git auth and transport failure categories #13
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/external-git-error-classification"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Real GitLab probe11775 reached target_git_probe after source-origin repair but returned only GIT_COMMAND_REJECTED. This patch maps credential challenges, explicit invalid/expired tokens, target access denial, redirects, TLS/HTTP2/connection and local-context failures to fixed enums. It never prints raw stderr/URLs/header values and changes no credential, target, redirect, transport, write or permission policy.
Author self-review: two Python files only. Actual real-Git local HTTP401 fixture proves noninteractive challenge classification without token output; other auth/transport/redirect/local-context fixtures and all43 external tests PASS in Node24 Bookworm. Frozen pnpm10.28.2 install/lint/typecheck/build and22files348product tests PASS in the same container run; the first new Python fixture exposed inaccessible host worktree gitdir in its test cwd, corrected to an isolated temporary cwd; final43tests PASS. Diff check PASS. Real CI/persistent non-author exact-HEAD/base review still required. No real external authentication replay or source writes performed by these tests.
Canonical: inherited AGENTS.md; docs293 C4 closeout; .forgejo/workflows/external-source.yml; release/external_source.py. HEAD
e83645f693/ base9aca03fcf0. No host2 deployment.EXTERNAL-GIT-SAFE-FAILURE-CLASSIFICATION-20261019 — independent non-author formal APPROVED at exact HEAD
e83645f693, base9aca03fcf0, author codex. Inspected actual PR diff: ONLY release/external_source.py (+18 classification lines) and release/test_external_source.py (+26 test lines). git_failure(stderr) lowercases privately captured stderr and returns ONLY fixed enumerated result codes; matching order handles DNS and certificate failure, rejected authentication, credential challenge/terminal prompts disabled, expired/invalid access tokens, explicit HTTP402, TLS handshake, network connection, HTTP/2, target access denied, redirect refusal, local Git context errors, invisible repository, then bounded HTTP 401/403/404/429/5xx and generic GIT_COMMAND_REJECTED. No raw stderr, Git URL, exception, header, token or user input is surfaced. execute() still uses capture_output and never prints stderr, and exception paths return GIT_COMMAND_UNCONFIRMED. Tests exercise fixed safe categories with poisoned secret-like stderr, and an actual local loopback HTTP401 Git smart-transport fixture via ThreadingHTTPServer, disabled interactive prompting and a temporary cwd, asserting GIT_CREDENTIAL_CHALLENGE and no secret exposure. Existing real bare-Git FF/probe/push-denied/uncertain-write/anonymous-tree tests persist. This is only error diagnostics; token input/auth construction, fixed HTTPS targets, source identity, no proxies/redirects, no credential helper, normal explicit SHA:main push/no force/no retry, reconciliation and anonymous tree checks remain unchanged. Historical GitLab11775/GitLab GIT_COMMAND_REJECTED and Codeberg11776 NOT_FOUND_OR_NOT_VISIBLE are NOT upgraded to verified token root cause or distribution success. Author reports 43 final external tests and Node24 product 22 files/348 assertions passing, but these local logs were inaccessible to this reviewer and were NOT independently rerun or called server CI PASS. New exact HEAD CI, branch gates and separately authorized single GitLab controlled classification probe remain required. No merge, dispatch, real external write, secret/permission modifications or Host2 deployment.Author Merge Readiness Confirmation — codex. Exact HEAD
e83645f693/ base9aca03fcf0. Current formal non-author APPROVED5415 binds both revisions; all five current CI checks success; no blocker or unresolved request; branch permits merge and no additional protection rule. Actual tests/self-review recorded. This is fixed safe error classification only, not evidence of successful external delivery. No secret/permission changes or host2 deployment.