Skip to content

Conversation

@pinglin
Copy link
Member

@pinglin pinglin commented Feb 1, 2026

Because

  • The KB consolidation migration (convert000070) needs to move files from legacy/duplicate KBs to the primary default KB
  • Files can belong to multiple KBs (many-to-many relationship via junction table)
  • After consolidating files, legacy KBs need to be hard-deleted (bypassing soft delete) with CASCADE removal of file-KB associations
  • The previous easimon/maximize-build-space action was deprecated

This commit

  • Adds AddFilesToKnowledgeBaseAdmin handler that accepts file resource names (namespaces/{namespace}/files/{file}), resolves file IDs to UIDs internally, and inserts into junction table (skipping duplicates via ON CONFLICT DO NOTHING)
  • Adds DeleteKnowledgeBaseAdmin handler that drops Milvus collection, purges ACL entry, and hard-deletes KB record (CASCADE removes file_knowledge_base associations)
  • Adds HardDeleteKnowledgeBase repository method using Unscoped().Delete() to bypass soft delete
  • Adds AddFilesToKnowledgeBase repository method with raw SQL to lookup file UIDs by IDs and insert associations
  • Updates integration-test workflow to use jlumbroso/free-disk-space action
  • Regenerates repository mocks with new methods

@pinglin pinglin merged commit b69e656 into main Feb 1, 2026
6 of 7 checks passed
@pinglin pinglin deleted the pinglin/feat-artifact-kb-consolidation-admin-apis branch February 1, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants