Skip to content

feat: allow empty registry configurations - #622

Open
eitsupi wants to merge 3 commits into
feat/http-sourcefrom
feat/no-registries
Open

eitsupi wants to merge 3 commits into
feat/http-sourcefrom
feat/no-registries

Conversation

@eitsupi

@eitsupi eitsupi commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #621. Projects that use only HTTP sources can now disable the built-in registries without adding a [[registries]] entry.

exclude_builtin_registries = true

[drivers.example]
version = "1.2.0"
source = {
  type = "http",
  url = "https://example.com/v{version}/driver_{os}_{arch}.tar.gz",
  signing_key = false,
}
  • CLI: Commands that search the registry list, such as dbc search, report "no driver registries are configured; add a [[registries]] entry or enable the built-in registries". dbc sync and dbc lock can use HTTP sources with an empty registry list. Registry-backed entries still require a configured registry.
  • Go API and bindings: NewClient accepts an empty merged registry list. Go and binding searches return no drivers and no error, as with an explicit empty list.

@eitsupi
eitsupi added this pull request to stack #619 November 26, 2026 00:42
@eitsupi eitsupi changed the title feat/no registries feat: allow empty registry configurations Nov 26, 2026
@eitsupi
eitsupi requested review from amoeba and zeroshade November 26, 2026 00:55
@eitsupi
eitsupi marked this pull request as ready for review November 26, 2026 00:55
@eitsupi
eitsupi removed this pull request from stack #619 November 26, 2026 05:44
@eitsupi
eitsupi added this pull request to stack #624 November 26, 2026 05:45

@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.

LGTM. Putting the empty-list check in defaultGetDriverRegistry covers every command that reads the registry index with one clear error, while add, sync and lock only need the index for drivers without a source, so all-HTTP projects work. The library now treats an empty list from config files the same as an explicitly passed empty list. Two small nits are inline.

Comment thread cmd/dbc/main.go

// errNoRegistries is returned where a command needs the drivers of the
// registries but the configuration excludes every one of them.
var errNoRegistries = errors.New("no driver registries are configured; add a [[registries]] entry or enable the built-in registries")

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.

nit: "enable the built-in registries" can't be done from a project when the global config sets exclude_builtin_registries = true; a project's false is ignored with a warning. Something like "add a [[registries]] entry or remove exclude_builtin_registries = true" would be accurate in both cases.

Comment thread cmd/dbc/main.go
if err := initDBCClient(); err != nil {
return nil, fmt.Errorf("failed to initialize client: %w", err)
}
if len(dbcClient.Registries()) == 0 {

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.

Optional: in an all-HTTP project, a registry-backed driver added by mistake makes sync/lock fail with this generic message. Wrapping it at the planning call site with the driver name would make the cause easier to find.

This branch was successfully deployed

1 active deployment
snapshot — 61c2fe9a Deployed Nov 26, 2026 by eitsupi via snapshot #1389
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