refactor(store)!: remove the SQLite task store, the PocketBase event store and the SQLite session store
The State Store, event capture and Gateway conversations already serve from PostgreSQL. This deletes internal/store and internal/infrastructure/edastore, the SQLite gateway session store and openProductionTaskStore, and the -db recovery path on a legacy task file; backup, restore, validate and rollback work on the database database_url names. - The binding-secret cipher moves to internal/infrastructure/bindingcipher and ToolCall to internal/infrastructure/postgres. - NewSessionStoreMemory is now a pure in-memory store that passes the shared SessionStore conformance suite. - Tests run against PostgreSQL through internal/infrastructure/postgres/pgstore; legacyimport/legacyfixture writes the legacy files the import and the boot gate read. - The cron dialect is owned in internal/domain/scheduling, so github.com/pocketbase/pocketbase and pocketbase/dbx leave go.mod. modernc.org/sqlite stays for the one-time import (legacyread). - The UI and Messaging architecture gates ban the Postgres and legacy readers in place of internal/store.
This commit is contained in:
1 parent
dda12dcdba
commit
ae552db7e0
90 files changed
+1022
-1453
No files matched your search
@@ -6,25 +6,21 @@ import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/mapping"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/edastore"
|
||||
"github.com/samcharles93/archie-core/internal/store"
|
||||
"github.com/samcharles93/archie-core/internal/domain/storecontract"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore"
|
||||
)
|
||||
|
||||
// mappingTestServer builds a Server with both Mappings and Captures backed
|
||||
// by the same concrete *store.Store, so preview tests can insert a real
|
||||
// by the same concrete *pgstore.TaskDB, so preview tests can insert a real
|
||||
// capture and resolve a mapping against it end to end.
|
||||
func mappingTestServer(t *testing.T) *Server {
|
||||
t.Helper()
|
||||
s, err := store.Open(t.Context(), filepath.Join(t.TempDir(), "test.db"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := pgstore.Open(t)
|
||||
t.Cleanup(func() { _ = s.Close() })
|
||||
eda := edastore.OpenTest(t)
|
||||
eda := pgstore.EDA(t, nil)
|
||||
return &Server{
|
||||
Store: s,
|
||||
Log: slog.New(slog.DiscardHandler),
|
||||
@@ -200,7 +196,7 @@ func TestHandleMappingDelete(t *testing.T) {
|
||||
|
||||
func TestHandleMappingPreviewResolvesAgainstARealCapture(t *testing.T) {
|
||||
srv := mappingTestServer(t)
|
||||
capID, err := srv.Captures.InsertCapture(t.Context(), store.CapturedEvent{
|
||||
capID, err := srv.Captures.InsertCapture(t.Context(), storecontract.CapturedEvent{
|
||||
Source: "sentry",
|
||||
Body: `{"issue":{"title":"bug found"},"count":3}`,
|
||||
}, 0, 0)
|
||||
|
||||
Reference in new issue
Block a user