Skip to content

[projmgr] Improve layer pattern validation in schema - #2712

Merged
jkrech merged 2 commits into
mainfrom
validate-layer-file-paths
Nov 17, 2026
Merged

jkrech merged 2 commits into
mainfrom
validate-layer-file-paths

Conversation

@brondani

Copy link
Copy Markdown
Collaborator

Fixes

Changes

  • Restrict the layer field to .clayer.[yml|yaml] paths or $...$ variables.
  • Add schema checker tests for valid and invalid layer values, including paths with symbols and variable-based paths.

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

@brondani brondani changed the title Validate layer file paths and variables in schema [projmgr] Improve layer pattern validation in schema Nov 17, 2026
@github-actions

Copy link
Copy Markdown

Test Results

    2 files   -    43     14 suites   - 153   16m 31s ⏱️ - 3m 57s
  501 tests  - 1 278    501 ✅  - 1 261  0 💤  - 17  0 ❌ ±0 
1 002 runs   - 3 256  1 002 ✅  - 3 187  0 💤  - 69  0 ❌ ±0 

Results for commit 4c94e7d. ± Comparison against base commit 84b2269.

This pull request removes 1279 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
…
ProjMgrSchemaCheckerUnitTests ‑ SchemaCheck_LayerPattern

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.

🟡 Changes recommended

The schema now rejects Windows-style relative layer paths that previously reached the parser’s portability warning; it needs to recognize backslash separators and include a regression test.

1 open issue
What changed in this PR

This PR tightens project-manager schema validation for layer references, helping catch malformed paths earlier rather than producing misleading downstream errors.

Changes:

  • Restricts nonempty layer values to .clayer.yml / .clayer.yaml paths or $...$ variables.
  • Clarifies that empty layer values remain allowed.
  • Adds validation cases for extensions, symbols, variables, and empty values.
File Description
tools/​projmgr/​test/​src/​ProjMgrSchemaCheckerUnitTests.cpp Adds valid and invalid layer-pattern test cases.
tools/​projmgr/​schemas/​common.schema.json Adds the layer validation pattern and updates its description.

Review effort: Balanced

@brondani
brondani marked this pull request as ready for review November 17, 2026 15:02
@brondani
brondani requested a review from edriouk November 17, 2026 15:02
@jkrech
jkrech self-requested a review November 17, 2026 20:34

@jkrech jkrech left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@jkrech
jkrech merged commit 92918b8 into main Nov 17, 2026
21 checks passed
@jkrech
jkrech deleted the validate-layer-file-paths branch November 17, 2026 20:36
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.57%. Comparing base (1fe27b8) to head (1785d42).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2712   +/-   ##
=======================================
  Coverage   87.57%   87.57%           
=======================================
  Files         208      208           
  Lines       33748    33748           
=======================================
  Hits        29554    29554           
  Misses       4194     4194           
Flag Coverage Δ
projmgr-cov 95.22% <ø> (ø)

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

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

jkrech pushed a commit that referenced this pull request Nov 18, 2026
## Fixes
- Complementary to #2712

## Changes
- Clarify that project and layer paths refer to `.cproject.yml` and
`.clayer.yml` files in the schema descriptions.

## Checklist
- [x] 🤖 This change is covered by unit tests (if applicable).
- [x] 🤹 Manual testing has been performed (if necessary).
- [x] 🛡️ Security impacts have been considered (if relevant).
- [x] 📖 Documentation updates are complete (if required).
- [x] 🧠 Third-party dependencies and TPIP updated (if required).
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