Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H-3548: Use in-tree version of error-stack again #5563

Merged

Conversation

TimDiekmann
Copy link
Member

@TimDiekmann TimDiekmann commented Nov 3, 2024

🌟 What is the purpose of this PR?

We recently updated the in-tree version of error-stack and added a deprecation to error_stack::{Result, Context}. To not need to address these in the whole workspace this has been deferred to this PR.

🔍 What does this change?

  • Replace error_stack::Result with core::result::Result<_, error_stack::Report<_>>
  • Replace error_stack::Context with core::error::Error

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

@TimDiekmann TimDiekmann requested a review from indietyp November 3, 2024 10:55
@TimDiekmann TimDiekmann self-assigned this Nov 3, 2024
@github-actions github-actions bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/libs Relates to first-party libraries/crates/packages (area) area/libs > deer Affects the `deer` crate (library) type/eng > backend Owned by the @backend team area/tests New or updated tests area/tests > integration New or updated integration tests area/apps area/apps > hash-graph labels Nov 3, 2024
@github-actions github-actions bot added the area/libs > chonky Affects the `chonky` crate (library) label Nov 3, 2024
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 20.14%. Comparing base (9d80768) to head (b1849a6).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
libs/deer/src/macros.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5563   +/-   ##
=======================================
  Coverage   20.14%   20.14%           
=======================================
  Files         509      509           
  Lines       17323    17323           
  Branches     2538     2538           
=======================================
  Hits         3490     3490           
  Misses      13795    13795           
  Partials       38       38           
Flag Coverage Δ
apps.hash-ai-worker-ts 1.38% <ø> (ø)
apps.hash-api 1.19% <ø> (ø)
blockprotocol.type-system 47.40% <ø> (ø)
local.hash-backend-utils 8.80% <ø> (ø)
local.hash-isomorphic-utils 1.05% <ø> (ø)
local.hash-subgraph 24.54% <ø> (ø)
rust.deer 5.88% <0.00%> (ø)
rust.error-stack 73.03% <ø> (ø)
rust.sarif 87.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

libs/deer/src/error/mod.rs Fixed Show fixed Hide fixed
past Bilal really was a genius for naming the `Error` `Error` instead of something else...
Copy link
Member Author

@TimDiekmann TimDiekmann left a comment

Choose a reason for hiding this comment

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

Thanks @indietyp for addressing the Context removal, looks good to me! ✅

Could you give a review on the rest so we can merge it?

indietyp
indietyp previously approved these changes Nov 4, 2024
@TimDiekmann TimDiekmann added this pull request to the merge queue Nov 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 4, 2024
@TimDiekmann TimDiekmann added this pull request to the merge queue Nov 4, 2024
Merged via the queue into main with commit f67bc88 Nov 4, 2024
162 of 163 checks passed
@TimDiekmann TimDiekmann deleted the t/h-3548-use-latest-version-of-error-stack-in-workspace branch November 4, 2024 09:27
Copy link
Contributor

github-actions bot commented Nov 4, 2024

Benchmark results

@rust/graph-benches – Integrations

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 $$1.38 \mathrm{ms} \pm 5.49 \mathrm{μs}\left({\color{gray}0.364 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$2.10 \mathrm{ms} \pm 16.6 \mathrm{μs}\left({\color{gray}0.212 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$4.14 \mathrm{ms} \pm 25.3 \mathrm{μs}\left({\color{gray}-0.235 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.85 \mathrm{ms} \pm 8.00 \mathrm{μs}\left({\color{gray}-0.028 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.88 \mathrm{ms} \pm 8.87 \mathrm{μs}\left({\color{gray}-1.390 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$3.28 \mathrm{ms} \pm 18.4 \mathrm{μs}\left({\color{gray}1.64 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 10 entities $$1.87 \mathrm{ms} \pm 6.12 \mathrm{μs}\left({\color{gray}-0.094 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.76 \mathrm{ms} \pm 11.0 \mathrm{μs}\left({\color{gray}-0.522 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.86 \mathrm{ms} \pm 4.95 \mathrm{μs}\left({\color{gray}-0.162 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$13.5 \mathrm{ms} \pm 65.0 \mathrm{μs}\left({\color{gray}-1.615 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.03 \mathrm{ms} \pm 7.09 \mathrm{μs}\left({\color{gray}0.958 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property depths: DT=255, PT=255, ET=255, E=255 $$68.3 \mathrm{ms} \pm 369 \mathrm{μs}\left({\color{gray}-0.864 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$54.0 \mathrm{ms} \pm 237 \mathrm{μs}\left({\color{gray}-0.746 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$39.8 \mathrm{ms} \pm 330 \mathrm{μs}\left({\color{gray}-0.564 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$49.4 \mathrm{ms} \pm 239 \mathrm{μs}\left({\color{gray}-0.590 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$43.7 \mathrm{ms} \pm 236 \mathrm{μs}\left({\color{gray}-0.630 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$58.5 \mathrm{ms} \pm 373 \mathrm{μs}\left({\color{gray}-0.353 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$107 \mathrm{ms} \pm 423 \mathrm{μs}\left({\color{gray}-0.722 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$93.0 \mathrm{ms} \pm 362 \mathrm{μs}\left({\color{gray}-0.925 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$42.4 \mathrm{ms} \pm 246 \mathrm{μs}\left({\color{gray}-0.279 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$89.0 \mathrm{ms} \pm 485 \mathrm{μs}\left({\color{gray}0.000 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$80.4 \mathrm{ms} \pm 465 \mathrm{μs}\left({\color{gray}-0.324 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$97.7 \mathrm{ms} \pm 318 \mathrm{μs}\left({\color{gray}-0.560 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 10 entities $$45.2 \mathrm{ms} \pm 2.77 \mathrm{ms}\left({\color{gray}0.450 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$269 \mathrm{ms} \pm 1.11 \mathrm{ms}\left({\color{lightgreen}-51.520 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$19.7 \mathrm{ms} \pm 83.2 \mathrm{μs}\left({\color{gray}-1.127 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$25.2 \mathrm{ms} \pm 395 \mathrm{μs}\left({\color{gray}1.07 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$74.8 \mathrm{ms} \pm 494 \mathrm{μs}\left({\color{lightgreen}-16.073 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$16.8 \mathrm{ms} \pm 173 \mathrm{μs}\left({\color{gray}-3.227 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$16.3 \mathrm{ms} \pm 186 \mathrm{μs}\left({\color{gray}-3.328 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$17.1 \mathrm{ms} \pm 203 \mathrm{μs}\left({\color{red}10.3 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$15.5 \mathrm{ms} \pm 172 \mathrm{μs}\left({\color{lightgreen}-11.298 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$16.4 \mathrm{ms} \pm 194 \mathrm{μs}\left({\color{gray}3.62 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$15.9 \mathrm{ms} \pm 165 \mathrm{μs}\left({\color{lightgreen}-6.036 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$17.2 \mathrm{ms} \pm 250 \mathrm{μs}\left({\color{red}5.82 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$15.9 \mathrm{ms} \pm 197 \mathrm{μs}\left({\color{lightgreen}-10.109 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$16.8 \mathrm{ms} \pm 167 \mathrm{μs}\left({\color{lightgreen}-6.356 \mathrm{\%}}\right) $$ Flame Graph

JesusFileto pushed a commit to JesusFileto/Chonky that referenced this pull request Nov 5, 2024
Co-authored-by: Bilal Mahmoud <bmahmoud@mpi-cbg.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-graph area/apps area/deps Relates to third-party dependencies (area) area/libs > chonky Affects the `chonky` crate (library) area/libs > deer Affects the `deer` crate (library) area/libs Relates to first-party libraries/crates/packages (area) area/tests > integration New or updated integration tests area/tests New or updated tests type/eng > backend Owned by the @backend team
Development

Successfully merging this pull request may close these issues.

2 participants