Loading
Return 404 for Orbit archive and changed_paths when repository is missing
What does this MR do and why?
The Orbit internal archive endpoint returned a 500 when a project's repository was missing. It now returns a 404. The changed_paths GET route had the same problem when the left revision was set, so it gets the same fix.
During an incident, the indexer saw archive 500s that all turned out to be missing repositories. It couldn't tell them apart from real server errors.
References
Screenshots or screen recordings
N/A, API-only change.
How to set up and validate locally
- Create a project without a repository.
- Request
GET /api/v4/internal/orbit/project/:id/repository/archivewith a valid Orbit JWT. - Expect 404 instead of 500.
- Request
GET .../repository/changed_pathswith a non-blankleft_tree_revisionand expect 404 too.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
Agent context
- Archive route: added the missing-repository error to the existing rescue in
ee/lib/api/internal/orbit.rb. changed_pathsGET route: the fast-forward check raises a raw gRPC not-found for a missing repository, so the route now rescues it and returns 404.- Added request specs for both routes. Each fails without its fix, and the archive spec also asserts the error message.
- Checked the other sibling routes (info, branches, tree, commits) with a missing and an empty repository: none returns 500. The POST routes only hand off to Workhorse, which maps not-found to 404, so request specs don't exercise that path.
- Ran the full orbit internal request spec: 241 examples, 0 failures. Rubocop is clean.
Edited by Dmitry Gruzd