errors: verify the GetRepoByName 404 marker against a live forge - unknown-repo enrichment rests on an unconfirmed body string #185

Closed
opened 2026-07-17 02:46:13 +00:00 by hexajon · 1 comment
hexajon commented 2026-07-17 02:46:13 +00:00 (Migrated from codeberg.org)

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:

  • the known-owner/unknown-repo 404 body is captured from at least one live forge and matches (or now matches) isRepoNotFoundBody
  • test comments cite the live-verified strings
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: - [ ] the known-owner/unknown-repo 404 body is captured from at least one live forge and matches (or now matches) isRepoNotFoundBody - [ ] test comments cite the live-verified strings
hexajon commented 2026-07-17 15:57:20 +00:00 (Migrated from codeberg.org)

Live check done. GET /repos/sixfold_space/nonexistent-repo-check-185 against codeberg.org (authenticated, api v1) returns:

404 {"message":"The target couldn't be found.","url":"https://codeberg.org/api/swagger","errors":[]}

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.

Live check done. GET /repos/sixfold_space/nonexistent-repo-check-185 against codeberg.org (authenticated, api v1) returns: ``` 404 {"message":"The target couldn't be found.","url":"https://codeberg.org/api/swagger","errors":[]} ``` 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.
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#185
No description provided.