refactor(core): Replace outcome_v2::std_result with ystdlib::error_handling::Result; Remove outcome dependency. - #969
Conversation
## Walkthrough
This change replaces all usages of the `OUTCOME_V2_NAMESPACE::std_result` error/result type with `ystdlib::error_handling::Result` throughout the codebase. It updates function signatures, macros, includes, and type references accordingly, removes the Outcome dependency from build scripts, and updates the `ystdlib` dependency version.
## Changes
| Files/Groups | Change Summary |
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| `components/core/src/clp/ffi/KeyValuePairLogEvent.cpp`, `.hpp` | Replaced `OUTCOME_V2_NAMESPACE::std_result` with `ystdlib::error_handling::Result` in all function signatures and includes. |
| `components/core/src/clp/ffi/ir_stream/Deserializer.hpp`, `Serializer.cpp`, `Serializer.hpp` | Updated all result types and macros from Outcome to ystdlib equivalents; changed includes. |
| `components/core/src/clp/ffi/ir_stream/ir_unit_deserialization_methods.cpp`, `.hpp` | Switched all function return types from Outcome to ystdlib result types and updated includes. |
| `components/core/src/clp/ffi/ir_stream/ir_unit_deserialization_methods.hpp` | Updated function return types from Outcome to ystdlib result types. |
| `components/core/src/clp/ffi/ir_stream/search/NewProjectedSchemaTreeNodeCallbackReq.hpp` | Changed concept constraint return type from Outcome to ystdlib result type. |
| `components/core/src/clp/ffi/ir_stream/search/QueryHandler.hpp`, `QueryHandlerImpl.cpp`, `QueryHandlerImpl.hpp` | Replaced all Outcome result types, macros, and includes with ystdlib equivalents throughout QueryHandler and its implementation. |
| `components/core/src/clp/ffi/ir_stream/search/test/test_QueryHandlerImpl.cpp`, `utils.cpp`, `utils.hpp` | Updated test and utility code to use ystdlib result types and success functions instead of Outcome. |
| `components/core/src/clp/ffi/ir_stream/search/utils.cpp`, `utils.hpp` | Changed function return types from Outcome to ystdlib in filter evaluation utilities. |
| `components/core/src/clp/ffi/ir_stream/utils.hpp` | Updated template and lambda return types from Outcome to ystdlib result types. |
| `components/core/src/clp/ir/LogEventDeserializer.cpp`, `.hpp` | Switched result types in deserializer methods and specializations to ystdlib. |
| `components/core/src/clp/regex_utils/regex_translation_utils.cpp`, `.hpp` | Changed regex translation utility function return types from Outcome to ystdlib. |
| `components/core/src/clp_s/kv_ir_search.cpp`, `.hpp` | Updated all result types, macros, and includes from Outcome to ystdlib in IR search logic. |
| `components/core/src/glt/ir/LogEventDeserializer.cpp`, `.hpp` | Replaced Outcome result types with ystdlib in GLT log event deserializer methods. |
| `taskfiles/deps/main.yaml` | Removed Outcome dependency, updated ystdlib dependency version and checksum. |
| `components/core/src/glt/glt/CMakeLists.txt` | Added private link dependency on `ystdlib::error_handling` to `glt` executable target. |
| `components/core/src/clp/clg/CMakeLists.txt`, `clo/CMakeLists.txt`, `clp/CMakeLists.txt`, `regex_utils/CMakeLists.txt`, `clp_s/CMakeLists.txt`, `core/CMakeLists.txt` | Removed `${CLP_OUTCOME_INCLUDE_DIRECTORY}` from private/public include directories of various targets. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant Caller
participant Function
participant ErrorHandling
Caller->>Function: Call function returning Result<T>
Function->>ErrorHandling: Return ystdlib::error_handling::Result<T>
ErrorHandling-->>Caller: Result<T> (success or error)Possibly related PRs
Suggested reviewers
Length of output: 1029 It looks like 🏁 Script executed: #!/bin/bash
URL="https://github.com/y-scope/ystdlib-cpp/archive/d80cf86.tar.gz"
FILE="ystdlib.tar.gz"
# Download the tarball
curl -Ls "$URL" -o "$FILE"
# Compute checksum using Python
python3 - << 'EOF'
import hashlib
h = hashlib.sha256()
with open('ystdlib.tar.gz', 'rb') as f:
for chunk in iter(lambda: f.read(8192), b''):
h.update(chunk)
print("Computed checksum:", h.hexdigest())
print("Expected checksum: 36fa0e9d96b7307ca92482343d6ba1091c5576370676e6d423cce32c20e34a3d")
EOFLength of output: 360 Checksum and URL Verified The SHA256 checksum for the tarball at https://github.com/y-scope/ystdlib-cpp/archive/d80cf86.tar.gz has been computed and matches the expected value (36fa0e9d96b7307ca92482343d6ba1091c5576370676e6d423cce32c20e34a3d). No further action is required. 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/core/src/glt/glt/CMakeLists.txt(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (11)
- GitHub Check: ubuntu-jammy-lint
- GitHub Check: centos-stream-9-static-linked-bins
- GitHub Check: centos-stream-9-dynamic-linked-bins
- GitHub Check: ubuntu-jammy-static-linked-bins
- GitHub Check: ubuntu-jammy-dynamic-linked-bins
- GitHub Check: lint-check (ubuntu-latest)
- GitHub Check: build-macos (macos-15, false)
- GitHub Check: build-macos (macos-14, false)
- GitHub Check: build-macos (macos-15, true)
- GitHub Check: build-macos (macos-14, true)
- GitHub Check: lint-check (macos-latest)
LinZhihao-723
left a comment
There was a problem hiding this comment.
We're missing ystdlib::error_handling target in the following targets' cmake lists:
- clp/clg
- clp/clo
- clp/clp
ystdlib::error_handling::Result instead of outcome_v2::std_result.ystdlib::error_handling::Result instead of outcome_v2::std_result.
LinZhihao-723
left a comment
There was a problem hiding this comment.
Only one more comment and we should be ready to merge. For the PR title, how about:
refactor(core): Replace `outcome_v2::std_result` with `ystdlib::error_handling::Result`; Remove `outcome` from the build dependency.
ystdlib::error_handling::Result instead of outcome_v2::std_result.outcome_v2::std_result with ystdlib::error_handling::Result; Remove outcome from the build dependency.
outcome_v2::std_result with ystdlib::error_handling::Result; Remove outcome from the build dependency.outcome_v2::std_result with ystdlib::error_handling::Result; Remove outcome dependency.
LinZhihao-723
left a comment
There was a problem hiding this comment.
lgtm.
Polished the title a little more and directly modified it. Feel free to place any comment.
…_handling::Result`; Remove `outcome` dependency. (y-scope#969)
Description
This pr removes
outcomelibrary from the project. This pr replacesoutcome_v2::std::resultin thecorewithystdlib::error_handling::Result. This pr also bumpsystdlib-cppversion so it now depends onBoost::outcomeinstead ofoutcome.Checklist
breaking change.
Validation performed
Summary by CodeRabbit
Refactor
Chores