Repository navigation
Conversation
16bf2a3 to
7355876
Compare
7355876 to
c447111
Compare
c447111 to
a5e0c92
Compare
a5e0c92 to
392ba96
Compare
392ba96 to
0866965
Compare
0866965 to
61c2fe9
Compare
zeroshade
left a comment
There was a problem hiding this comment.
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.
|
|
||
| // 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") |
There was a problem hiding this comment.
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.
| if err := initDBCClient(); err != nil { | ||
| return nil, fmt.Errorf("failed to initialize client: %w", err) | ||
| } | ||
| if len(dbcClient.Registries()) == 0 { |
There was a problem hiding this comment.
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.
Follow-up to #621. Projects that use only HTTP sources can now disable the built-in registries without adding a
[[registries]]entry.dbc search, report "no driver registries are configured; add a [[registries]] entry or enable the built-in registries".dbc syncanddbc lockcan use HTTP sources with an empty registry list. Registry-backed entries still require a configured registry.NewClientaccepts an empty merged registry list. Go and binding searches return no drivers and no error, as with an explicit empty list.