Skip to content

fix(github): accept canonical repo casing from versions host#10205

Closed
risu729 wants to merge 1 commit into
jdx:mainfrom
risu729:codex-20260602-183704-a1cf9b
Closed

fix(github): accept canonical repo casing from versions host#10205
risu729 wants to merge 1 commit into
jdx:mainfrom
risu729:codex-20260602-183704-a1cf9b

Conversation

@risu729

@risu729 risu729 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept GitHub owner/repo casing canonicalized by GitHub when validating mise-versions release asset URLs
  • keep the host/path/tag validation strict and add regression coverage for the reported mixed-case repo

Context

Addresses #10198. The cause is GitHub returning canonical repo casing in release asset URLs for a mixed-case API request.

Testing

  • cargo fmt --check
  • cargo test valid_github_
  • mise run lint-fix
  • isolated install smoke test with github:Dicklesworthstone/Destructive_command_guard@v0.5.6 no longer emits the invalid mise-versions asset URL warning

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e184b55d-4649-415f-b3bb-3f83213151b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@greptile-apps

greptile-apps Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a false-positive "invalid mise-versions asset URL" warning triggered when a user installs a GitHub tool whose repo name is mixed-case (e.g. Destructive_command_guard) but GitHub returns canonical lowercase casing in the release asset URLs it serves back.

  • Adds github_repo_segment_matches that calls eq_ignore_ascii_case instead of ==, applying it to both owner and repo path segments in valid_github_browser_download_url and valid_github_asset_api_url. Tag and host comparisons remain exact/strict.
  • Adds two regression assertions covering the exact Dicklesworthstone/Destructive_command_guard → destructive_command_guard casing mismatch that was reported.

Confidence Score: 5/5

The change is minimal and well-scoped: it only loosens casing for GitHub owner/repo segments in URL validation, matching GitHub's own case-insensitive treatment of those names, and leaves all other checks (host, tag, path structure) unchanged.

The fix is a single-line function wrapping eq_ignore_ascii_case applied in exactly two validation call sites, directly mirroring how GitHub itself treats owner/repo identifiers. The tag remains case-sensitive (correct, since git tags are case-sensitive), and host checks are untouched. Regression tests cover the exact reported failure scenario and there are no pre-existing tests this change could silently break.

No files require special attention.

Important Files Changed

Filename Overview
src/versions_host.rs Introduces case-insensitive GitHub owner/repo matching in URL validators, with regression tests for the mixed-case Destructive_command_guard repo; tag and host validation remain strict.

Reviews (1): Last reviewed commit: "fix(github): accept canonical repo casin..." | Re-trigger Greptile

@risu729

risu729 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the proxy-side fix in jdx/mise-versions#214.

The client-side casing tolerance was too narrow: the underlying issue also affects renamed or transferred repositories, so the release mirror should follow GitHub redirects and return asset URLs matching the requested backend slug.

This comment was generated by an AI coding assistant.

@risu729

risu729 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by jdx/mise-versions#214.

This comment was generated by an AI coding assistant.

@risu729 risu729 closed this Jun 4, 2026
@risu729 risu729 deleted the codex-20260602-183704-a1cf9b branch June 4, 2026 21:01
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.

1 participant