clone: "repository not found" hides the host, the path, and the cause #876

Open
opened 2026-10-22 22:13:08 +00:00 by hexajon · 0 comments
Owner

madtea clone forkingrobot fails with only this:

Error: repository not found

That tells me nothing I can act on. I do not know which forge it asked, which path it tried, or why git refused.

What happens

  • A name with no / takes the shorthand path, because it has no :// and no git@ (internal/service/git/clone.go:165-167).
  • The shorthand path builds <forge>/forkingrobot.git, with no owner in the path (internal/service/git/clone.go:190).
  • When the clone fails, mapCloneError swaps any git message that contains "not found" or "does not exist" for the bare text repository not found (internal/service/git/clone.go:765-766). The forge host, the path, and git's own reason are all dropped.

This breaks a rule I already set: errors name the host and the fix (ADR 0025, section 4). The path in the error must still carry no credential (ADR 0013).

For comparison, gh repo clone REPO and tea clone REPO both fill in the logged-in user as the owner when the name has no / (gh pkg/cmd/repo/clone/clone.go:51,151; tea cmd/clone.go:77).

Acceptance criteria

  • A failed clone names the forge host that madtea asked.
  • A failed clone names the owner/repo path that madtea tried, with no credential in it.
  • A failed clone includes git's own one-line reason.
  • When the input has no /, the error says that the owner is missing, and shows the owner/repo form to use.
  • A test covers each line above, for the shorthand path and the full-URL path.
`madtea clone forkingrobot` fails with only this: ```text Error: repository not found ``` That tells me nothing I can act on. I do not know which forge it asked, which path it tried, or why git refused. ## What happens - A name with no `/` takes the shorthand path, because it has no `://` and no `git@` (`internal/service/git/clone.go:165-167`). - The shorthand path builds `<forge>/forkingrobot.git`, with no owner in the path (`internal/service/git/clone.go:190`). - When the clone fails, `mapCloneError` swaps any git message that contains "not found" or "does not exist" for the bare text `repository not found` (`internal/service/git/clone.go:765-766`). The forge host, the path, and git's own reason are all dropped. This breaks a rule I already set: errors name the host and the fix ([ADR 0025](docs/decisions/0025-origin-first-forge-resolution.md), section 4). The path in the error must still carry no credential ([ADR 0013](docs/decisions/0013-credential-storage-model.md)). For comparison, `gh repo clone REPO` and `tea clone REPO` both fill in the logged-in user as the owner when the name has no `/` (gh `pkg/cmd/repo/clone/clone.go:51,151`; tea `cmd/clone.go:77`). ## Acceptance criteria - [ ] A failed clone names the forge host that madtea asked. - [ ] A failed clone names the owner/repo path that madtea tried, with no credential in it. - [ ] A failed clone includes git's own one-line reason. - [ ] When the input has no `/`, the error says that the owner is missing, and shows the `owner/repo` form to use. - [ ] A test covers each line above, for the shorthand path and the full-URL path.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#876
No description provided.