errors: verify the GetRepoByName 404 marker against a live forge - unknown-repo enrichment rests on an unconfirmed body string #185
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#185
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from the #173 review. The owner_repo 404 enrichment distinguishes unknown-owner from known-owner/unknown-repo by the response body marker. The owner markers are corroborated (GetUserByName from the #173 incident; GetOrgByName from the earlier repo.go special case), but
GetRepoByName/ "repository does not exist" for the known-owner/unknown-repo case is an assumption - the unit tests feed the assumed body, so they prove the code, not the live forge.If a live Forgejo/Gitea returns a different body for that case, the enrichment degrades to the old raw-body passthrough (handler name leaks; no wrong message is ever produced), and the unknown-repo half of #173's acceptance is unmet in production.
To close: against a live forge (codeberg.org and/or the Gitea instance), request a known owner + nonexistent repo via an owner_repo-scoped call and record the actual 404 body; adjust
isRepoNotFoundBody(internal/gitea/client_errors.go) if it differs, and note the verified body strings in the test comments.Acceptance:
Live check done. GET /repos/sixfold_space/nonexistent-repo-check-185 against codeberg.org (authenticated, api v1) returns:
So the assumed Forgejo marker "repository does not exist" is wrong for live Codeberg, and "GetRepoByName" is absent too - isRepoNotFoundBody misses on both markers, meaning the #173 typed repo-404 path never fires here and the user gets the bare 404. Worse than unverified: the current check is corroborating nothing on this forge.
Note the Forgejo message is generic ("The target couldn't be found." presumably for any missing entity, and 404 also masks private repos), so body-text corroboration alone cannot distinguish repo-not-found from other 404s on Forgejo - the fix likely needs the endpoint context (repo-scoped request + this body = treat as repo-level not-found) rather than a more specific string. Caveat: only the authenticated variant was captured; the unauthenticated body may differ.
This unblocks the issue: the remaining work is updating the marker logic to the recorded evidence, with the unit fixture now carrying the real string.