Skip to content

fix(git): unify transient error detection - #853

Merged
Neonforge98 merged 1 commit into
developfrom
codex/fix-git-api-clippy-export
Aug 20, 2026
Merged

fix(git): unify transient error detection#853
Neonforge98 merged 1 commit into
developfrom
codex/fix-git-api-clippy-export

Conversation

@Neonforge98

@Neonforge98 Neonforge98 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

The required cargo clippy --workspace --all-targets -- -D warnings check fails on develop and on unrelated pull requests with ambiguous glob re-exports in git_api::commands. streaming exposed a crate-visible is_transient_error while utils re-exported the canonical git::util::is_transient_error; glob-exporting both modules made the command namespace ambiguous. git::bundle also carried a third byte-for-byte copy of the same predicate.

Solution

Make git::util::is_transient_error the single implementation. The streaming and bundle paths now import that canonical helper, and the streaming tests exercise the canonical function directly. The existing public git_api::commands::is_transient_error path remains available through utils, so no caller-facing API changes.

The resulting invariant is one transient-error classifier for all Git retry paths and one unambiguous command export.

Potential risks

Future edits to the canonical classifier now affect both streaming and bundle retry behavior together; that coupling is intentional, but changes to the shared predicate should keep both consumers in mind. The current predicates were byte-for-byte identical, so this PR does not change which errors are retried.

No dependency, lockfile, persistence, schema, wire-format, or UI behavior changes are included. Cross-platform runtime behavior was not manually exercised; workspace compilation covers all local targets, and CI remains the source for runner-platform validation. Rollback is a revert of commit 10b5aada7.

Verification

  • Published PR CI run 32420916073 — Frontend typecheck/lint/unit tests passed; Rust workspace clippy passed; AI attribution passed.
  • node scripts/tauri/prepare-sidecars.cjs --profile debug — passed; staged the sidecar required by the Tauri build script.
  • cargo test -p git --lib — passed, 134/134.
  • cargo test -p git_api --lib — passed, 90/90.
  • cargo check --workspace --all-targets — passed.
  • cargo clippy --workspace --all-targets -- -D warnings — passed with the exact CI command and a worktree-local target directory.
  • rustfmt --edition 2021 --check crates/git/src/bundle.rs crates/git-api/src/commands/streaming.rs crates/git-api/src/commands/tests/streaming_tests.rs — passed.
  • Commit hook — passed scoped clippy for git and git_api.
  • cargo fmt --all -- --check — not clean on the untouched develop baseline; it reports pre-existing formatting diffs outside these three changed files. The changed files pass the targeted rustfmt --check command above.
  • UI screenshots are not applicable because this PR has no user-visible UI change.

Audit

Architecture audit covered all 10 layers. Compilation and warnings pass; the duplicate implementation class was swept across the Rust workspace and reduced to the canonical helper; naming and ownership now point to the shared Git utility layer. No default branches, domain leakage, wire payloads, initialization paths, or multi-field resolvers are changed, so layers 5 and 8-10 are non-applicable beyond confirming the diff does not enter those boundaries.

@Neonforge98
Neonforge98 merged commit 4849f71 into develop Aug 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant