fix(providers): pagination, owner listing fallback, URL and name validation

- pages stop on total/Link/empty page, not on a short page
- GitHub/Gitea owner listing falls back to /user/repos (collaborator repos) and says so
- url module: plain repo names, https/ssh/scp URLs on the provider host, canonical https

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Sonnet 5.5 committed 2026-11-16 18:53:10 +01:00
1 parent b875a41b4d
commit f1509c3d65
6 files changed
+303 -29

No files matched your search

+8 -4
View File
@@ -84,10 +84,14 @@ impl Provider for Gitea {
};
let items = match self.http.pages(&path, 50, "limit") {
Ok(v) => v,
// Not an organisation: another user's public repos.
Err(Error::Api { status: 404, .. }) if !owner.eq_ignore_ascii_case(login) => self
.http
.pages(&format!("/users/{owner}/repos"), 50, "limit")?,
// Not an organisation (a user, or an org the token cannot see): say so, and take
// what the token can see under that name, private repos it collaborates on included.
Err(Error::Api { status: 404, .. }) if !owner.eq_ignore_ascii_case(login) => {
eprintln!(
"grove: /orgs/{owner} not found; listing the repositories you can see owned by {owner}"
);
self.http.pages("/user/repos", 50, "limit")?
}
Err(e) => return Err(e),
};
Ok(items