config: validate pipeline job definitions - #3168
Open
nuclearcat wants to merge 2 commits into
Open
Conversation
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
force-pushed
the
agent/validate-job-config
branch
from
July 30, 2026 08:37
87e0e95 to
9daa8d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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