refactor(util): consume goggles_core for error and profiling types#138
refactor(util): consume goggles_core for error and profiling types#138
Conversation
- Delete duplicated error.hpp and profiling.hpp from src/util/ - Link goggles_core through goggles_util and visual test targets - Remove fragile GOGGLES_ERROR_TYPES_DEFINED ODR guards - Rewrite all include paths in src/ and tests/ to <goggles/error.hpp> - Update boundary contract test to reflect relocated canonical headers
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (40)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThis PR migrates the codebase's error and profiling infrastructure from internal Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Review Summary by QodoConsume goggles_core for error and profiling types
WalkthroughsDescription• Eliminate duplicate error and profiling headers from src/util/ • Replace all local includes with goggles_core public headers • Update CMake to link goggles_core instead of nonstd::expected-lite • Remove fragile ODR guards from error type definitions • Update boundary contract test to reflect canonical header locations Diagramflowchart LR
A["src/util/error.hpp<br/>src/util/profiling.hpp"] -->|"Delete duplicates"| B["goggles_core<br/>canonical headers"]
C["All source files<br/>include util/error.hpp"] -->|"Migrate to"| D["include goggles/error.hpp"]
E["All source files<br/>include util/profiling.hpp"] -->|"Migrate to"| F["include goggles/profiling.hpp"]
G["CMakeLists.txt<br/>nonstd::expected-lite"] -->|"Replace with"| H["goggles_core dependency"]
File Changes1. src/util/error.hpp
|
Code Review by Qodo
1. Brittle submodule header path
|
| const auto canonical_error_hpp = | ||
| std::filesystem::path(GOGGLES_SOURCE_DIR) / "filter-chain/common/include/goggles/error.hpp"; |
There was a problem hiding this comment.
1. Brittle submodule header path 🐞 Bug ⛯ Reliability
The boundary contract test now reads the canonical error header from a hardcoded submodule-internal path (filter-chain/common/include/...), so the test fails if the filter-chain checkout layout differs from this exact tree.
Agent Prompt
## Issue description
`tests/render/test_filter_boundary_contracts.cpp` hardcodes the filter-chain canonical error header path to `filter-chain/common/include/goggles/error.hpp`. The test reads this file from the source tree and fails when the filter-chain checkout layout differs.
## Issue Context
The project supports configuring `GOGGLES_FILTER_CHAIN_SOURCE_DIR` to point at an arbitrary filter-chain checkout, and the submodule layout can evolve. Boundary tests should validate the *public* headers / contracts without depending on submodule-internal directory structure.
## Fix Focus Areas
- tests/render/test_filter_boundary_contracts.cpp[359-383]
## Suggested changes
- Prefer checking the installed/public header path (e.g., under `filter-chain/include/...`) if that is the stable contract.
- If the new canonical header truly lives under `common/include`, make the test compute the path from `GOGGLES_FILTER_CHAIN_SOURCE_DIR` (add a CMake definition for it) rather than assuming it is always `${GOGGLES_SOURCE_DIR}/filter-chain/...`.
- Alternatively, change the test to validate the *include directives* in the canonical headers by including them (compile-time) rather than reading from the filesystem at runtime.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary by CodeRabbit