Skip to content

Conversation

sitaowang1998
Copy link
Contributor

@sitaowang1998 sitaowang1998 commented Jun 5, 2025

Description

This pr removes outcome library from the project. This pr replaces outcome_v2::std::result in the core with ystdlib::error_handling::Result. This pr also bumps ystdlib-cpp version so it now depends on Boost::outcome instead of outcome.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • GitHub workflows pass.
  • core builds and unit tests pass.

Summary by CodeRabbit

  • Refactor

    • Updated the underlying error handling mechanism throughout the application to use a new result type from ystdlib. This change affects log event deserialization, query handling, search utilities, serialization, regex translation, and related components. All error and result reporting now utilize the new approach, with no impact on user-facing functionality or workflows.
  • Chores

    • Removed the obsolete "outcome" dependency and updated the "ystdlib" dependency to a new version.

@sitaowang1998 sitaowang1998 requested review from gibber9809, wraymo and a team as code owners June 5, 2025 19:40
Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

## 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

  • y-scope/clp#858: Removes Outcome submodule and migrates error handling to ystdlib, related to this PR's replacement of Outcome with ystdlib Result types.
  • y-scope/clp#859: Modifies NewProjectedSchemaTreeNodeCallbackReq concept, related to the return type change in this PR.
  • y-scope/clp#581: Refactors get_schema_subtree_bitmap function also updated here to use the new result type.

Suggested reviewers

  • kirkrodrigues

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: ASSERTIVE**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 61a9c386270846d59c0de4119b83c579a51b9f22 and 3db62bc5e07efb11387c77558dff74c8e6a37a23.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `components/core/CMakeLists.txt` (0 hunks)
* `taskfiles/deps/main.yaml` (1 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (1)</summary>

* components/core/CMakeLists.txt

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (6)</summary>

* GitHub Check: centos-stream-9-static-linked-bins
* GitHub Check: centos-stream-9-dynamic-linked-bins
* GitHub Check: ubuntu-jammy-lint
* GitHub Check: ubuntu-jammy-dynamic-linked-bins
* GitHub Check: ubuntu-jammy-static-linked-bins
* GitHub Check: lint-check (ubuntu-latest)

</details>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>taskfiles/deps/main.yaml (1)</summary>

`386-388`: <details>
<summary>✅ Verification successful</summary>

**Verify updated ystdlib download URL and checksum.**

Ensure the SHA256 checksum matches the new tarball at the specified GitHub URL.

---

🏁 Script executed:

```shell
#!/bin/bash
URL="https://github.com/y-scope/ystdlib-cpp/archive/d80cf86.tar.gz"
FILE="ystdlib.tar.gz"
curl -L "$URL" -o "$FILE"
echo "Computed checksum: $(sha256sum "$FILE" | awk '{print $1}')"
echo "Expected checksum: 36fa0e9d96b7307ca92482343d6ba1091c5576370676e6d423cce32c20e34a3d"

Length of output: 1029


It looks like sha256sum isn’t available in this environment. Let’s calculate the SHA-256 via Python:


🏁 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")
EOF

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

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e863f59 and 2497ebf.

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

Copy link
Member

@LinZhihao-723 LinZhihao-723 left a comment

Choose a reason for hiding this comment

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

We're missing ystdlib::error_handling target in the following targets' cmake lists:

  • clp/clg
  • clp/clo
  • clp/clp

@sitaowang1998 sitaowang1998 changed the title refactor: Use ystdlib::error_handling::Result instead of outcome_v2::std_result. refactor(core): Use ystdlib::error_handling::Result instead of outcome_v2::std_result. Jun 6, 2025
Copy link
Member

@LinZhihao-723 LinZhihao-723 left a comment

Choose a reason for hiding this comment

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

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.

@sitaowang1998 sitaowang1998 changed the title refactor(core): Use ystdlib::error_handling::Result instead of outcome_v2::std_result. refactor(core): Replace outcome_v2::std_result with ystdlib::error_handling::Result; Remove outcome from the build dependency. Jun 7, 2025
@LinZhihao-723 LinZhihao-723 changed the title refactor(core): Replace outcome_v2::std_result with ystdlib::error_handling::Result; Remove outcome from the build dependency. refactor(core): Replace outcome_v2::std_result with ystdlib::error_handling::Result; Remove outcome dependency. Jun 8, 2025
Copy link
Member

@LinZhihao-723 LinZhihao-723 left a comment

Choose a reason for hiding this comment

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

lgtm.
Polished the title a little more and directly modified it. Feel free to place any comment.

@sitaowang1998 sitaowang1998 merged commit db6d7a2 into y-scope:main Jun 8, 2025
22 checks passed
@sitaowang1998 sitaowang1998 deleted the boost_outcome branch June 8, 2025 20:54
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