Skip to content

feat(action): run --validate before generating so bad definitions fail fast #121

Description

@BryanFRD

Problem

The generator already ships a validation mode — generator/src/cli.rs exposes --validate (Mode::Validate) and generator/src/validate.rs implements the checks (duplicate package names/paths, hook path traversal, etc., per the closed issues #70/#71). But action.yml never uses it: the "Generate fixtures" step (lines 56-63) jumps straight to generate-fixtures --definitions ... --output ....

Why it matters

When a consumer passes a malformed definitions directory, generation fails partway through with a generation-time error rather than an upfront validation error that names the offending file and the specific problem. Validation exists precisely to give that clear signal, and the CLI flag is documented (README directory-structure note for validate.rs), yet the Action — the primary entry point for consumers — bypasses it.

Proposed approach

  • Add a step in action.yml before "Generate fixtures" that runs generate-fixtures --validate --definitions "${{ inputs.definitions }}" and fails the job on a non-zero exit.
  • Keep it cheap: same already-built release binary, no extra build.

Acceptance criteria

  • action.yml validates definitions before generating.
  • A definitions dir that fails validation surfaces the validation error and stops the job before generation runs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority / somedayenhancementImprovement to existing feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions