Skip to content

validate reports only the first unknown key in each job #61

Backlog

Description

@ndbroadbent

cigen validate, like every command that loads config, reports at most one unknown key per job. Fixing it shows the next one, so an agent or a person fixing a config needs one run per mistake.

Repro (main at c349a7a)

# cigen.yml
provider: github
workflows:
  ci:
    jobs:
      test:
        image: rust:1.90
        requires: [build]
        runs-on: ubuntu-latest
        steps:
          - run: cargo test
$ cigen validate
error: cigen.yml (at workflows.ci.jobs.test.requires): unknown key `requires`
  help: `requires` is now `needs`.

The config has 1 problem. `cigen validate --format json` lists them as data.

Delete requires: and run it again: now runs-on is reported, with "set the runner or container image with image:".

Expected

Both keys reported in one run, each with its own suggestion, the way problems in different jobs already are.

Likely cause

The job, workflow and document types use #[serde(deny_unknown_fields)] (src/schema/job.rs:13, src/schema/workflow.rs:15 and :68, src/schema/document.rs:18), and serde stops at the first unknown field. The top level and workflow settings probably behave the same. One fix: compare a mapping's keys with the type's known fields before deserializing, and report every unknown key.

Found while writing the blog post on CI config agents can't quietly get wrong (#58), which lists this as a known gap.

Activity

  1. added a commit that references this issue on Dec 4, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions