fix: provider API calls used the local folder name, not the actual repo name
Every place building an owner/repo slug for the provider API (refresh, release, add_collaborator) used path.file_name() as the repo segment - the local checkout's directory name. That's usually the same as the GitHub repo name, but not always: vulp's own folder is 'vulp', its GitHub repo is 'fxg', so every refresh silently 404'd fetching its own metadata/PRs/issues/CI (the cache carried an empty meta block with fetched_at: 0, never actually set). RepoSummary now also carries remote_repo_name, parsed from the git remote URL alongside owner (same source, same parsing approach) - the segment the provider actually knows the repo by. All four slug-building call sites now prefer it, falling back to the folder name only when there's no remote to parse it from. Verified: 'vulp refresh' now correctly hits dualfroz/fxg and the cache shows real stars/issues/PRs for vulp instead of the empty stub.
This commit is contained in:
1 parent
4b0a6e324f
commit
3eb922559c
3 files changed
+52
-13
No files matched your search
@@ -718,14 +718,16 @@ pub fn spawn_api_refresh(state: &mut HubState) {
|
||||
Ok(a) if !a.is_empty() => a,
|
||||
_ => { state.status_msg = Some("No accounts configured — vulp auth add".into()); return; }
|
||||
};
|
||||
// (display name = cache key, owner/basename slug for the API, branch for
|
||||
// (display name = cache key, owner/repo slug for the API, branch for
|
||||
// the CI-run lookup). Org-owned repos are reachable through the personal
|
||||
// token, so no owner filtering.
|
||||
// token, so no owner filtering. The repo name comes from the remote URL,
|
||||
// not the local folder name — they can differ (vulp's own folder is
|
||||
// "vulp", its GitHub repo is "fxg").
|
||||
let repos: Vec<(String, Option<String>, String, String)> = state.repos.iter()
|
||||
.map(|r| {
|
||||
let basename = r.path.file_name()
|
||||
.map(|b| b.to_string_lossy().to_string())
|
||||
.unwrap_or_else(|| r.name.clone());
|
||||
let basename = r.remote_repo_name.clone().unwrap_or_else(|| {
|
||||
r.path.file_name().map(|b| b.to_string_lossy().to_string()).unwrap_or_else(|| r.name.clone())
|
||||
});
|
||||
(r.name.clone(), r.owner.clone(), basename, r.branch.clone())
|
||||
})
|
||||
.collect();
|
||||
|
||||
Reference in new issue
Block a user