Repository navigation
refactor: add internal/api operation layer shared by language bindings - #545
Merged
Merged
Conversation
zeroshade
force-pushed
the
refactor/internal-api
branch
from
October 28, 2026 23:29
58d46bd to
01efff7
Compare
zeroshade
force-pushed
the
refactor/internal-api
branch
from
October 29, 2026 17:07
01efff7 to
3d079ca
Compare
zeroshade
force-pushed
the
refactor/internal-api
branch
from
November 3, 2026 18:21
3d079ca to
4c173a7
Compare
zeroshade
marked this pull request as ready for review
November 3, 2026 19:27
amoeba
approved these changes
Nov 3, 2026
zeroshade
added a commit
that referenced
this pull request
Nov 4, 2026
Address review on #545: url.Parse alone accepts scheme- and host-less strings. Extract validateRegistryEntry's checks into internal/registryurl and use it for baseURL and credential URLs. Drop the inaccurate panic comment and document why credentials match by host.
zeroshade
added a commit
that referenced
this pull request
Nov 4, 2026
…ries Brings in internal/registryurl from #545; explicit registries, baseURL, and injected credential URLs now all validate through registryurl.Parse, replacing the local parseRegistryURL/absoluteURL helpers.
zeroshade
force-pushed
the
refactor/internal-api
branch
from
November 4, 2026 15:23
dc2f0eb to
9586a44
Compare
Changes: - `Resolve` now sets `latest` to the newest stable version that has a package for the requested platform. Before, it used `GetPackage(nil, ...)`, which left `latest` empty whenever the newest stable version globally had no package for that platform. - `Search` now fetches the unfiltered driver list and filters it itself, using the same path/title substring match as `Client.Search`. If some registries answer but nothing matches, it returns an empty `drivers` list with a `warning`. It only returns an error when no registry returned anything. - Added tests for a partial registry outage with no matches, and for picking `latest` when the newest stable version doesn't support the requested platform.
Changes: - `api.Search` and `api.Resolve` now decide that every registry failed by comparing the number of per-registry errors with the number of configured registries. They no longer use `len(drivers) == 0` as a stand-in. So when one registry has a valid empty index and another is down, you get an empty result with a `Warning` instead of an error. - `dbc.Client.Search` now builds its error with a single `errors.Join` at the end. Before, it joined one error at a time, which nested them. Now each failed registry adds exactly one entry, so the count above is reliable. - `api.Search` goes back to calling `c.Search(ctx, pattern)` directly, which removes the copy of the filtering logic. - Added `TestSearchPartialFailureEmptyIndex`, which pairs a registry with an empty index and one that's down. Build, `go vet` and the full `go test ./...` suite pass.
Address review on #545: url.Parse alone accepts scheme- and host-less strings. Extract validateRegistryEntry's checks into internal/registryurl and use it for baseURL and credential URLs. Drop the inaccurate panic comment and document why credentials match by host.
zeroshade
force-pushed
the
refactor/internal-api
branch
from
November 4, 2026 17:22
9586a44 to
c840d56
Compare
Member
|
I had Opus 5.5 do a review across my manual reviews and it caught that there's no test for disabling signature verification here. Can we check? |
Member
Author
|
Good catch, there wasn't one at this layer (the CLI's |
amoeba
approved these changes
Nov 4, 2026
zeroshade
added a commit
that referenced
this pull request
Nov 4, 2026
The WASM bindings drop their local DTOs and call `internal/api`, so they
share one implementation with the C API. npm `install(name, location, {
allowUnsigned })` exposes the signature opt-out.
Stacked on #545.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
internal/api: search / resolve / install / uninstall / list implemented once overdbc.Client, for the WASM and C bindings that follow. Install/uninstall/list take an explicit directory or theuser/systemconfig level.NewClientreturns an error for a malformedbaseURLinstead of panicking.Also sets
toolchain go1.27.3ingo.modfor CI and releases (thegominimum is unchanged).Stacked on #544.