Use per-repository sequential issue numbers in URLs instead of UUIDs #5
Problem
Issue URLs currently use the entity UUID, e.g.
/repos/miggi/GitShark/issues/3f9c2e1a-...-9d7b
UUIDs are unreadable, impossible to remember, and painful to reference in commit messages, comments, or conversation. Every mainstream forge (GitHub, GitLab, Gitea) uses short per-repository sequential numbers:
/repos/miggi/GitShark/issues/1
Proposed solution
- Add a
numbercolumn to the issue table: sequential per repository, starting at 1, assigned at creation time. - Assignment must be race-safe under concurrent issue creation (e.g.
MAX(number) + 1inside the insert with a unique constraint on(repository_id, number)and retry, or a per-repo counter on the repository row updated with a lock). - Route issue pages by number:
/repos/{owner}/{repo}/issues/{number}. - Update all links (issue list, MCP/API responses, federation objects if applicable) to use the number.
- Display the number in the UI (
#1style).
Data migration (important)
Existing issues already have UUIDs, so a Flyway migration is required:
- [ ] Migration adds the
numbercolumn and backfills existing issues per repository, ordered bycreated_at(stable ordering, ties broken deterministically e.g. by id). - [ ] Unique constraint on
(repository_id, number)after backfill. - [ ] Decide handling of old UUID URLs: either redirect
/issues/{uuid}→/issues/{number}(nice for existing bookmarks/federated links) or return 404. Redirect preferred.
Acceptance criteria
- [ ] New issues get sequential per-repo numbers starting at 1
- [ ] Issue detail URL is
/repos/{owner}/{repo}/issues/{number} - [ ] Existing issues backfilled by migration, ordering matches creation time
- [ ] Concurrent creation cannot produce duplicate numbers (test)
- [ ] Old UUID links handled (redirect or documented 404)
Migrated from https://gitshark.ha1nz.de/repos/miggi/GitShark/issues/5 (original author: miggi, created 2026-07-09)