You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warn when mise-versions GitHub metadata lookups hit rate limits or other non-404 failures
include the release/attestation lookup context before falling back to the GitHub API
keep 404 cache misses silent
Why
When mise-versions release metadata fails transiently, mise falls back to the GitHub API. If CI has lost or lacks a GitHub token, the visible failure is a GitHub 403 with no indication that the versions-host lookup failed first. These warnings make that fallback path visible.
Test plan
cargo fmt
cargo test versions_host
Note
Low Risk
Logging-only change in optional metadata fetch paths; 404 handling and fallback semantics are unchanged.
Overview
Improves visibility when mise-versions GitHub metadata lookups fail and mise silently falls back to the GitHub API.
github_release and github_attestations now pass context-specific labels (e.g. GitHub release metadata for {repo}@{tag}) into shared fetch_optional_json handling. 429 rate limits and other non-404 errors are logged at warn with explicit “falling back” wording instead of debug. 404 responses remain silent (treated as a cache miss).
No change to fallback behavior—only logging and error-message context so CI failures (e.g. GitHub 403 without a token) are easier to trace back to a prior versions-host failure.
Reviewed by Cursor Bugbot for commit 77fd1d2. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Chores
Enhanced diagnostic logging for rate-limit and lookup failures with more explicit fallback indicators for improved observability.
This change improves debugging observability for GitHub API lookups. Two functions now format per-request labels with repository and version information, while the underlying fetch function elevates transient failure messages from debug to warn level, making rate-limit and lookup failures more visible during troubleshooting.
Changes
GitHub API Observability
Layer / File(s)
Summary
Request labels and fallback logging src/versions_host.rs
github_release and github_attestations construct specific labels containing {repo}@{tag} and {repo}@{digest} respectively; fetch_optional_json now logs 429 and non-429 lookup failures at warn! level with "falling back" messaging instead of debug!, while returning Ok(None) on errors.
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
🐰 Labels now sparkle with specifics clear,
{repo}@{tag} brings debugging cheer!
Warnings now shine where silence once lived,
Better observability the code receives.
The title clearly and specifically describes the main change: adding warnings when versions host metadata lookups fall back, which is the primary objective of the PR.
Docstring Coverage
✅ Passed
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches📝 Generate docstrings
Create stacked PR
Commit on current branch
🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch fix/warn-versions-host-metadata-fallback
Comment @coderabbitai help to get the list of available commands and usage tips.
This PR improves observability in the fetch_optional_json helper by (1) embedding {repo}@{tag} / {repo}@{digest} context in the log label and (2) promoting debug! to warn! for rate-limit and non-404 failures so callers can see when the fallback path to the GitHub API is being taken.
Labels passed to fetch_optional_json now include the specific repo and tag/digest, making warning messages actionable without needing to enable debug logging.
Non-404 failures (429 rate-limit and all other errors) now emit warn! instead of debug!, surfacing otherwise-invisible fallback events — especially useful in CI environments without a GitHub token.
Confidence Score: 5/5
Safe to merge — the only behavioral change is promoting two log-level calls from debug to warn, with no mutations to control flow or return values.
The diff is minimal: two label format strings gain context and two debug! macro calls become warn!. Control flow, error propagation, and all Ok(None) / Ok(Some(_)) paths are unchanged. The 404 silent path is explicitly preserved. The new warning text correctly describes the fallback and includes {err:#} for the generic case. No edge cases or regressions are apparent.
No files require special attention.
Important Files Changed
Filename
Overview
src/versions_host.rs
Adds repo/tag context to fetch_optional_json labels and promotes debug→warn for 429 and generic error branches, making the fallback path visible when mise-versions is unavailable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
When mise-versions release metadata fails transiently, mise falls back to the GitHub API. If CI has lost or lacks a GitHub token, the visible failure is a GitHub 403 with no indication that the versions-host lookup failed first. These warnings make that fallback path visible.
Test plan
Note
Low Risk
Logging-only change in optional metadata fetch paths; 404 handling and fallback semantics are unchanged.
Overview
Improves visibility when mise-versions GitHub metadata lookups fail and mise silently falls back to the GitHub API.
github_releaseandgithub_attestationsnow pass context-specific labels (e.g.GitHub release metadata for {repo}@{tag}) into sharedfetch_optional_jsonhandling. 429 rate limits and other non-404 errors are logged atwarnwith explicit “falling back” wording instead ofdebug. 404 responses remain silent (treated as a cache miss).No change to fallback behavior—only logging and error-message context so CI failures (e.g. GitHub 403 without a token) are easier to trace back to a prior versions-host failure.
Reviewed by Cursor Bugbot for commit 77fd1d2. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit