Skip to content

fix(go): use configurable go_repo and retain tags with failed date fetches#7306

Merged
jdx merged 2 commits intofeat/go-created-atfrom
copilot/sub-pr-7305
Dec 15, 2025
Merged

fix(go): use configurable go_repo and retain tags with failed date fetches#7306
jdx merged 2 commits intofeat/go-created-atfrom
copilot/sub-pr-7305

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 15, 2025

The Go plugin hardcoded "golang/go" instead of using the MISE_GO_REPO setting, and silently dropped versions when commit date fetching failed.

Changes

  • Respect go_repo configuration: Extract repo from Settings.go_repo URL instead of hardcoding "golang/go" in both slow and fast paths
  • Retain all tags: Change GithubTagWithDate.date to Option<String> and return tags even when date fetch fails
  • Surface failures: Upgrade log level from debug! to warn! when commit date fetching fails
// Before: hardcoded repo, tags dropped on fetch failure
github::list_tags_with_dates("golang/go")
  .filter_map(|(name, date)| date.map(|d| GithubTagWithDate { name, date: d }))

// After: configurable repo, all tags retained
let repo = settings.go_repo.trim_start_matches("https://").trim_start_matches("github.com/");
github::list_tags_with_dates(repo)
  .map(|(name, date)| GithubTagWithDate { name, date })  // date is Option<String>

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Note

Use configurable Go repo for tag listing and keep all tags even when commit date fetch fails, logging failures at warn level.

  • Go plugin (src/plugins/core/go.rs):
    • Derives owner/repo from Settings.go_repo URL and uses it for both slow (list_tags_with_dates) and fast (list_tags) paths.
    • Propagates optional commit dates into VersionInfo.created_at when available.
  • GitHub client (src/github.rs):
    • Changes GithubTagWithDate.date to Option<String> and returns all tags regardless of date fetch success.
    • Raises log level from debug! to warn! on commit date fetch failures.

Written by Cursor Bugbot for commit 9bd8dc2. This will update automatically on new commits. Configure here.

- Extract repo name from Settings.go_repo instead of hardcoding "golang/go"
- Make GithubTagWithDate.date optional to handle fetch failures
- Keep all tags in results even when date fetch fails
- Upgrade debug to warn when commit date fetch fails

Co-authored-by: jdx <216188+jdx@users.noreply.github.com>
Copilot AI changed the title [WIP] Add created_at support to ls-remote --json fix(go): use configurable go_repo and retain tags with failed date fetches Dec 15, 2025
Copilot AI requested a review from jdx December 15, 2025 05:08
@jdx jdx marked this pull request as ready for review December 15, 2025 11:51
@jdx jdx merged commit e160f20 into feat/go-created-at Dec 15, 2025
2 checks passed
@jdx jdx deleted the copilot/sub-pr-7305 branch December 15, 2025 11:51
Comment thread src/plugins/core/go.rs
.trim_start_matches("http://")
.trim_start_matches("github.com/")
.trim_end_matches(".git")
.trim_end_matches('/');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: URL suffix stripping order causes incorrect repo extraction

The order of trim_end_matches(".git") followed by trim_end_matches('/') fails to correctly parse URLs ending with .git/. For example, https://github.com/golang/go.git/ would result in golang/go.git instead of golang/go. Reversing the order (trimming / first, then .git) would handle all combinations correctly. While the default URL works fine, users who configure custom URLs with both suffixes would get incorrect repo names passed to the GitHub API.

Fix in Cursor Fix in Web

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.

2 participants