complete the migration from thiserror to gix-error - #2847
complete the migration from thiserror to gix-error#2847Sebastian Thiel (Byron) wants to merge 37 commits into
Conversation
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
|
Did the comparison. Three things, plus one offer. 1. 2. 3. I've written a guard for that: Also: in On the comparison: I audited every There's more from the sweep — a per-type verdict on all 42 types #2716 left concrete, an erasure order for the E0119 chains, and a list of dropped |
|
Thanks Amey Pawar (@ameyypawar), while noting that I find no pleasure in reading these AI generated blobs of text. My main gripe is that it's a bot speaking through you, so unless you say you produced this text by hand or think you could produce it, disclosure is the way to go. I recommend adding a few lines of yourself on top giving me your verdict, no matter what it is (i.e. something like "this looks reasonable to me, and I spot-checked one of these claims"), followed, by a separator to clearly mark the AI blob. Thanks again. |
b7df324 to
92a3276
Compare
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
92a3276 to
240b509
Compare
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
240b509 to
6b1745e
Compare
|
Re-checked after your push. Four things I'd still look at. The message loss bothers me most; on the security tests I'd rather have your call than mine. The sweep and this write-up are both AI-produced — I took help of AI tools throughout. I checked the two source arms and the Messages dropped: 53 sites, 50 distinct. Worst: 17 assertions weakened. Two matter: the three erased-API asserts in
Dead branches: Also: ~31 double-wraps left after the 19 you removed — a floor, counted from monomorphised instantiations rather than grep, so I can pull the list if useful. And |
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
6b1745e to
153109c
Compare
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
153109c to
1ab89b7
Compare
1ab89b7 to
e9f189c
Compare
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
|
Thanks Amey Pawar (@ameyypawar). This is an interesting experiment as you essentially take the role of a reviewer, while my agent double-checks and fixes. And all that without any human review, so I am already very curious on how the actual review can be done efficiently. |
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
e9f189c to
2d9f5d9
Compare
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
2d9f5d9 to
5647e7f
Compare
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
5647e7f to
04a637e
Compare
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
04a637e to
2224378
Compare
CI exposed three remaining migration adaptations: gix-shallow doctests could not convert Exn through Box<dyn Error>, the ein init journey snapshots still expected the removed enum message, and lint rejected two mechanical expressions. Convert Exn explicitly in the doctest, update both init snapshots, and apply the two lint-preserving rewrites. Observed in test-doc, test-journey, and lint on PR #2847.
Migrate configuration failures to `gix-error` and adapt their consumers. Keep the standalone configuration-writing example compatible with the new error type. `just doc-tests` and the Windows documentation job failed with E0277 because `File::set_raw_value()` returns `Exn`, which deliberately does not implement `std::error::Error`. Convert it with `into_error()` before propagating it into the example's boxed error result. Validation: `cargo test -p gix --doc config_mut --locked` passes at this commit.
Use `gix::Error` at porcelain API boundaries and adapt consumers to its error classification and message comparisons. The `lint` job's `just clippy -D warnings -A unknown-lints --no-deps` command rejected four standalone configuration assertions with `clippy::cmp_owned`. The migrated error already supports direct comparison with static and formatted messages. Use that comparison instead of first calling `to_string()`, retaining the assertions about unavailable and unsupported configuration sources. Validation: targeted Clippy with warnings denied passes, and `GIX_TEST_IGNORE_ARCHIVES=1 cargo nextest run -p gix --test gix-init --locked` passes all 19 tests at this commit.
Keep the original `TryReserveError` inside the `OutOfMemory` I/O error so structured classification can distinguish allocator failure without treating malformed stream metadata as corruption.
The crate-by-crate migration retained operation-specific error aliases to
limit downstream churn. With the migration complete, those names only hide
the shared error types and keep otherwise empty API namespaces alive.
Use the underlying `gix_error` types directly throughout the workspace,
including indirect aliases, renamed exports, test helpers, and the URL fuzz
target. Remove namespaces and files that only held forwarding aliases, and
update documentation and migration guidance to use the canonical types.
Adjust the source locations recorded in error snapshots after deleting the
alias declarations.
Keep `gix::{Error, Exn}` and `gix::error` as the central facade, along with
unrenamed canonical re-exports, required associated types, concrete errors,
and aliases that add structure. Preserve each `Exn` parameter, conditional
error alternative, error message, and source chain. Include all downstream
adaptations in this breaking change so the stack remains buildable.
Validation: `etc/scripts/ci-check-local.sh --thorough` passed, including
4,245 workspace tests, the feature matrix, doctests, and all four CLI
journey configurations.
507b04e to
e85f087
Compare
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by Codex GPT-5.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Reported issue
Refs #2351
Summary
thiserroruse from workspace crates and exposes top-level failures throughgix::Errorgix-erroranyhowin the binaries and forwards thegix-error/anyhowfeature throughgixValidation
cargo check --workspace --all-targetscargo test -p gix-errorcargo test -p gix-error --features auto-chain-error --test auto-chain-errorcargo test -p gix --test gix revision::spec::