Skip to content

fix: improve handling of models not found on HF API and update relate…#31

Merged
wiebe-vandendriessche merged 4 commits intomainfrom
21-bug-scan-and-generate-write-a-bom-file-for-models-that-are-not-found-on-hugging-face
Apr 30, 2026
Merged

fix: improve handling of models not found on HF API and update relate…#31
wiebe-vandendriessche merged 4 commits intomainfrom
21-bug-scan-and-generate-write-a-bom-file-for-models-that-are-not-found-on-hugging-face

Conversation

@wiebe-vandendriessche
Copy link
Copy Markdown
Member

@wiebe-vandendriessche wiebe-vandendriessche commented Apr 30, 2026

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

…d messages

Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/aibomgen/generator/generator.go
Comment thread pkg/aibomgen/generator/generator.go Outdated
Comment thread pkg/aibomgen/generator/generator.go Outdated
Comment thread internal/ui/generate.go Outdated
Comment thread pkg/aibomgen/generator/generator_test.go
Copilot AI review requested due to automatic review settings April 30, 2026 09:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/aibomgen/generator/generator.go
Comment thread pkg/aibomgen/generator/generator.go
Comment thread pkg/aibomgen/generator/generator.go
Comment thread internal/ui/generate.go Outdated
Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmd/aibomgen-cli/generate.go
Comment thread pkg/aibomgen/generator/generator_test.go
Comment thread internal/ui/generate.go
@wiebe-vandendriessche wiebe-vandendriessche merged commit 781a40d into main Apr 30, 2026
13 checks passed
@wiebe-vandendriessche wiebe-vandendriessche deleted the 21-bug-scan-and-generate-write-a-bom-file-for-models-that-are-not-found-on-hugging-face branch April 30, 2026 13:43
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.

[Bug] scan and generate write a BOM file for models that are not found on Hugging Face

2 participants