chore: fix incorrect panic messages for viper flag binding#431
chore: fix incorrect panic messages for viper flag binding#431chlins merged 1 commit intomodelpack:mainfrom
Conversation
Signed-off-by: Rishi Jat <rishijat098@gmail.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the error reporting mechanism by correcting misleading panic messages across several command-line tools. The update ensures that when an error occurs during the binding of command flags to the Viper configuration library, the resulting panic message precisely identifies the command involved, thereby enhancing diagnostic clarity without altering any core functionality. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes several incorrect panic messages related to Viper flag binding across multiple commands, improving clarity and consistency in error reporting. While reviewing these changes, I identified a critical bug in cmd/prune.go where flags from the rm command are being used incorrectly. Please see my specific comment for details on this issue.
There was a problem hiding this comment.
Pull request overview
This PR corrects copy/pasted panic message text used when binding Cobra flags to Viper across multiple CLI commands, improving the clarity/accuracy of error context without changing behavior.
Changes:
- Updated
viper.BindPFlagspanic messages to reference the correct command name. - Removed incorrect “bind cache … flags to viper” wording across affected commands.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/upload.go | Fix bind-to-viper panic message to reference upload. |
| cmd/tag.go | Fix bind-to-viper panic message to reference tag. |
| cmd/rm.go | Fix bind-to-viper panic message to reference rm. |
| cmd/push.go | Fix bind-to-viper panic message to reference push. |
| cmd/pull.go | Fix bind-to-viper panic message to reference pull. |
| cmd/prune.go | Fix bind-to-viper panic message to reference prune. |
| cmd/modelfile/generate.go | Fix bind-to-viper panic message to reference generate. |
| cmd/logout.go | Fix bind-to-viper panic message to reference logout. |
| cmd/login.go | Fix bind-to-viper panic message to reference login. |
| cmd/list.go | Fix bind-to-viper panic message to reference list. |
| cmd/inspect.go | Fix bind-to-viper panic message to reference inspect. |
| cmd/fetch.go | Fix bind-to-viper panic message to reference fetch. |
| cmd/extract.go | Fix bind-to-viper panic message to reference extract. |
| cmd/build.go | Fix bind-to-viper panic message to reference build. |
| cmd/attach.go | Fix bind-to-viper panic message to reference attach. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/cc @chlins |
Summary
Fix incorrect panic messages in multiple commands where
"bind cache ... flags to viper"was used.All messages now correctly reference their respective command
(e.g., "bind build flags to viper", "bind prune flags to viper", etc.).
No functional changes.
Improves clarity and consistency in error reporting.