chore(state-store): remove the one-time SQLite import and db_path
Every install serves from Postgres, so the legacyread/legacyimport packages, the archie-state-store import command, the boot gate that refused to serve over unimported SQLite files, and db_path (which only located those files) go. Migration 0010 drops the import_completion table.
This commit is contained in:
1 parent
d61e49b2c9
commit
8c55b5d4e4
65 files changed
+138
-3350
No files matched your search
@@ -243,7 +243,6 @@ type BudgetsView struct {
|
||||
type StorageView struct {
|
||||
WorkDir string `json:"work_dir"`
|
||||
StateDir string `json:"state_dir"`
|
||||
DBPath string `json:"db_path"`
|
||||
DatabaseURL string `json:"database_url"`
|
||||
SkillsDir string `json:"skills_dir,omitempty"`
|
||||
PluginDir string `json:"plugin_dir,omitempty"`
|
||||
@@ -377,7 +376,6 @@ func BuildConfigView(in ConfigViewInput) ConfigView {
|
||||
Storage: StorageView{
|
||||
WorkDir: cfg.WorkDir,
|
||||
StateDir: cfg.StateDir,
|
||||
DBPath: cfg.DBPath,
|
||||
DatabaseURL: cfg.DatabaseURL,
|
||||
SkillsDir: cfg.SkillsDir,
|
||||
PluginDir: cfg.PluginDir,
|
||||
|
||||
@@ -30,7 +30,6 @@ func configWithFakeSecrets() *config.Holder {
|
||||
return config.NewHolder(config.Config{
|
||||
WorkDir: "/work/archie",
|
||||
SkillsDir: "/work/archie/.agents/skills",
|
||||
DBPath: "/work/archie/archie.db",
|
||||
BotUser: "archie-bot",
|
||||
BotEmail: "archie@example.com",
|
||||
Label: "archie",
|
||||
@@ -343,7 +342,7 @@ func TestHandleConfigReportsLockedKeys(t *testing.T) {
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &got); err != nil {
|
||||
t.Fatalf("decode: %v", err)
|
||||
}
|
||||
for _, key := range []string{"db_path", "database_url", "work_dir"} {
|
||||
for _, key := range []string{"database_url", "work_dir"} {
|
||||
if got.Locked[key] == "" {
|
||||
t.Errorf("Locked[%q] is empty, want a reason", key)
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ type ConfigSection struct {
|
||||
// restart even though the dashboard already renders it as editable.
|
||||
// - Web, SkillsDir, PluginDir, SecretEngineDir are absent from both
|
||||
// allowlists entirely, so they require a restart.
|
||||
// - WorkDir and DBPath are locked (configuration.DeniedKeys), not merely
|
||||
// - WorkDir and DatabaseURL are locked (configuration.DeniedKeys), not merely
|
||||
// restart-required -- the dashboard cannot change them at all.
|
||||
func configFieldDescriptors() []ConfigSection {
|
||||
return []ConfigSection{
|
||||
@@ -148,7 +148,6 @@ func configFieldDescriptors() []ConfigSection {
|
||||
Fields: []ConfigField{
|
||||
{Key: "work_dir", Label: "Work directory", Type: FieldString, Editable: false},
|
||||
{Key: "state_dir", Label: "State directory", Description: "Embedded NATS store, task logs and the readiness disk probe.", Type: FieldString, Editable: false},
|
||||
{Key: "db_path", Label: "Legacy SQLite path prefix", Description: "Locates pre-PostgreSQL files for the one-time import only.", Type: FieldString, Editable: false},
|
||||
{Key: "database_url", Label: "PostgreSQL URL", Description: "The State Store's database connection; set at boot, restart required.", Type: FieldString, Editable: false},
|
||||
{Key: "skills_dir", Label: "Shared skills directory", Description: "Empty uses the work directory.", Type: FieldString, Editable: true, RestartRequired: true},
|
||||
{Key: "plugin_dir", Label: "Daemon plugin directory", Description: "Empty means no daemon plugins.", Type: FieldString, Editable: true, RestartRequired: true},
|
||||
@@ -194,7 +193,6 @@ func configFieldValues(view ConfigView) map[string]any {
|
||||
"budgets.gate_max_failures": view.Budgets.GateMaxFailures,
|
||||
"work_dir": view.Storage.WorkDir,
|
||||
"state_dir": view.Storage.StateDir,
|
||||
"db_path": view.Storage.DBPath,
|
||||
"database_url": view.Storage.DatabaseURL,
|
||||
"skills_dir": view.Storage.SkillsDir,
|
||||
"plugin_dir": view.Storage.PluginDir,
|
||||
|
||||
@@ -64,7 +64,7 @@ func TestConfigFieldDescriptorsAreComplete(t *testing.T) {
|
||||
"bot_user", "bot_email", "label", "forge.type", "forge.host", "diff_cap_lines",
|
||||
"repos", "models", "providers",
|
||||
"budgets.max_steps", "budgets.wall_clock", "budgets.gate_max_failures",
|
||||
"work_dir", "state_dir", "db_path", "database_url", "skills_dir", "plugin_dir", "secret_engine_dir",
|
||||
"work_dir", "state_dir", "database_url", "skills_dir", "plugin_dir", "secret_engine_dir",
|
||||
"containers.image", "containers.max_concurrency", "containers.max_uptime",
|
||||
"containers.volume_ttl", "containers.pull_policy", "containers.network",
|
||||
"web.listen",
|
||||
@@ -101,7 +101,6 @@ func TestConfigFieldDescriptorsRestartRequiredIsDeliberate(t *testing.T) {
|
||||
"budgets.gate_max_failures": false,
|
||||
"work_dir": false, // locked, not merely restart-required
|
||||
"state_dir": false, // locked, not merely restart-required
|
||||
"db_path": false, // locked, not merely restart-required
|
||||
"database_url": false, // locked, not merely restart-required
|
||||
"skills_dir": true, // absent from reloadableFields
|
||||
"plugin_dir": true,
|
||||
@@ -144,13 +143,13 @@ func TestConfigFieldDescriptorsStructuredFieldsAreNotEditable(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestConfigFieldDescriptorsLockedStorageFieldsAreNotEditable pins
|
||||
// work_dir/db_path as Editable: false in the static catalog. They are also
|
||||
// work_dir/database_url as Editable: false in the static catalog. They are also
|
||||
// reported LockedReason at runtime via overlay.DeniedKeys (api_config.go),
|
||||
// but the catalog marks them non-editable independently so the generic
|
||||
// renderer does not need runtime state to know not to offer an edit
|
||||
// affordance for a key that can never succeed.
|
||||
func TestConfigFieldDescriptorsLockedStorageFieldsAreNotEditable(t *testing.T) {
|
||||
locked := map[string]bool{"work_dir": true, "state_dir": true, "db_path": true, "database_url": true}
|
||||
locked := map[string]bool{"work_dir": true, "state_dir": true, "database_url": true}
|
||||
for _, section := range configFieldDescriptors() {
|
||||
for _, f := range section.Fields {
|
||||
if locked[f.Key] && f.Editable {
|
||||
|
||||
Reference in new issue
Block a user