Introduce layer_path class#640
Conversation
Led to a fair number of components using layer_path, but drivers still use strings to avoid changing API.
✅ 7 CodeQL alerts resolved compared to main
Review the full CodeQL report for details. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3077e35b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| bool layer_path::is_strict_prefix_of(layer_path const& other) const noexcept | ||
| { | ||
| return std::ranges::starts_with(other.layer_path_, layer_path_); |
There was a problem hiding this comment.
Preserve strictness when comparing layer paths
When a driver supplies the same layer path more than once, std::ranges::starts_with returns true for the equal paths, even though is_strict_prefix_of is supposed to be strict. index_router::establish_layers uses this result to mark the earlier path as non-lowest, so a duplicated lowest layer can get a flush gate and then wait for child rollups that will never be produced, preventing the leaf index from flushing correctly. Add a size check, as the removed helper had, before calling starts_with.
Useful? React with 👍 / 👎.
|
|
||
| bool layer_path::ends_with(layer_path const& other) const noexcept | ||
| { | ||
| return std::ranges::ends_with(layer_path_, other.layer_path_); |
There was a problem hiding this comment.
Reject empty suffixes before matching every layer
For an empty path (for example framework_graph::seen_cell_count("", true) or count_for("/")), std::ranges::ends_with returns true for every stored layer, so this now reports the only layer's count or throws an ambiguity once multiple layers have been seen. The previous string-based check treated these as no match, which is important for callers using missing_ok to probe optional layer names. Guard other.empty() here or in count_for so an empty specification cannot match all layers.
Useful? React with 👍 / 👎.
Clang-Tidy Check Results3 new issue(s) introduced by this patch (5724 total). New issues on modified lines:
All issues by check:
See inline comments for details. Comment |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #640 +/- ##
==========================================
+ Coverage 83.27% 83.29% +0.01%
==========================================
Files 162 165 +3
Lines 5912 5949 +37
Branches 670 667 -3
==========================================
+ Hits 4923 4955 +32
- Misses 796 802 +6
+ Partials 193 192 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Clang-Tidy Check ResultsFound 5721 issue(s); none are newly introduced by this patch. All issues by check:
See inline comments for details. Comment |
The new
layer_pathclass is used inindex_routerand the related infrastructure.I've kept strings and
vector<string>s for now in drivers. That might be the next step.