Skip to content

feat: select the registry of a driver with source in dbc.toml - #599

Merged
eitsupi merged 2 commits into
mainfrom
feat/driver-registry-source
Nov 23, 2026
Merged

eitsupi merged 2 commits into
mainfrom
feat/driver-registry-source

Conversation

@eitsupi

@eitsupi eitsupi commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Stacked on #598. Since #584, a driver comes from the highest-priority registry that has a matching version, so which registry serves a driver depends on the order of the registries and on what each one publishes at the time.
This lets a driver list name the one registry a driver comes from, like a dependency's registry in Cargo or [tool.uv.sources] in uv.

[[registries]]
url = "https://drivers.acme.example.com"
name = "acme"

[drivers.snowflake]
source = { type = "registry", name = "acme" }

[drivers.flightsql]
source = { type = "registry", url = "https://dbc-cdn.columnar.tech" }
  • Selection: name refers to a [[registries]] entry in the same file (a project cannot refer to a name from the user config); url selects a configured registry by the identity dbc.lock records (no user information, query or fragment). The source must bind to exactly one configured registry, since registries that differ only in query cannot be told apart in the lockfile. type is required so other source types can be added later (feat!: new lockfile format with GitHub release support via Packslip (PoC) #497).
  • Built-in registries: https://dbc-cdn.columnar.tech and https://dbc-cdn-private.columnar.tech have no configured name, so a source selects them by url, as flightsql does above. Declaring one in [[registries]] with a name also works.
  • No fallback: the driver is resolved from that registry's index alone. A missing driver, a missing version or a failed fetch is an error, and the merged index is not fetched when every driver has a source.
  • Lockfile: nothing new is recorded; the lock keeps the registry identity. If the source selects another registry than the lock entry, dbc sync stops and dbc lock resolves the driver again (the pinned signer is still compared as before). Naming the same registry another way keeps the entry.
  • CLI: dbc add --registry <name|url> records the source, and dbc add without it keeps a driver's existing source. dbc install --registry <name|url> installs from one registry of the user config, and installs again when the same version is already installed, since an installed driver does not record its registry. GetDriverList honors the source too. Client.Install and the bindings have no registry option yet.
  • Names: a registry name must be unique within its file, and a configured name now takes precedence over the name a registry's index gives itself, so the name used in source is also the one dbc search shows.

@eitsupi
eitsupi added this pull request to stack #600 November 21, 2026 03:30
@eitsupi eitsupi changed the title feat: select the registry of a driver with source in dbc.toml feat: select the registry of a driver with source in dbc.toml Nov 21, 2026
@eitsupi
eitsupi requested review from amoeba and zeroshade November 21, 2026 04:34
Base automatically changed from feat/exclude-builtin-registries to main November 23, 2026 16:34
A driver in dbc.toml can name the only registry it is resolved from:

    [drivers.snowflake]
    source = { type = "registry", name = "acme" }

The name refers to a [[registries]] entry in the same file; a url selects a
configured registry by its lock file identity. The driver is resolved from
that registry's index alone, so a missing driver, a missing version or a
failed fetch is an error instead of a fallback to another registry. A
source must bind to exactly one configured registry.

When the source selects another registry than the lock file records, dbc
sync stops and dbc lock resolves the driver again. dbc add --registry
records a source and dbc add keeps an existing one; dbc install --registry
installs from one registry of the user config. GetDriverList honors the
source as well.

Registry names must be unique within a file, and a configured name now
takes precedence over the name a registry's index gives itself.
An installed driver does not record the registry it came from, so the same
version from the selected registry may be another package. Also keep the
whole registry configuration when fetching the index of one registry.

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source matches a registry by the same identity the lock file records and refuses ambiguous matches; there is no fallback; a source change stops dbc sync and is re-resolved by dbc lock; dbc add detects a concurrent change of a source or what its name refers to. go test ./... passes locally. LGTM.

@eitsupi
eitsupi merged commit 0a3c844 into main Nov 23, 2026
30 checks passed
@eitsupi
eitsupi deleted the feat/driver-registry-source branch November 23, 2026 22:08
eitsupi added a commit that referenced this pull request Nov 25, 2026
Addresses the review of #595: with #584, a registry that serves a driver
name also serves it for every driver list that does not pin it, so
adding a registry with its own key adds a code signer for every name it
lists. This keeps the #584 fallback, which is what lets a driver move
between the built-in registries, but only between registries with the
same signer, and makes the choice fail when it cannot be checked.

- **Same signer:** when several registries list a driver name, whatever
their versions and platforms, they must all verify their packages with
the same signer. Otherwise `ResolvePackage` returns a
`SignerConflictError` that names the registries and their signers,
before any package is selected or downloaded, and the CLI suggests a
`source` in `dbc.toml` (#599) or `--registry`. Registry priority stays
project → user → built-in.
- **Missing index:** a registry whose index cannot be fetched or read
might list the driver too. Its signer is known from its configuration,
so `ResolvePackage` returns `ErrIncompleteIndex` only if that signer
differs from the signer of the registries that list the driver (or, if
none does, from another failed registry's signer), or if it cannot
identify the failed registry or its signer. A failed registry with the
same signer is skipped, as before this PR. This applies to new
resolution in `dbc add`, `dbc install`, `dbc lock`, `dbc sync`,
`Client.Install` and `Resolve` in the bindings. Replaying a lock entry
that still satisfies the driver list, drivers with a `source` and `dbc
install --registry` only need the registries they use.
- **API:** `ResolvePackage` (unreleased, from #584) takes the error that
`Search` returned with the drivers. `Search` reports each failed
registry as a `RegistryIndexError` with the registry's configuration;
its message leaves out the user information and query of the registry
URL, also where the HTTP error repeats the request URL.
- **Bindings' `Resolve`:** invalid registry metadata during package
selection, such as a malformed archive hash or a missing version, now
returns an error. If a listed driver has no eligible version, `Resolve`
still returns its versions without `latest`. Previously both cases
returned the same kind of result, even though `Install` already rejected
the same invalid metadata on the host platform.
- **Relation to #595:** there is no per-registry key setting yet, so
every registry is verified with the built-in Columnar key: no conflict
can occur and no failed index fails the signer check until #595 lands.
#595 will derive the identity from each registry's signing policy (the
digest of the configured certificate for a key, and an identity of its
own for each unsigned registry), marked with TODO comments. Once #595
lands, a failed registry with a different signer can block resolution of
drivers without a `source`. This should not be released before #595.

This branch was previously deployed

1 inactive deployment
snapshot — 4fe49174 Deployed Nov 23, 2026 by zeroshade via snapshot #1333
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.

2 participants