Skip to content

[projmgr] MLOps: handle image-only target-set#2475

Merged
brondani merged 2 commits into
mainfrom
projmgr-mlops-image-only
May 15, 2026
Merged

[projmgr] MLOps: handle image-only target-set#2475
brondani merged 2 commits into
mainfrom
projmgr-mlops-image-only

Conversation

@brondani
Copy link
Copy Markdown
Collaborator

@brondani brondani commented May 15, 2026

Fixes

Changes

  • In addition to target-sets with project-context, handle target-sets with image (image-only)

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

Test Results

    3 files   -    55     21 suites   - 155   18m 30s ⏱️ - 8m 54s
  464 tests  -   450    464 ✅  -   433  0 💤  - 17  0 ❌ ±0 
1 392 runs   - 1 487  1 392 ✅  - 1 419  0 💤  - 68  0 ❌ ±0 

Results for commit 550a06e. ± Comparison against base commit af2c644.

This pull request removes 451 and adds 1 tests. Note that renamed tests count towards both.
AuxCmdTests ‑ MkdirCmdTest
AuxCmdTests ‑ RmdirCmdTest
AuxCmdTests ‑ TouchCmdTest
BuildSystemGeneratorTests ‑ GenAuditFile
BuildSystemGeneratorTests ‑ GenAuditFile_WithOut_Existing_Audit_File
BuildSystemGeneratorTests ‑ GenAuditFile_With_Existing_Audit_File
BuildSystemGeneratorTests ‑ GetString
BuildSystemGeneratorTests ‑ StrConv
BuildSystemGeneratorTests ‑ StrNorm
CBuildGCCTests ‑ Asm
…
ProjMgrUnitTests ‑ GenerateMLOps_ImageOnly

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends projmgr MLOps generation to support target sets that provide prebuilt image artifacts instead of only project-context entries.

Changes:

  • Adds image-only context discovery for MLOps target-set handling.
  • Resolves target-set image paths into MLOps run outputs.
  • Adds MLOps image-only test fixtures and expected output.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/projmgr/src/ProjMgrWorker.cpp Adds image-only target-type context creation.
tools/projmgr/include/ProjMgrWorker.h Declares the image-only target helper.
tools/projmgr/src/ProjMgrMlops.cpp Collects image-only contexts and image outputs for MLOps run types.
tools/projmgr/include/ProjMgrMlops.h Updates SetMlopsRunType signature for target-set access.
tools/projmgr/test/src/ProjMgrUnitTests.cpp Adds image-only MLOps tests and updates expected error text.
tools/projmgr/test/data/MLOps/minimal.csolution.yml Updates minimal MLOps fixture metadata.
tools/projmgr/test/data/MLOps/extended.csolution.yml Updates extended MLOps fixture metadata.
tools/projmgr/test/data/MLOps/minimal_image_only.csolution.yml Adds a successful image-only MLOps fixture.
tools/projmgr/test/data/MLOps/ref/minimal_image_only.cbuild-mlops.yml Adds expected MLOps output for image-only fixture.
tools/projmgr/test/data/MLOps/failure_image_only_hw.csolution.yml Adds hardware image path failure fixture.
tools/projmgr/test/data/MLOps/failure_image_only_sim.csolution.yml Adds simulator image path failure fixture.
Comments suppressed due to low confidence (2)

tools/projmgr/src/ProjMgrMlops.cpp:191

  • For image-only target sets, every image entry has an empty project-context, so they all map to the same synthetic context name (csolution.name + "+" + targetType). With multiple images this pushes the same context once per image; SetMlopsRunType then iterates the full targetSet.images for each copied context, duplicating each output in the generated MLOps file.
    for (const auto& entry : targetSet.images) {
      const string contextName = (entry.context.empty() ? csolution.name : entry.context) + "+" + targetType;
      if (contexts->find(contextName) != contexts->end()) {
        // process context precedences if needed
        auto& context = contexts->at(contextName);
        if (!context.precedences) {
          if (!m_worker->ParseContextLayers(context) || !m_worker->LoadPacks(context) ||
            !m_worker->ProcessPrecedences(context, BoardOrDevice::Both) ||
            !m_worker->SetTargetAttributes(context, context.targetAttributes)) {
            return false;
          }
          m_worker->CollectNpuInfo(context);
        }
        ref.push_back(context);

tools/projmgr/src/ProjMgrMlops.cpp:142

  • This infers the image type solely from the filename extension and ignores ImageItem::type. Target-set images can specify an explicit type (the run-debug path preserves it in ProjMgrRunDebug.cpp), so an image such as firmware.out with type: elf would be omitted from MLOps output even though the user declared it as an ELF image.
          if (ProjMgrUtils::FileTypeFromExtension(item.image) == RteConstants::OUTPUT_TYPE_ELF) {
            MlopsOutputType output;
            output.file = item.image;
            output.type = RteConstants::OUTPUT_TYPE_ELF;
            run.output.push_back(output);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/projmgr/src/ProjMgrWorker.cpp
Comment thread tools/projmgr/src/ProjMgrMlops.cpp
@brondani brondani marked this pull request as ready for review May 15, 2026 10:11
@brondani brondani requested a review from soumeh01 May 15, 2026 10:11
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 87.75510% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.22%. Comparing base (af2c644) to head (550a06e).

Files with missing lines Patch % Lines
tools/projmgr/src/ProjMgrMlops.cpp 81.81% 1 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2475      +/-   ##
==========================================
+ Coverage   65.18%   65.22%   +0.03%     
==========================================
  Files         147      147              
  Lines       26633    26659      +26     
  Branches    16140    16155      +15     
==========================================
+ Hits        17362    17389      +27     
+ Misses       7072     7071       -1     
  Partials     2199     2199              
Flag Coverage Δ
projmgr-cov 87.91% <87.75%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tools/projmgr/include/ProjMgrWorker.h 83.33% <ø> (ø)
tools/projmgr/src/ProjMgrWorker.cpp 87.37% <100.00%> (+0.06%) ⬆️
tools/projmgr/src/ProjMgrMlops.cpp 81.76% <81.81%> (+1.52%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@soumeh01 soumeh01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brondani brondani merged commit b0c395c into main May 15, 2026
33 checks passed
@brondani brondani deleted the projmgr-mlops-image-only branch May 15, 2026 10: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.

3 participants