Skip to content

Adjust product_selector print format#694

Open
beojan wants to merge 1 commit into
Framework-R-D:mainfrom
beojan:product-selector-print
Open

Adjust product_selector print format#694
beojan wants to merge 1 commit into
Framework-R-D:mainfrom
beojan:product-selector-print

Conversation

@beojan

@beojan beojan commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Addresses #677.

Will generate [<suffix>][::<concept>][ by <creator>[ (of <stage>)]][ in <layer>]
where square brackets indicate optional sections. If stage is specified but not creator,
creator will be [ANY].

  • Code

    • Reworked phlex::product_selector::to_string() to emit the new selector format: [<suffix>][::<concept>][ by <creator>[ (of <stage>)]][ in <layer>].
    • Built the string from optional components so each section is only included when present.
    • Preserved the special fallback where a stage without a creator renders the creator as [ANY].
    • Removed the old ϵ-based formatting path.
  • Tests

    • Updated test/provider_test.cpp expectations to match the revised product selector/error-message formatting in provider build/execute failure cases.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Alright, quick one: product_selector::to_string() got a rewrite so it composes its output from individual optional pieces (suffix, type, creator/stage, layer) instead of the old "ϵ" symbol format. The two matching test assertions in provider_test.cpp were updated to check the new message breakdown.

Changes

Product Selector String Formatting

Layer / File(s) Summary
to_string() rewrite
phlex/core/product_selector.cpp
Builds output string from optional suffix, type, creator/stage, and layer segments using `experimental::identifier` conversions and `fmt::format`, replacing the previous "ϵ"-separated format.
Updated error message assertions
test/provider_test.cpp
Two `CHECK_THROWS_WITH` tests updated to check substrings matching the new message composition (product name, "by vertices_maker", "in spill", node name) instead of the old combined "vertices_maker/happy_vertices" pattern.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Poem

A rabbit hopped through selector code,
Swapped out "ϵ" for a cleaner mode,
Suffix, type, and creator combine,
While tests now check a fresher line—
Refactor done, no bugs to bode! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating product_selector's printed string format.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greenc-FNAL

Copy link
Copy Markdown
Contributor

21 fixed, 0 new since branch point (fc6b297)

✅ 21 CodeQL alerts resolved since the branch point

  • Warning # 196 actions/untrusted-checkout-toctou/critical at .github/workflows/clang-tidy-fix.yaml:109:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 227 actions/untrusted-checkout-toctou/high at .github/workflows/clang-format-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 228 actions/untrusted-checkout-toctou/high at .github/workflows/python-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 229 actions/untrusted-checkout/high at .github/workflows/clang-format-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 230 actions/untrusted-checkout/high at .github/workflows/python-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 231 actions/untrusted-checkout-toctou/high at .github/workflows/cmake-format-fix.yaml:94:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 232 actions/untrusted-checkout-toctou/high at .github/workflows/jsonnet-format-fix.yaml:95:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
    Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • Warning # 233 actions/untrusted-checkout/high at .github/workflows/cmake-format-fix.yaml:94:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 234 actions/untrusted-checkout/high at .github/workflows/jsonnet-format-fix.yaml:95:9 — Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
    Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: issue_comment).
  • Warning # 235 actions/untrusted-checkout/medium at .github/workflows/clang-format-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 236 actions/untrusted-checkout/medium at .github/workflows/actionlint-check.yaml:86:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 237 actions/untrusted-checkout/medium at .github/workflows/clang-tidy-check.yaml:59:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 238 actions/untrusted-checkout/medium at .github/workflows/cmake-format-check.yaml:79:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 239 actions/untrusted-checkout/medium at .github/workflows/cmake-build.yaml:159:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 240 actions/untrusted-checkout/medium at .github/workflows/header-guards-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 241 actions/untrusted-checkout/medium at .github/workflows/jsonnet-format-check.yaml:79:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 242 actions/untrusted-checkout/medium at .github/workflows/markdown-check.yaml:82:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 243 actions/untrusted-checkout/medium at .github/workflows/python-check.yaml:84:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 244 actions/untrusted-checkout/medium at .github/workflows/yaml-check.yaml:76:9 — Potential unsafe checkout of untrusted pull request on privileged workflow.
  • Warning # 245 actions/untrusted-checkout-toctou/high at .github/workflows/coverage.yaml:386:9 — Insufficient protection against execution of untrusted code on a privileged workflow (issue_comment).
  • ✅ …and 1 more alerts (see Code Scanning for the full list).

Review the full CodeQL report for details.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@phlex/core/product_selector.cpp`:
- Around line 74-90: The creator formatting in product_selector.cpp does not
handle the stage-without-creator case, so the documented [ANY] fallback is
missing. Update the creator_str logic in the selector formatting path to detect
when stage.has_value() is true but creator is empty/falsy, and render [ANY]
instead of formatting an empty creator; keep the existing behavior for present
creators and no-stage cases. Also add a test in provider_test.cpp covering the
stage set with no creator path to verify the expected output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ea160492-9125-45c6-948f-da3b5f8dbdf8

📥 Commits

Reviewing files that changed from the base of the PR and between fc6b297 and 8aefb8a.

📒 Files selected for processing (2)
  • phlex/core/product_selector.cpp
  • test/provider_test.cpp
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: Analyze cpp with CodeQL
  • GitHub Check: build (gcc, none)
  • GitHub Check: clang-tidy-check
⚠️ CI failures not shown inline (2)

GitHub Actions: beojan checking C++ code format / clang-format-check: beojan checking C++ code format

Conclusion: failure

View job details

##[group]Run REPO_NAME="${REPO##*/}"
 �[36;1mREPO_NAME="${REPO##*/}"�[0m
 �[36;1mif [ "success" = 'success' ]; then�[0m
 �[36;1m  echo "✅ clang-format check passed."�[0m
 �[36;1melse�[0m
 �[36;1m  echo "::error::clang-format check failed. Please review the output above for details."�[0m

GitHub Actions: beojan checking C++ code format / 0_clang-format-check.txt: beojan checking C++ code format

Conclusion: failure

View job details

##[group]Run REPO_NAME="${REPO##*/}"
 �[36;1mREPO_NAME="${REPO##*/}"�[0m
 �[36;1mif [ "success" = 'success' ]; then�[0m
 �[36;1m  echo "✅ clang-format check passed."�[0m
 �[36;1melse�[0m
 �[36;1m  echo "::error::clang-format check failed. Please review the output above for details."�[0m
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{cpp,cc,cxx,h,hpp}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{cpp,cc,cxx,h,hpp}: Use clang-format tool for all C++ code formatting (VS Code auto-formats on save); configuration defined in .clang-format with 100-character line limit and 2-space indentation
Follow clang-tidy recommendations defined in .clang-tidy

Files:

  • test/provider_test.cpp
  • phlex/core/product_selector.cpp
**/*.{hpp,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{hpp,cpp}: Use .hpp for header files, .cpp for implementation, and *_test.cpp for test files in C++
Enforce 100-character line limit and 2-space indentation in C++ code via .clang-format
Use QualifierAlignment: Right (east-const) style: int const x not const int x in C++
Use PointerAlignment: Left in C++ (pointer * attached to type, not variable name)
All C++ identifiers must use lower_case naming: namespaces, classes, structs, enums, functions, variables, parameters, members, and constants
Exception to C++ naming: template parameters use CamelCase
Exception to C++ naming: macros use UPPER_CASE
Private, protected, and constant members in C++ must have a trailing underscore (_), no trailing underscore on anything else
Use enum class preferred over plain enum in C++
Use std::shared_ptr for shared ownership, std::unique_ptr for exclusive ownership, raw pointers for non-owning references only in C++
Use functors with agent-noun pattern: ModelEvaluator evaluate_model(...) in C++
Apply .clang-tidy checks for bugprone, cert, clang-analyzer, concurrency, cppcoreguidelines, misc, modernize, performance, portability, and readability as defined in the .clang-tidy configuration file
Use phlex:: namespace for core code, phlex::experimental:: for experimental features in C++

Files:

  • test/provider_test.cpp
  • phlex/core/product_selector.cpp
🔇 Additional comments (3)
phlex/core/product_selector.cpp (2)

80-83: LGTM!


77-79: 🎯 Functional Correctness

No change needed for std::optional::transform. CMakePresets.json sets CMAKE_CXX_STANDARD to 23, so this usage matches the project’s C++ dialect.

			> Likely an incorrect or invalid review comment.
test/provider_test.cpp (1)

173-175: LGTM!

Assertions match the new to_string() composition, though as noted in product_selector.cpp, consider adding a case that covers stage-without-creator to actually exercise the [ANY] fallback the format comment promises.

Also applies to: 197-198

Comment thread phlex/core/product_selector.cpp
@beojan beojan requested a review from knoepfel July 6, 2026 17:23
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

Found 5762 issue(s); none are newly introduced by this patch.

All issues by check:

  • readability-identifier-naming: 2132
  • readability-redundant-member-init: 1337
  • portability-template-virtual-member-function: 575
  • performance-unnecessary-value-param: 531
  • readability-avoid-const-params-in-decls: 278
  • modernize-pass-by-value: 215
  • readability-braces-around-statements: 123
  • modernize-use-designated-initializers: 90
  • readability-convert-member-functions-to-static: 85
  • readability-const-return-type: 50
  • modernize-use-auto: 31
  • performance-move-const-arg: 29
  • readability-qualified-auto: 24
  • performance-enum-size: 24
  • readability-redundant-control-flow: 23
  • modernize-use-using: 19
  • modernize-concat-nested-namespaces: 17
  • modernize-use-equals-default: 17
  • readability-math-missing-parentheses: 16
  • modernize-avoid-c-arrays: 15
  • readability-function-size: 14
  • readability-static-definition-in-anonymous-namespace: 14
  • bugprone-branch-clone: 12
  • modernize-return-braced-init-list: 10
  • readability-isolate-declaration: 8
  • modernize-use-starts-ends-with: 8
  • readability-redundant-access-specifiers: 7
  • readability-container-size-empty: 7
  • cppcoreguidelines-special-member-functions: 7
  • readability-inconsistent-declaration-parameter-name: 6
  • modernize-use-ranges: 6
  • bugprone-throw-keyword-missing: 6
  • readability-redundant-casting: 5
  • readability-container-contains: 5
  • modernize-use-std-numbers: 3
  • readability-use-anyofallof: 2
  • readability-else-after-return: 2
  • modernize-use-integer-sign-comparison: 2
  • modernize-make-shared: 1
  • cppcoreguidelines-rvalue-reference-param-not-moved: 1
  • performance-avoid-endl: 1
  • modernize-redundant-void-arg: 1
  • readability-redundant-string-init: 1
  • modernize-use-emplace: 1
  • readability-simplify-boolean-expr: 1

See inline comments for details. Comment @phlexbot tidy-fix to auto-fix.

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.

2 participants