Prevent test pollution in production database (bd-z528)
- Add warning when creating issues with 'Test' prefix - Suggest BEADS_DB for isolated testing - Document testing workflow in AGENTS.md - Include examples for manual and automated testing Amp-Thread-ID: https://ampcode.com/threads/T-fc7b7391-8881-4dd9-8e1f-28a2f95afb2b Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -57,6 +57,13 @@ var createCmd = &cobra.Command{
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Warn if creating a test issue in production database
|
||||
if strings.HasPrefix(strings.ToLower(title), "test") {
|
||||
yellow := color.New(color.FgYellow).SprintFunc()
|
||||
fmt.Fprintf(os.Stderr, "%s Creating issue with 'Test' prefix in production database.\n", yellow("⚠"))
|
||||
fmt.Fprintf(os.Stderr, " For testing, consider using: BEADS_DB=/tmp/test.db ./bd create \"Test issue\"\n")
|
||||
}
|
||||
|
||||
// Load template if specified
|
||||
var tmpl *Template
|
||||
if fromTemplate != "" {
|
||||
|
||||
Reference in New Issue
Block a user