Skip to content

[projmgr] Adjust relative paths in misc nodes#2501

Merged
brondani merged 3 commits into
mainfrom
projmgr-misc-adjust-relative
Jun 23, 2026
Merged

[projmgr] Adjust relative paths in misc nodes#2501
brondani merged 3 commits into
mainfrom
projmgr-misc-adjust-relative

Conversation

@brondani

@brondani brondani commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Fixes

Changes

  • Added ProjMgrUtils::AdjustRelativePaths() to detect relative paths (./ or ../) in solution-, project-, and layer-level misc option fields, and adjust the original references across all supported misc node elements.
  • Added test cases

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).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes conversion output correctness by ensuring relative paths embedded in misc option strings (solution/project/layer level) are rewritten so they remain valid in the generated *.cbuild.yml files.

Changes:

  • Added ProjMgrUtils::AdjustRelativePaths() and invoked it during misc option processing in ProjMgrWorker.
  • Added a focused unit test for AdjustRelativePaths() plus an end-to-end conversion test covering misc fields at solution/project/layer scopes.
  • Added new test fixtures (TestMiscRelativePaths) and a reference cbuild.yml for regression validation.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/projmgr/src/ProjMgrUtils.cpp Implements AdjustRelativePaths() for rewriting ./ / ../ fragments in misc option strings.
tools/projmgr/include/ProjMgrUtils.h Declares the new utility function.
tools/projmgr/src/ProjMgrWorker.cpp Applies the new adjustment to all misc option vectors before sequence/relative processing.
tools/projmgr/test/src/ProjMgrUtilsUnitTests.cpp Adds a direct unit test for the new utility behavior.
tools/projmgr/test/src/ProjMgrUnitTests.cpp Adds an integration test validating misc-relative conversion output vs. a reference file.
tools/projmgr/test/data/TestMiscRelativePaths/ref/misc-relative.Debug+TEST_TARGET.cbuild.yml Reference expected cbuild.yml output validating corrected misc paths.
tools/projmgr/test/data/TestMiscRelativePaths/misc-relative.csolution.yml New solution fixture containing misc fields with ./ references.
tools/projmgr/test/data/TestMiscRelativePaths/project/misc-relative.cproject.yml New project fixture containing misc fields with ./ references and a layer reference.
tools/projmgr/test/data/TestMiscRelativePaths/layers/misc-relative.clayer.yml New layer fixture containing misc fields with ./ references and a source file.
tools/projmgr/test/data/TestMiscRelativePaths/main.c Minimal source fixture for the conversion test.

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

Comment thread tools/projmgr/src/ProjMgrUtils.cpp
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Test Results

    3 files     21 suites   17m 9s ⏱️
  469 tests   469 ✅ 0 💤 0 ❌
1 407 runs  1 407 ✅ 0 💤 0 ❌

Results for commit 220d474.

♻️ This comment has been updated with latest results.

@brondani brondani marked this pull request as ready for review June 23, 2026 09:33
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.24%. Comparing base (859cb6c) to head (220d474).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tools/projmgr/src/ProjMgrWorker.cpp 50.00% 1 Missing and 1 partial ⚠️
tools/projmgr/src/ProjMgrUtils.cpp 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2501      +/-   ##
==========================================
- Coverage   65.24%   65.24%   -0.01%     
==========================================
  Files         147      147              
  Lines       26675    26675              
  Branches    16166    16164       -2     
==========================================
- Hits        17405    17404       -1     
  Misses       7074     7074              
- Partials     2196     2197       +1     
Flag Coverage Δ
projmgr-cov 87.92% <75.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
tools/projmgr/include/ProjMgrUtils.h 87.50% <ø> (ø)
tools/projmgr/src/ProjMgrUtils.cpp 93.62% <87.50%> (-0.17%) ⬇️
tools/projmgr/src/ProjMgrWorker.cpp 87.39% <50.00%> (-0.02%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brondani brondani requested a review from edriouk June 23, 2026 12:39

@edriouk edriouk left a comment

Copy link
Copy Markdown
Contributor

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 2054682 into main Jun 23, 2026
33 checks passed
@brondani brondani deleted the projmgr-misc-adjust-relative branch June 23, 2026 12:46
@github-project-automation github-project-automation Bot moved this from In progress to In review in CMSIS-Toolbox 2.1x Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants