feat(BA-3209): Add artifact_storages common table#7057
Draft
jopemachine wants to merge 26 commits intomainfrom
Draft
feat(BA-3209): Add artifact_storages common table#7057jopemachine wants to merge 26 commits intomainfrom
artifact_storages common table#7057jopemachine wants to merge 26 commits intomainfrom
Conversation
artifact_storages common tableartifact_storages common table (WIP)
artifact_storages common table (WIP)artifact_storages common table
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new artifact_storages common table to centralize storage metadata management across object storage and VFS storage backends. The change refactors the storage architecture by extracting the name column from both object_storages and vfs_storages tables into a shared artifact_storages table.
Key changes:
- Added new
ArtifactStorageRowmodel to store common metadata (name, storage_id, type) for all storage backends - Migrated existing storage names to the new
artifact_storagestable via Alembic migration - Updated repository queries to use eager loading (
selectinload) for the newmetarelationship
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/ai/backend/manager/models/artifact_storages.py |
Introduces new ArtifactStorageRow model with bidirectional relationships to object and VFS storage tables |
src/ai/backend/manager/models/alembic/versions/35dfab3b0662_add_artifact_storages_common_table.py |
Alembic migration that creates artifact_storages table and migrates existing data from both storage types |
src/ai/backend/manager/models/vfs_storage.py |
Removes name column, adds meta relationship, updates to_dataclass() to retrieve name from relationship |
src/ai/backend/manager/models/object_storage.py |
Removes name column, adds meta relationship, updates to_dataclass() to retrieve name from relationship |
src/ai/backend/manager/repositories/vfs_storage/db_source/db_source.py |
Adds eager loading of meta relationship in all query methods to prevent N+1 queries |
src/ai/backend/manager/repositories/object_storage/db_source/db_source.py |
Adds eager loading of meta relationship in all query methods to prevent N+1 queries |
src/ai/backend/manager/models/__init__.py |
Registers the new artifact_storages module in the models package |
changes/7057.feature.md |
Changelog entry describing the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...i/backend/manager/models/alembic/versions/35dfab3b0662_add_artifact_storages_common_table.py
Outdated
Show resolved
Hide resolved
...i/backend/manager/models/alembic/versions/35dfab3b0662_add_artifact_storages_common_table.py
Outdated
Show resolved
Hide resolved
9552aac to
4af738e
Compare
ecaaa5a to
bc37c21
Compare
seedspirit
reviewed
Jan 5, 2026
55612c7 to
ab42a38
Compare
6a86174 to
4bedf71
Compare
67de45c to
28fccf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #7040 (BA-3209)
Checklist: (if applicable)
📚 Documentation preview 📚: https://sorna--7057.org.readthedocs.build/en/7057/
📚 Documentation preview 📚: https://sorna-ko--7057.org.readthedocs.build/ko/7057/