feat(storage): add storage_path column to repository - #38960
Conversation
Add a storage_path column storing the relative path of the repository on disk, the foundation for sub-group support (go-gitea#1872). An empty value keeps the legacy lower(owner)/lower(name).git convention, so existing repositories are unaffected. Assisted-by: opencode:deepseek-v4-flash-free
|
Hi maintainers - this is the first of a small chain of PRs to introduce stable storage_path support for repositories (foundation for the disk-locating work referenced by #1872). CI is green on SQLite/MySQL/PG/MSSQL. No rush, just keeping it on the radar.\n--\ntrenysx\nAssisted-by: opencode:deepseek-v4-flash-free |
There was a problem hiding this comment.
Describe your design, how "StoragePath" works in various cases.
- Convert all old paths to the new layout
- Owner rename
- Repo rename
- Repo adopt
- Repo transfer
By the way, the internal storage path should be "fixed", e.g.: UUID. It should never change even if the repo/owner is renamed or transferred.
If a new "feature" is introduced, it should at least be used somewhere, but not just add a dummy field.
|
Thanks for the review. You're right on all counts. Honest status of the five cases:
I agree the internal path should be immutable (repo-ID/UUID) and that a bare column isn't a feature by itself. Since 3 of 5 cases are still open, I'll close this PR and the storage_path work here - it's not ready for merge. Thanks for the clear guidance. |
Add a
storage_pathcolumn to therepositorytable storing the relative path of the repository on disk - the foundation for sub-group support (#1872).An empty value keeps the legacy
lower(owner)/lower(name).gitconvention, so existing repositories and all current behavior are unaffected. Only code repositories with a set value resolve to the custom location.Covered by unit tests: migration idempotency and path resolution.