Skip to content

feat(BA-3209): Add artifact_storages common table#7057

Draft
jopemachine wants to merge 26 commits intomainfrom
feat/BA-3209
Draft

feat(BA-3209): Add artifact_storages common table#7057
jopemachine wants to merge 26 commits intomainfrom
feat/BA-3209

Conversation

@jopemachine
Copy link
Member

@jopemachine jopemachine commented Dec 2, 2025

resolves #7040 (BA-3209)

Checklist: (if applicable)

  • Mention to the original issue

📚 Documentation preview 📚: https://sorna--7057.org.readthedocs.build/en/7057/


📚 Documentation preview 📚: https://sorna-ko--7057.org.readthedocs.build/ko/7057/

@github-actions github-actions bot added size:L 100~500 LoC comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated labels Dec 2, 2025
@jopemachine jopemachine changed the title feat: Add artifact_storages common table feat(BA-3209): Add artifact_storages common table (WIP) Dec 2, 2025
@jopemachine jopemachine changed the title feat(BA-3209): Add artifact_storages common table (WIP) feat(BA-3209): Add artifact_storages common table Dec 3, 2025
@jopemachine jopemachine marked this pull request as ready for review December 3, 2025 05:15
Copilot AI review requested due to automatic review settings December 3, 2025 05:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ArtifactStorageRow model to store common metadata (name, storage_id, type) for all storage backends
  • Migrated existing storage names to the new artifact_storages table via Alembic migration
  • Updated repository queries to use eager loading (selectinload) for the new meta relationship

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.

@jopemachine jopemachine added this to the 25.19 milestone Dec 16, 2025
@jopemachine jopemachine marked this pull request as draft December 16, 2025 07:33
@HyeockJinKim HyeockJinKim force-pushed the main branch 2 times, most recently from 9552aac to 4af738e Compare December 31, 2025 15:41
@jopemachine jopemachine modified the milestones: 25.19, 26.1 Jan 5, 2026
@jopemachine jopemachine marked this pull request as ready for review January 5, 2026 09:32
@jopemachine jopemachine marked this pull request as draft January 9, 2026 09:09
@jopemachine jopemachine removed this from the 26.1 milestone Jan 26, 2026
@jopemachine jopemachine added this to the 26.2 milestone Feb 4, 2026
@github-actions github-actions bot added size:XL 500~ LoC area:docs Documentations and removed size:L 100~500 LoC labels Feb 4, 2026
@github-actions github-actions bot added the comp:common Related to Common component label Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:common Related to Common component comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create common table across the artifact storage tables

2 participants