Skip to content

feat(storage): add storage_path column to repository - #38960

Closed
trenysx wants to merge 1 commit into
go-gitea:mainfrom
trenysx:feat/storage-path-column
Closed

feat(storage): add storage_path column to repository#38960
trenysx wants to merge 1 commit into
go-gitea:mainfrom
trenysx:feat/storage-path-column

Conversation

@trenysx

@trenysx trenysx commented Aug 18, 2026

Copy link
Copy Markdown

Add a storage_path column to the repository table 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).git convention, 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.

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
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 18, 2026
@github-actions github-actions Bot added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Aug 18, 2026
@trenysx

trenysx commented Aug 18, 2026

Copy link
Copy Markdown
Author

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

@wxiaoguang wxiaoguang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe your design, how "StoragePath" works in various cases.

  1. Convert all old paths to the new layout
  2. Owner rename
  3. Repo rename
  4. Repo adopt
  5. 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.

@trenysx

trenysx commented Aug 19, 2026

Copy link
Copy Markdown
Author

Thanks for the review. You're right on all counts.

Honest status of the five cases:

  1. Convert old paths - not implemented (column defaults to empty, no backfill)
  2. Owner rename - not handled
  3. Repo rename - handled in fix(storage): honor storage path on repo transfer and rename #38962 (changeRepositoryName keeps custom path)
  4. Repo adopt - not handled
  5. Repo transfer - handled in fix(storage): honor storage path on repo transfer and rename #38962 (transferOwnership keeps custom path, tested)

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.

@trenysx trenysx closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants