Remove workspace state subsystem
This commit is contained in:
@@ -28,7 +28,6 @@ type Config struct {
|
||||
Notify NotifyConfig `yaml:"notify"`
|
||||
MissingSource MissingSourceConfig `yaml:"missing_source"`
|
||||
Promptkit PromptkitConfig `yaml:"promptkit"`
|
||||
Workspace WorkspaceConfig `yaml:"workspace"`
|
||||
Dayparts []DaypartConfig `yaml:"dayparts"`
|
||||
Reports map[string]ReportConfig `yaml:"reports"`
|
||||
}
|
||||
@@ -93,15 +92,6 @@ type PromptkitLocalConfig struct {
|
||||
ConcurrencyLimit int `yaml:"concurrency_limit"`
|
||||
}
|
||||
|
||||
type WorkspaceConfig struct {
|
||||
Root string `yaml:"root"`
|
||||
SnapshotsDir string `yaml:"snapshots_dir"`
|
||||
ReportsDir string `yaml:"reports_dir"`
|
||||
DataPackagesDir string `yaml:"data_packages_dir"`
|
||||
PreflightDir string `yaml:"preflight_dir"`
|
||||
NotificationsDir string `yaml:"notifications_dir"`
|
||||
}
|
||||
|
||||
type DaypartConfig struct {
|
||||
Name string `yaml:"name"`
|
||||
Start string `yaml:"start"`
|
||||
|
||||
@@ -147,12 +147,6 @@ func TestLoadMinimalExampleConfig(t *testing.T) {
|
||||
if cfg.Promptkit.Timeout != 2*time.Minute || cfg.Promptkit.Local.ConcurrencyLimit != 1 {
|
||||
t.Fatalf("Promptkit defaults = %#v", cfg.Promptkit)
|
||||
}
|
||||
if cfg.Workspace.Root != "workspace" {
|
||||
t.Fatalf("Workspace.Root = %q, want default workspace", cfg.Workspace.Root)
|
||||
}
|
||||
if cfg.Workspace.NotificationsDir != "notifications" {
|
||||
t.Fatalf("Workspace.NotificationsDir = %q, want notifications", cfg.Workspace.NotificationsDir)
|
||||
}
|
||||
if cfg.Location.Name != "Brentwood" {
|
||||
t.Fatalf("Location.Name = %q, want default Brentwood", cfg.Location.Name)
|
||||
}
|
||||
@@ -172,6 +166,13 @@ func TestLoadRejectsRemovedRecentChangeConfiguration(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadRejectsRemovedWorkspaceConfiguration(t *testing.T) {
|
||||
_, err := LoadFile(writeConfig(t, "workspace:\n root: workspace\n"))
|
||||
if err == nil || !strings.Contains(err.Error(), "workspace") {
|
||||
t.Fatalf("LoadFile() error = %v, want removed configuration rejection", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadReportModuleOverrides(t *testing.T) {
|
||||
path := writeConfig(t, `
|
||||
reports:
|
||||
|
||||
@@ -49,14 +49,6 @@ func Defaults() Config {
|
||||
ConcurrencyLimit: 1,
|
||||
},
|
||||
},
|
||||
Workspace: WorkspaceConfig{
|
||||
Root: "workspace",
|
||||
SnapshotsDir: "snapshots",
|
||||
ReportsDir: "reports",
|
||||
DataPackagesDir: "data-packages",
|
||||
PreflightDir: "preflight",
|
||||
NotificationsDir: "notifications",
|
||||
},
|
||||
Dayparts: []DaypartConfig{
|
||||
{Name: "overnight", Start: "00:00", End: "06:00"},
|
||||
{Name: "morning", Start: "06:00", End: "10:00"},
|
||||
|
||||
@@ -62,9 +62,6 @@ func Validate(cfg Config) error {
|
||||
if err := validatePromptkit(cfg.Promptkit); err != nil {
|
||||
return err
|
||||
}
|
||||
if cfg.Workspace.Root == "" {
|
||||
return fmt.Errorf("workspace.root is required")
|
||||
}
|
||||
if len(cfg.Dayparts) == 0 {
|
||||
return fmt.Errorf("dayparts must contain at least one entry")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user