Skip to content

fix: panic in search with invalid local manifests - #282

Merged
amoeba merged 5 commits into
mainfrom
bad-search-panic
Jan 29, 2026
Merged

fix: panic in search with invalid local manifests#282
amoeba merged 5 commits into
mainfrom
bad-search-panic

Conversation

@amoeba

@amoeba amoeba commented Jan 29, 2026

Copy link
Copy Markdown
Member

Fixes a crash a user could encounter if they ran dbc search with an invalid driver manifest in a config dir. This can happen because when we run search we also enumerate all of the drivers on the users system so we have to load all the manifests. The fix here makes decodeManifest error if name and version aren't set which may also be fixing some latent bugs in other commands.

Closes #281

@amoeba
amoeba requested review from esadek and zeroshade January 29, 2026 21:52
@amoeba amoeba changed the title fix: fix panic in search with invalid local manifests fix: panic in search with invalid local manifests Jan 29, 2026

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

Aside from my nitpick, I would ensure that when we error with this we should make sure to output the path to the manifest that failed. Otherwise, looks good to me

Comment thread config/config.go Outdated
@amoeba

amoeba commented Jan 29, 2026

Copy link
Copy Markdown
Member Author

That's a good point. I double-checked where we call decodeManifest and the call site where I think we should print the path we already do. I added an assertion for that in e6549fe. The other place we call decodeManifest I don't think we need to change it.

@amoeba
amoeba requested a review from zeroshade January 29, 2026 22:10
@amoeba

amoeba commented Jan 29, 2026

Copy link
Copy Markdown
Member Author

Merging.

@amoeba
amoeba merged commit 5f74e43 into main Jan 29, 2026
11 checks passed
@amoeba
amoeba deleted the bad-search-panic branch January 29, 2026 22:13
zeroshade added a commit that referenced this pull request Apr 17, 2026
Fixes a crash a user could encounter if they ran `dbc search` with an
invalid driver manifest in a config dir. This can happen because when we
run search we also enumerate all of the drivers on the users system so
we have to load all the manifests. The fix here makes `decodeManifest`
error if name and version aren't set which may also be fixing some
latent bugs in other commands.

Closes #281

---------

Co-authored-by: Matt Topol <zotthewizard@gmail.com>
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.

Runtime error from dbc search

2 participants