feat: Artisan checklist for application commands, hints and coverage gate

- migrate, migrate:rollback and deferred:purge gain --pretend and --force;
  they and queue:clear confirm only in production on an interactive
  terminal, so deploys over SSH proceed as before
- result lines: Applied N migrations, Rolled back <id> of <plugin>,
  Cleared N jobs from <queue>
- --json for migrate:status, key:generate, route:list, admin:token:create,
  admin:token:list, admin:token:scopes and websockets:health; -q keeps the
  key and the token
- hints for an empty DSN, an unreachable database, an invalid app.key, a
  missing uploads bucket and an application binary run below its root
- flare and websockets:health return bonfire.Reported after printing
- long help and examples for every application command, greeter:hello and
  blog:publish; cmd/summer TestCommandsDocumented fails on any gap
This commit is contained in:
Jakub Zych
2026-10-21 13:16:21 +02:00
parent 168d65cd1b
commit 9d06a78f62
29 changed files with 831 additions and 77 deletions

View File

@@ -17,7 +17,12 @@ func PublishCommand(withDB func(ctx context.Context, fn func(*gorm.DB) error) er
return bonfire.Command{
Name: "blog:publish",
Description: "Publish a blog post by its slug",
Args: []bonfire.Arg{{Name: "slug", Description: "Slug of the post to publish", Required: true}},
Long: `Sets published_at on the post with this slug. Publishing a post twice keeps
the first publication time. It fails when no post has the slug.`,
Args: []bonfire.Arg{{Name: "slug", Description: "Slug of the post to publish", Required: true}},
Examples: []bonfire.Example{
{Command: "blog:publish hello-world", Description: "Publish the post hello-world"},
},
Run: func(ctx context.Context, in bonfire.Input, out bonfire.Output) error {
slug, _ := in.Argument("slug")
if slug == "" {

View File

@@ -27,6 +27,9 @@ func TestPublishCommandShape(t *testing.T) {
if cmd.Description == "" {
t.Error("Description is empty")
}
for _, problem := range bonfire.CheckDocs([]bonfire.Command{cmd}) {
t.Error(problem)
}
cmds := []bonfire.Command{cmd}
var out bytes.Buffer