Repository navigation
feat: expose resolve warnings in C and Rust - #633
Conversation
7be66a2 to
5392bbf
Compare
zeroshade
left a comment
There was a problem hiding this comment.
LGTM. Reuses the existing DBC_FIELD_WARNING plumbing, RegistryIndexError.Error() already redacts registry credentials, and ResolveResult is #[non_exhaustive] so the new field is non-breaking. Two non-blocking nits:
-
The new Rust test only checks that a warning exists.
resolve_warns_about_a_skipped_registry_with_the_same_signerassertswarning.is_some(). Asserting that it names the unavailable registry's host would catch a regression that reports the wrong failure or a bare string. -
DBC_FIELD_WARNINGnow has two meanings. Fordbc_searchit means a partial result; fordbc_resolveit means skipped same-signer registries. The per-function table incapi/exports.gocovers this, but the comment on#define DBC_FIELD_WARNINGitself doesn't mention resolve.
Also document on DBC_FIELD_WARNING what the field means for dbc_search and for dbc_resolve.
b161651 to
95b87e6
Compare
|
Both done: the Rust test now checks that the warning names the unavailable registry (by port), and the |
|
Thanks, both nits are addressed. The Rust test now checks that the warning names the unavailable registry's port and not the available one. The |
dbc used registry priority for overrides (#360), and #584 kept that order when choosing the first registry with a matching version. This gave order precedence over version, much as uv's default `first-index` does to limit dependency confusion. The review of per-registry signing keys (#595) showed that registry order could also determine the signer, so #601 made cross-signer name collisions an error during implicit resolution. Within that signer boundary, dbc now picks the highest eligible version across registries, as pip does across indexes, so drivers keep getting updates after moving to another registry. - **Selection.** A candidate must satisfy the version requirements and have builds for every required target in one record. Registry order breaks ties at the highest SemVer precedence. In the winning registry, a second eligible record of the same precedence or any duplicate of the winning full version is an error. Exact requests include build metadata and reject duplicate exact records even when none covers all required targets. Errors in a selected artifact stop resolution. - **CLI.** New resolutions can select a newer version from a lower-priority registry. To take a driver from a specific registry, set its `source`. Compatible lock entries still replay from their recorded source. Successful CLI selections warn on stderr when a same-signer index was skipped. Registry version constraints now reject build metadata. - **v1 lock files.** If the recorded version is no longer listed, migration stops with or without `platforms`. A recorded version that lacks a build for a declared platform is still resolved again. - **Go API.** `Client.FetchIndex`, `Client.FetchRegistryIndex`, and `SelectRegistry` replace `SigningOperation.ResolvePackage`. Requests take a constraint or an exact version. The project planner decides whether to keep a locked version. `Index` aliases an internal type so public callers get complete snapshots from the client and cannot pass filtered search results; tests outside the module can serve an index through `NewClient` with `WithRegistries` and `WithHTTPClient`. - **Bindings.** `Resolve` reports the highest eligible stable version as `latest` and lists versions for the requested platform across reachable same-signer registries, including prereleases. Go and npm-wasm expose skipped indexes in `warning`. C and Rust warning support follows in #633. `Client.FetchRegistryIndex` requires exactly one configured endpoint match before fetching. This prevents it from picking a signing policy by list order when `WithRegistries` lists the same endpoint under different policies. The released `Driver` methods remain single-driver lookups. #634 aligns `GetPackage` with exact version matching and deprecates `GetWithConstraint`.
Follow-up to #631, which added resolve warnings to Go and npm-wasm.
dbc_resolvesucceeds after skipping an unavailable same-signer index, callers can read the warning withdbc_list_info(result, DBC_FIELD_WARNING).ResolveResult::warningexposes the same field as anOption<String>. The existing#[non_exhaustive]annotation permits this addition.