Skip to content

handle empty HF_ENDPOINT#2851

Merged
rhatdan merged 1 commit into
containers:mainfrom
mikebonnet:empty-HF_ENDPOINT
Jul 19, 2026
Merged

handle empty HF_ENDPOINT#2851
rhatdan merged 1 commit into
containers:mainfrom
mikebonnet:empty-HF_ENDPOINT

Conversation

@mikebonnet

Copy link
Copy Markdown
Collaborator

Gracefully handle the case where HF_ENDPOINT is defined but empty by returning the default value.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@mikebonnet
mikebonnet temporarily deployed to macos-installer July 17, 2026 22:52 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 820df96a-cad7-4dbb-8557-998224b85897

📥 Commits

Reviewing files that changed from the base of the PR and between 99e159b and 80c5e4f.

📒 Files selected for processing (3)
  • ramalama/transports/huggingface.py
  • test/e2e/test_inspect.py
  • test/unit/test_huggingface.py

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved Hugging Face endpoint configuration when the HF_ENDPOINT setting is empty.
    • The default Hugging Face service is now used reliably when no valid endpoint is provided.
    • Trailing slashes in configured endpoints continue to be handled correctly.
  • Tests

    • Added coverage for empty endpoint configuration scenarios.

Walkthrough

HF_ENDPOINT now falls back to the default Hugging Face registry when unset or empty after trimming trailing slashes. Unit and end-to-end test handling reflects this behavior.

Changes

Hugging Face endpoint resolution

Layer / File(s) Summary
Endpoint fallback and validation
ramalama/transports/huggingface.py, test/unit/test_huggingface.py, test/e2e/test_inspect.py
huggingface_endpoint() and inspection setup fall back to the default endpoint for empty values, with unit coverage for an explicitly empty HF_ENDPOINT.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: bmahabirbu, cgruver, rhatdan

Poem

I’m a bunny with an endpoint to mend,
Empty strings now reach the proper end.
Trim the slash, restore the way,
Tests hop in to guard the day.
https://huggingface.co
A sturdy burrow for the flow!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: handling an explicitly empty HF_ENDPOINT value.
Description check ✅ Passed The description accurately states the fix for an empty HF_ENDPOINT and matches the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Gracefully handle the case where HF_ENDPOINT is defined but empty by returning
the default value.

Signed-off-by: Mike Bonnet <mikeb@redhat.com>

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

LGTM

@rhatdan
rhatdan merged commit b3ab509 into containers:main Jul 19, 2026
36 checks passed
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.

3 participants