Skip to content

cli: wheels seed --generate is non-functional — every model errors, zero rows created, reports success #3082

Description

@bpamiri

Summary

The legacy random-data path documented in the seeding guide ("bypasses your seed files and generates random fake records for every model") creates nothing and claims success.

Repro (released 4.0.3, scratch app with Role/User/Post/Category models)

wheels seed --generate   # → 'Seeding completed.' exit 0 — but zero new rows
curl 'http://localhost:8080/wheels/cli?command=dbSeed&format=json&mode=generate&count=2'

Bridge JSON shows the truth:

{"success": true,
 "message": "Database seeding completed. Created 0 records across 5 models.",
 "SEEDED": [
  {"MODEL":"Category","SUCCESS":false,"ERROR":"there is no property with name [NAME]  found in [string]"},
  {"MODEL":"Post","SUCCESS":false,"ERROR":"No matching function [MODEL] found"},
  {"MODEL":"Role","SUCCESS":false,"ERROR":"No matching function [MODEL] found"}, ...]}

Root cause

Two bugs in vendor/wheels/public/views/cli.cfm (~910-975; develop carries the same loop, refactored but structurally identical — not behaviorally re-verified there):

  1. The generate loop is brokenmodel(modelName) / $classData().properties fail in the cli.cfm view context ("No matching function [MODEL] found"; the one model that resolved choked iterating properties).
  2. Failure is reported as success — the per-model catch appends success=false entries but overall result.success stays true and the CLI prints "Seeding completed." with exit 0. The fix(seed): fail and roll back when seedOnce entries fail validation #2987 honesty fix covered convention mode only; generate mode still lies.

Proposed direction (either)

  • Fix the model-resolution context and make overall success false when any model entry fails; or
  • Retire --generate outright (the seeding guide already calls it legacy and steers users to seedOnce()) — remove the flag, the cli.cfm branch, and the guide bullet together.

Acceptance

  • wheels seed --generate either creates rows and exits 0, or errors loudly with non-zero exit, or no longer exists (flag + docs removed coherently).

Reported by the guide-behavioral-audit P1 batch 2 (work item p1-14-migrations, claim seed-10; wheels CLI 4.0.3 + Lucee 7 + SQLite).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions