fix: improve handling of models not found on HF API and update relate…#31
Conversation
…d messages Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
This PR improves aibomgen behavior when Hugging Face model metadata cannot be retrieved (not found / unauthorized), and updates CLI/UI messaging to better reflect “possible” detections and “no output written” outcomes.
Changes:
- Skip BOM generation when the HF model API indicates the model is not retrievable (404/401/403) in generator flows.
- Add unit tests covering skip behavior for 404 and 401 cases.
- Update UI/workflow messages (“possible models”, “No BOMs written.”) and adjust per-model outcome rendering.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/aibomgen/generator/generator.go | Skips BOM generation when HF API returns not-found/unauthorized responses. |
| pkg/aibomgen/generator/generator_test.go | Adds test cases asserting models are skipped on 404/401 HF API responses. |
| internal/ui/generate.go | Changes “no output” messaging to “No BOMs written.” rendered as an error. |
| cmd/aibomgen-cli/scan.go | Updates workflow task labels/messages to emphasize “possible” AI imports/models. |
| cmd/aibomgen-cli/generate.go | Updates workflow messaging and per-model outcome strings for not-found/private cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
No BOM file is created for a model that returns 404 (turns out it was 401 or 403) from the Hugging Face API. The CLI reports the model as not found and exits without writing any output file.
Related issue
Closes #21
Type of change
Bug fix