-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Problem
Our seed / dev scripts are currently too easy to misuse and provide poor feedback when something goes wrong. This leads to confusion (e.g., running seeds against a restored backup or wrong environment) and time wasted debugging.
Goals
-
Human-friendly logging
- Clear, structured logs for each step (connect DB, migrate, truncate, seed entities, etc.).
- Highlight key context at startup: environment, DB host/name/user, schema, app version/commit (if available).
- Distinguish INFO/WARN/ERROR and show actionable messages.
-
Guardrails / “fool-proof” behavior
- Hard checks to prevent running destructive operations on non-dev environments.
- Detect and warn/abort when targeting:
production/stagingDBs- non-local hosts (unless explicitly allowed)
- databases with large row counts / existing non-empty critical tables (configurable)
- Require explicit confirmation for dangerous actions (truncate/reset) via:
--yesflag OR- interactive prompt (only if TTY)
- Provide a dry-run mode (
--dry-run) showing what would be executed.
-
Better CLI UX
- Consistent flags and help output.
- Exit codes that CI/dev tooling can rely on.
Acceptance Criteria
- Running the seed/dev scripts prints a concise, readable summary of what it will do and where.
- By default, scripts refuse to run destructive actions outside dev/local contexts.
- A user can override safeguards intentionally via explicit flags (documented).
- Logs include enough context to understand failures without digging into code.
- Documentation updated (README / docs) with examples.
Notes / Suggestions
- Consider using a structured logger (zap/zerolog/slog) with pretty console output in dev.
- Consider centralizing config validation/guard logic so all scripts share the same safety checks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels