Skip to content

config: validate pipeline job definitions - #3168

Open
nuclearcat wants to merge 2 commits into
kernelci:mainfrom
nuclearcat:agent/validate-job-config
Open

config: validate pipeline job definitions#3168
nuclearcat wants to merge 2 commits into
kernelci:mainfrom
nuclearcat:agent/validate-job-config

Conversation

@nuclearcat

Copy link
Copy Markdown
Member

Pipeline job YAML is currently filtered through a manually maintained attribute set. Unknown fields are silently discarded and values are accepted without type validation, so typos and configuration drift can surface only when a job runs.

Add a strict Pydantic schema at the post-merge loading boundary. Require a template, validate parameter mappings and supported priority values, reject unknown fields, and explicitly preserve the base_name field already used by the live pipeline configuration. Keep the existing Job API as a compatibility adapter and deep-copy parameters to prevent configuration mutation.

Cover invalid fields, required values, symbolic and numeric priorities, base-name serialization, merge ordering, and nested parameter isolation. This is an incremental step toward an authoritative configuration schema while preserving current consumers.

Refs: #2648

Pipeline job YAML is currently filtered through a manually maintained attribute set. Unknown fields are silently discarded and values are accepted without type validation, so typos and configuration drift can surface only when a job runs.

Add a strict Pydantic schema at the post-merge loading boundary. Require a template, validate parameter mappings and supported priority values, reject unknown fields, and explicitly preserve the base_name field already used by the live pipeline configuration. Keep the existing Job API as a compatibility adapter and deep-copy parameters to prevent configuration mutation.

Cover invalid fields, required values, symbolic and numeric priorities, base-name serialization, merge ordering, and nested parameter isolation. This is an incremental step toward an authoritative configuration schema while preserving current consumers.

Refs: kernelci#2648
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
The initial schema validation still copied every job field into a parallel runtime object. Adding a field therefore required updating the model, Job constructor, private storage, properties, and YAML attribute allowlist, leaving the central maintenance problem from kernelci#2648 in place.

Store the validated JobConfig directly and delegate ordinary field access to it. Derive parameter formatting and YAML serialization from model_dump(), while retaining only the mapping-key name, defensive parameter copies, and mutable image override as wrapper behavior. Keep legacy direct Job construction working by validating its keyword values through the same schema.

Add regression coverage for schema-driven access and serialization, legacy construction, invalid extra fields, and isolated image overrides.

Refs: kernelci#2648
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
@nuclearcat
nuclearcat force-pushed the agent/validate-job-config branch from 87e0e95 to 9daa8d5 Compare July 30, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant