Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ait-yaml-validate does not schema-check !include'd dictionary files (#201 still reproduces)

Open
#565 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start with YAMLProcessor and schema_val() in ait/core/val.py:100-104 and :495-503, then read the Cmd/Tlm validation paths at :587 and :715 and tests/ait/core/test_val.py. Reproduce the included command and telemetry cases from the issue; done means schema errors in included files fail validation while shipped configuration and clean includes still pass.

Written by the indexing model from the issue text.

Description

ait-yaml-validate --cmd and --tlm don't run the JSON schema over files pulled in with !include, so a misspelled key or wrong-typed value in an included command or telemetry dictionary still ends in Validation: SUCCESS, exit 0. #201 reported this and #452 closed it, but on master (a01414c, 3.1.2) the schema check still skips includes.

schema_val() checks only the top-level file (ait/core/val.py:503), where YAMLProcessor has already turned - !include ccsds_header.yaml into - include: line 96 (val.py:100-104), which the schema accepts. The loop over yml_files_to_validate (the top-level file plus its includes, val.py:495-497) logs Validating: <file> but only runs content_val(), and the Cmd/Tlm versions load CmdDict(self._ymlfile) / TlmDict(self._ymlfile) regardless of which file the loop passes in (val.py:587, :715).

From the repo root, with AIT_CONFIG set:

cp -r config cfg
printf -- '- !Command\n  name: X\n  opcode: 0x0099\n  subsytem: CORE\n' > cfg/extra.yaml
printf -- '\n- !include extra.yaml\n' >> cfg/cmd.yaml
ait-yaml-validate --cmd --yaml cfg/cmd.yaml    # Validation: SUCCESS, exit 0
ait-yaml-validate --cmd --yaml cfg/extra.yaml  # 'subsytem' was unexpected, exit 1

Other cases, each on a fresh copy of config/:

  • mask: renamed maks: on CCSDS_HEADER.version in the shipped ccsds_header.yaml (included at config/tlm.yaml:97): exit 0. The same edited header pasted inline: exit 1; the unedited header inline: exit 0. With the maks file, TlmDict drops the mask and decodes 08 01 c0 00 00 05 as version=8 instead of 0.
  • Field includes (doc/source/telemetry_intro.rst:367): maks: in the included field list exits 0, inline exits 1.
  • A duplicate opcode in an include fails (exit 1, an uncaught YAMLError from CmdDict), so includes are loaded, just not schema-checked.

The tlm_yaml_check and cmd_yaml_check pre-commit hooks (.pre-commit-config.yaml:44-56) call the same entry point (read; the hooks weren't run), and tests/ait/core/test_val.py has no include case. Not tested: EVR and limits dictionaries, includes nested more than one level. de1a0f9 (#452's merge) was read, not run; it has the same loop.

Schema-checking each included file on its own isn't enough. I tried it: it catches the command case but fails a clean Field include ('field', 'type' were unexpected). Expanding - !include lines inside YAMLProcessor.process() before the schema pass caught the command, header and field typos, passed the shipped config and clean includes, and test_val.py stayed at 26 passed. Error line numbers then refer to the expanded text. Happy to open a PR with that plus a bad-include test, or to hear you'd rather handle it another way.

Dominant language
Python
Stars
56
Forks
35
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.