feat: Fediverse-like instance migration for team settings #90

Open
diyon wants to merge 1 commit from feat/instance-migration into main
Collaborator

Summary

Implement Fediverse-like migration of team settings between Goloom instances. Export/import JSON bundles containing configuration data only.

Changes

Domain Layer

  • internal/domain/migration.go — ExportBundle, ImportResult, ImportMode types
  • Account reference helpers (username@instance portable format)

Store Layer

  • internal/store/store.go — Added ExportTeamSettings/ImportTeamSettings to interface
  • internal/store/sqlite/migration.go — SQLite implementation with:
    • Export: team settings, profile, style examples, knowledge sources, AI config, RSS feeds, post templates, campaign formats
    • Import: merge (upsert) or replace (clear + import) modes
    • Account reference resolution for portable IDs
    • Sensitive field stripping (API keys)

Tests

  • internal/store/sqlite/migration_test.go — Unit tests for:
    • Empty export
    • Export with profile
    • JSON serialization round-trip
    • Import merge mode
    • Import with profile
    • Import replace mode
    • Account reference helpers

Scope

Migratable:

  • Team settings (name, description, scheduling prefs, brand color)
  • Team profile (AI style, tonality, formatting rules)
  • Style examples
  • Knowledge sources (text/url only)
  • AI service config (API keys stripped)
  • RSS feed configs
  • Post templates (recurring)
  • Campaign formats

Not migratable:

  • Posts, analytics, OAuth tokens, user accounts, media

API Endpoints (TODO)

  • GET /api/v1/teams/{teamID}/export
  • POST /api/v1/teams/{teamID}/import

Closes #88

## Summary Implement Fediverse-like migration of team settings between Goloom instances. Export/import JSON bundles containing configuration data only. ## Changes ### Domain Layer - `internal/domain/migration.go` — ExportBundle, ImportResult, ImportMode types - Account reference helpers (username@instance portable format) ### Store Layer - `internal/store/store.go` — Added ExportTeamSettings/ImportTeamSettings to interface - `internal/store/sqlite/migration.go` — SQLite implementation with: - Export: team settings, profile, style examples, knowledge sources, AI config, RSS feeds, post templates, campaign formats - Import: merge (upsert) or replace (clear + import) modes - Account reference resolution for portable IDs - Sensitive field stripping (API keys) ### Tests - `internal/store/sqlite/migration_test.go` — Unit tests for: - Empty export - Export with profile - JSON serialization round-trip - Import merge mode - Import with profile - Import replace mode - Account reference helpers ## Scope **Migratable:** - Team settings (name, description, scheduling prefs, brand color) - Team profile (AI style, tonality, formatting rules) - Style examples - Knowledge sources (text/url only) - AI service config (API keys stripped) - RSS feed configs - Post templates (recurring) - Campaign formats **Not migratable:** - Posts, analytics, OAuth tokens, user accounts, media ## API Endpoints (TODO) - GET /api/v1/teams/{teamID}/export - POST /api/v1/teams/{teamID}/import ## Related Closes #88
feat(migration): add instance migration for team settings
Some checks failed
CI/CD Workflow / Test Backend (Go) (pull_request) Failing after 2m3s
CI/CD Workflow / Test Frontend (Node.js) (pull_request) Successful in 1m30s
CI/CD Workflow / E2E (Playwright + Go) (pull_request) Failing after 4m8s
CI/CD Workflow / Test Postgres Store (pull_request) Successful in 1m5s
CI/CD Workflow / Build and Publish Docker Image (pull_request) Has been skipped
CI/CD Workflow / Trigger Dockhand Deployment (pull_request) Has been skipped
86da5fc5dc
- Domain types for export/import bundles
- Store interface methods for ExportTeamSettings/ImportTeamSettings
- SQLite implementation with merge/replace modes
- Account reference resolution (username@instance)
- Unit tests for export, import, and round-trip

Closes #88
kreativmonkey force-pushed feat/instance-migration from 86da5fc5dc
Some checks failed
CI/CD Workflow / Test Backend (Go) (pull_request) Failing after 2m3s
CI/CD Workflow / Test Frontend (Node.js) (pull_request) Successful in 1m30s
CI/CD Workflow / E2E (Playwright + Go) (pull_request) Failing after 4m8s
CI/CD Workflow / Test Postgres Store (pull_request) Successful in 1m5s
CI/CD Workflow / Build and Publish Docker Image (pull_request) Has been skipped
CI/CD Workflow / Trigger Dockhand Deployment (pull_request) Has been skipped
to 5b92fda508
Some checks failed
CI/CD Workflow / Test Backend (Go) (pull_request) Failing after 2m9s
CI/CD Workflow / Test Frontend (Node.js) (pull_request) Successful in 1m25s
CI/CD Workflow / E2E (Playwright + Go) (pull_request) Failing after 4m4s
CI/CD Workflow / Test Postgres Store (pull_request) Successful in 1m7s
Website CI / Build website (pull_request) Successful in 1m4s
CI/CD Workflow / Build and Publish Docker Image (pull_request) Has been skipped
CI/CD Workflow / Trigger Dockhand Deployment (pull_request) Has been skipped
2026-06-17 09:09:33 +02:00
Compare
Some checks failed
CI/CD Workflow / Test Backend (Go) (pull_request) Failing after 2m9s
CI/CD Workflow / Test Frontend (Node.js) (pull_request) Successful in 1m25s
CI/CD Workflow / E2E (Playwright + Go) (pull_request) Failing after 4m4s
CI/CD Workflow / Test Postgres Store (pull_request) Successful in 1m7s
CI/CD Workflow / Trigger Dockhand Deployment (pull_request) Has been skipped
Website CI / Build website (pull_request) Successful in 1m4s
CI/CD Workflow / Build and Publish Docker Image (pull_request) Has been skipped
This pull request has changes conflicting with the target branch.
  • AGENTS.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/instance-migration:feat/instance-migration
git switch feat/instance-migration

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/instance-migration
git switch feat/instance-migration
git rebase main
git switch main
git merge --ff-only feat/instance-migration
git switch feat/instance-migration
git rebase main
git switch main
git merge --no-ff feat/instance-migration
git switch main
git merge --squash feat/instance-migration
git switch main
git merge --ff-only feat/instance-migration
git switch main
git merge feat/instance-migration
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kreativmonkey/goloom!90
No description provided.