Skip to content

release testtools + minor fixes maybe - #3022

Draft
Sebastian Thiel (Byron) wants to merge 12 commits into
mainfrom
release-testtools
Draft

Sebastian Thiel (Byron) wants to merge 12 commits into
mainfrom
release-testtools

Conversation

@Byron

@Byron Byron commented Sep 25, 2026

Copy link
Copy Markdown
Member

Just for good measure. Also make releasing testtools easier.

@Byron Sebastian Thiel (Byron) changed the title release testtools release testtools + minor fixes maybe Sep 25, 2026
@Byron
Sebastian Thiel (Byron) force-pushed the release-testtools branch 2 times, most recently from 5865a58 to ccc5a7b Compare September 26, 2026 10:31
Comment thread gix-ref/src/store/file/packed.rs Fixed
<!-- agent -->
`just release gix-testtools` previously treated the crate name as another
recipe, preventing the release helper from targeting an arbitrary crate.

Accept zero or more arguments and forward them to `cargo smart-release`
using quoted positional arguments. This supports multiple crates and extra
options while preserving argument boundaries, the existing release flags,
and no-argument behavior.

Assisted-by: GPT 6.0
Co-authored-by: GPT 6.0 <codex@openai.com>
<!-- agent -->
The error migration left public `gix` methods, iterators, callbacks, and
configuration validators returning a mixture of exceptions, I/O errors,
custom error enums, and even the rejected input itself. Callers still had
to adapt these separately despite the common `gix::Error` boundary.

Use the crate-level `Result` throughout APIs defined by `gix`, including
fallible configuration inputs and owned `TryFrom` implementations. Keep
underlying causes, classifications, and diagnostic metadata available
through `gix::Error`. Configuration adapters accept arbitrary caller errors
without panicking or losing their causes. Object kind conversions report
validation errors. Re-exported plumbing APIs and error types required by
external traits retain their existing contracts.

Adapt `gitoxide-core` and `gix-tix` callers in the same breaking change,
removing explicit conversions that became identities.

Assisted-by: GPT 6.0
Co-authored-by: GPT 6.0 <codex@openai.com>
<!-- agent -->
GitButler needs to distinguish missing binary merge results, ambiguous object
prefixes, diff setup failures, unrelated histories, and repository discovery
outcomes. Broad classifications alone also match failures that these callers
must propagate, such as missing-directory I/O and rejected repository trust.

Remove `Class::Tagged` and expose non-exhaustive `Error` enums for these
operations. Share the merge-base enum across pair, many, and octopus methods,
and keep porcelain returns as `gix::Result`. Preserve candidate information,
native paths, diff resource details, requested commit IDs, and callee causes.

Add `gix_error::tag()` and make classifications identify the wrapped error or
the owner of a constant marker source. Keep traversal lazy and preserve its
order, duplicates, marker transparency, and original I/O kinds in both error
representations. Document typed recovery and wildcard propagation.

Validate merge-base input commits in the shared traversal path so missing
inputs cannot masquerade as unrelated histories, including fast paths and
octopus calls. Continue allowing absent parents for shallow histories and
empty successful results for `merge_bases_many*()` on unrelated histories.

Fix the recovery tests failing in Linux/ARM `test-fast` and Windows
`test-fixtures-windows` CI. Discovery examines the ceiling directory before
stopping, so its immediate child reports a stopping height of 2. Attribute
lookup converts Git paths to native paths, rejecting ill-formed UTF-8 on
Windows before reaching object lookup. Cover missing-object conversion with
a valid path everywhere and retain its non-UTF-8 path case on Unix.

Validation: 51 focused blob-platform and discovery tests pass with
`GIX_TEST_IGNORE_ARCHIVES=1`, excluding the unrelated macOS `cross_fs` test
because `hdiutil` cannot mount disk images in the local sandbox. The changed
files also pass `rustfmt --check`.

Assisted-by: GPT 6.0
Co-authored-by: GPT 6.0 <codex@openai.com>
<!-- Byron -->
rubber-stamp after scrolling through the diff top to bottom.
gix-error changes were refackiewed carefully.

<!-- agent -->
Use `gix_error::Result` and `gix_error::Error` at public plumbing boundaries
with erased or message-based exceptions so applications can use ordinary
`std::error::Error` handling while retaining concrete recovery errors,
causes, metadata, and caller locations. Apply this to public traits,
callbacks, iterator items, and re-exported APIs, and adapt their consumers
throughout the workspace. Preserve concrete public error signatures and
typed internal exceptions; let `bail!` convert to either result form.

Add `Error::into_exn()` for internal tree manipulation, including the
revision parser's delayed errors. Recover explicitly raised frames in
`auto-chain-error` mode and forward native source chains through nested
`Error` wrappers. Reuse existing boxed tree frames when adding context or
erasing errors to avoid redundant boxing, and keep context construction
independent of existing chain depth.

Remove repeated propagation wrappers from callers and update the migration
guide and repository conventions. Document the value of context that
explains an operation's intent or identifies user-controlled configuration,
including its raise location, even when failures are rare.

Remove `Class::Io` and the synthetic `io()` constructor so classifications
describe semantic failures. Retain `NotFound` and `OutOfMemory`
classifications for real I/O errors, and inspect their concrete causes for
the conservative and lenient retry policies.

Assisted-by: GPT 6.0
Co-authored-by: GPT 6.0 <codex@openai.com>
Public plumbing APIs now use `gix_error::Result`, so constructing typed
exceptions by default requires repeated erasure, conversion, and propagation
wrappers at their call sites.

Make `raise()` and `and_raise()` return `Error`, and make `or_raise()` and
`ok_or_raise()` return `Result`. Preserve the former behavior under explicit
`_typed` names and add `ResultExt::or_error()` for conversion without context.
Existing public errors pass through unchanged without allocating, while
context retains concrete causes, metadata, classifications, and caller sites.
Keep the erased helpers and inherent `Exn` operations unchanged.

Migrate callers and documentation together, preserving concrete public
exception signatures and typed internal boundaries. Remove redundant
conversion chains and wrappers for a net reduction of 434 lines.

Before rebasing, workspace compilation and strict Clippy passed across the
default, small, max-pure, and lean-async configurations. All 4,573 workspace
tests passed with isolated configuration and platform-permission retries
where needed. The `gix-error` suites and doctests passed in all three error
configurations, including allocation regressions.

After rebasing, workspace all-target compilation and strict Clippy pass,
along with 497 focused tests for error helpers, locking, paths, references,
and worktree configuration.

Keep `ResultExt` available without `blob-diff`. Removing `ErrorExt` left
its feature gate attached to the neighboring import, causing six `E0599`
errors in CI's MSRV async build and `test` job. The config path helper
uses the trait unconditionally.

Reproduced the async compilation failure locally. After removing the gate,
`cargo check --locked --offline -p gix --no-default-features` passes with
both `--features async-network-client,max-performance,sha1` and
`--features sha1`.
Resolving rebase and replay conflicts requires adapting the conflicted
commit, including when it carries `✨`. Allow `tix amend --index` after
resolving and staging conflicts, without creating a fixup solely for the
resolution.

This also permits recovery when `tix rebase continue` cannot consume staged
resolutions. Limit the exception to the resolution and required adaptations;
only humans may explicitly change review marks.

Validation: both skill copies passed `quick_validate.py`, and
`git diff --check` passed.
Passing a `#[track_caller]` constructor directly to `map_err()` records
the `FnOnce` shim in `core` as the caller. Use `or_error()` for native
error adapters in `gix`, `gix-actor`, and `gix-config` so diagnostics record
the adapter and use the usual exception formatting, including with
`tree-error`.

Keep `Error::from_boxed()` inside a closure for boxed trait-object errors,
which `ResultExt` does not accept. Add a regression for invalid branch
merge references and document when constructors still require closures.

Validation: the new regression failed before the fix. All 513 `gix` tests
pass with `blocking-network-client,interrupt`, both with and without
`tree-error`. The 387 `gix-actor`/`gix-config` tests also pass. Clippy passes
for all `gix` targets with these features, `--no-deps`, and `-D warnings`;
formatting and `git diff --check` pass.
The public plumbing APIs now return `gix_error::Result`, but many adapters
still explicitly map typed exceptions into public errors. Use `or_error()`
at these boundaries while retaining the concrete internal results.

Use `ok_or_raise()` for a missing object header and return `Ok(())` directly
from successful test callbacks. Remove redundant parentheses and combine
the touched `gix_error` imports. This simplifies 96 conversion sites and
removes 59 lines.

Validation: `cargo check --workspace --all-targets --locked --offline`
passes, as do 1,828 tests across the affected crates with both HTTP backends
enabled. Strict Clippy passes for their default targets and for the HTTP
backend libraries. Enabling strict Clippy for the HTTP test targets also
finds eight existing lints in untouched tests. Formatting and
`git diff --check` pass.
`Exn::into_chain()` repeatedly resolves native sources from their owning
root. Count `source()` calls during conversion, separately from the
subsequent check that every error survives: chains of 16, 32, and 64 errors
currently require 256, 1,024, and 4,096 calls.

Add an ignored regression requiring at most four source lookups per error.
Explicitly converting to a chain exercises flattening in every feature
configuration. Keep the test ignored until the implementation meets the
linear-work bound, so normal test runs remain green.

Reproduce the expected failure with:

```sh
cargo test --locked --offline -p gix-error --test error \
  native_source_flattening_is_linear -- --ignored --nocapture
```

Validation: the explicit regression fails with the counts above. Normal
tests pass with default features (118), `auto-chain-error` (122), and
`auto-chain-error,tree-error` (127). Clippy passes for all `gix-error`
targets with `auto-chain-error`, `--no-deps`, and `-D warnings`; linting
dependencies also encounters an existing `gix-tempfile` lint. Formatting
and `git diff --check` pass.
`Exn::into_chain()` resolved every native source from its owning root both
to check for a nested boundary and to create the next handle. A chain of
64 errors therefore required 4,096 `source()` calls during conversion.

Scan each native chain once when creating its owning handle, recording
its length and the prefix that inherits the frame location. Advancing a
handle then only increments its depth. Stop the scan at nested `Error`
boundaries as before, preserving breadth-first order and concrete error
types without extra allocations or dependencies.

Enable the existing regression: chains of 16, 32, and 64 errors now need
16, 32, and 64 source calls. Individual handle lookups still walk from
the owner; this change removes the repeated lookups during flattening.

Validation: `gix-error` tests pass with default features (119),
`auto-chain-error` (123), and `auto-chain-error,tree-error` (128), plus
16 doctests in each configuration. Clippy passes for all crate targets
with `auto-chain-error`, `--no-deps`, and `-D warnings`. Formatting and
`git diff --check` pass.
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.

3 participants