From 6736e840ec519374e5afdb9f9234d310a9b8ee0d Mon Sep 17 00:00:00 2001 From: Daniel Brondani Date: Wed, 20 May 2026 14:37:39 +0200 Subject: [PATCH] [projmgr] Add `generated-by` node in *.cbuild-mlops.yml files --- tools/projmgr/schemas/common.schema.json | 9 ++++++--- tools/projmgr/src/ProjMgrCbuildMlops.cpp | 1 + .../test/data/MLOps/ref/extended.cbuild-mlops.yml | 1 + .../projmgr/test/data/MLOps/ref/minimal.cbuild-mlops.yml | 1 + .../data/MLOps/ref/minimal_image_only.cbuild-mlops.yml | 1 + 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/projmgr/schemas/common.schema.json b/tools/projmgr/schemas/common.schema.json index 6674d769a..852d0eae1 100644 --- a/tools/projmgr/schemas/common.schema.json +++ b/tools/projmgr/schemas/common.schema.json @@ -1495,7 +1495,8 @@ }, "west": { "$ref": "#/definitions/WestProjectType" } }, - "additionalProperties": false + "additionalProperties": false, + "required": ["generated-by"] }, "BuildPacksInfoType": { "type": "array", @@ -2524,7 +2525,7 @@ "debug-topology": { "$ref": "#/definitions/DebugTopologyType" } }, "additionalProperties": false, - "required": ["output", "debugger"] + "required": ["generated-by", "output", "debugger"] }, "TargetSetsType": { "title": "target-set:\nDocumentation: https://open-cmsis-pack.github.io/cmsis-toolbox/YML-Input-Format/#target-set", @@ -2690,6 +2691,7 @@ "type": ["null", "object"], "properties": { "description": { "type": "string", "description": "Brief description of the MLOps configuration." }, + "generated-by": { "type": "string", "description": "Tool name along with version information used to generate this file." }, "processor": { "type": "object", "description": "Processor information.", @@ -2728,7 +2730,8 @@ "hardware": { "$ref": "#/definitions/MlopsRunDescType" }, "simulator": { "$ref": "#/definitions/MlopsRunDescType" } }, - "additionalProperties": false + "additionalProperties": false, + "required": ["generated-by"] }, "MlopsOutputType": { "type": "object", diff --git a/tools/projmgr/src/ProjMgrCbuildMlops.cpp b/tools/projmgr/src/ProjMgrCbuildMlops.cpp index 5968a4778..d2ed54301 100644 --- a/tools/projmgr/src/ProjMgrCbuildMlops.cpp +++ b/tools/projmgr/src/ProjMgrCbuildMlops.cpp @@ -31,6 +31,7 @@ class ProjMgrCbuildMlops : public ProjMgrCbuildBase { ProjMgrCbuildMlops::ProjMgrCbuildMlops(YAML::Node node, const MlopsType& mlops, const std::string& directory) : m_directory(directory) { + SetNodeValue(node[YAML_GENERATED_BY], ORIGINAL_FILENAME + string(" version ") + VERSION_STRING); SetNodeValue(node[YAML_DESCRIPTION], mlops.description); SetProcessorNode(node[YAML_PROCESSOR], mlops.processor); SetNpuNode(node[YAML_NPU], mlops.npu); diff --git a/tools/projmgr/test/data/MLOps/ref/extended.cbuild-mlops.yml b/tools/projmgr/test/data/MLOps/ref/extended.cbuild-mlops.yml index 73dc97620..11d6e4eb4 100644 --- a/tools/projmgr/test/data/MLOps/ref/extended.cbuild-mlops.yml +++ b/tools/projmgr/test/data/MLOps/ref/extended.cbuild-mlops.yml @@ -1,4 +1,5 @@ cbuild-mlops: + generated-by: csolution version 0.0.0 description: ML model with extended configuration processor: type: Cortex-M0 diff --git a/tools/projmgr/test/data/MLOps/ref/minimal.cbuild-mlops.yml b/tools/projmgr/test/data/MLOps/ref/minimal.cbuild-mlops.yml index 2bec0bc41..4b0185bbd 100644 --- a/tools/projmgr/test/data/MLOps/ref/minimal.cbuild-mlops.yml +++ b/tools/projmgr/test/data/MLOps/ref/minimal.cbuild-mlops.yml @@ -1,4 +1,5 @@ cbuild-mlops: + generated-by: csolution version 0.0.0 description: ML model with minimal configuration processor: type: Cortex-M0 diff --git a/tools/projmgr/test/data/MLOps/ref/minimal_image_only.cbuild-mlops.yml b/tools/projmgr/test/data/MLOps/ref/minimal_image_only.cbuild-mlops.yml index ce08796ce..e1efc2590 100644 --- a/tools/projmgr/test/data/MLOps/ref/minimal_image_only.cbuild-mlops.yml +++ b/tools/projmgr/test/data/MLOps/ref/minimal_image_only.cbuild-mlops.yml @@ -1,4 +1,5 @@ cbuild-mlops: + generated-by: csolution version 0.0.0 description: ML model with minimal image-only configuration processor: type: Cortex-M0