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-1978, H-1979, H-2013, H-2014: Update type icons, labels, dataTypes #5982

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

CiaranMn
Copy link
Member

@CiaranMn CiaranMn commented Dec 20, 2024

🌟 What is the purpose of this PR?

This PR contains a list of changes to:

  1. Entity type icons
  2. Entity type pluralTitle and inverse titles
  3. Expected data type for some data types (e.g. replace Text with URI or DateTime where appropriate)
  4. Rename a couple of types (Image -> Image File, Quick Note –> Note)
  5. Default provenance information for entities that might not have it

It also contains the necessary TS type changes and where we specify a dataTypeId to make sure it is correct.

The list of changes in the two files is intended for conversion into a migration script to overwrite types in the production db directly, to avoid the migration effort involved in updating all of these types to new versions (which would be significantly more complicated, given the dependency graph).

apps/hash-api/src/graph/ensure-system-graph-is-initialized/labels-icons-data-types.ts
apps/hash-api/src/graph/ensure-system-graph-is-initialized/provenance-defaults.ts

Deployment of this requires discussion as we need to coordinate the deployment of the Node API and frontend with the changes to types in the prod db, particurlarly due to:

  1. Renaming entity types: the entity types in the db need to match the types being specified by the clients
  2. Changing expected data type for some properties: the dataTypeId specified by the clients needs to match that expected by the API

🚫 Blocked by

  • Switch file BP property type to use HASH URI data type rather than BP text one
  • Check what happens if a user enters an invalid URL in the early access form and show an inline message on the input rather than whatever less user-friendly thing happens will likely happen currently
  • H-3847: discuss coordination
  • H-3848: Merging this PR is blocked by a new eslint error created by an update to json-schema-to-typescript which is generating data type enums differently

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

🐾 Next steps

Discuss coordination of changes.

@github-actions github-actions bot added area/apps > hash* Affects HASH (a `hash-*` app) area/infra Relates to version control, CI, CD or IaC (area) area/apps > hash-api Affects the HASH API (app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team area/tests New or updated tests area/tests > integration New or updated integration tests area/apps labels Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

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

Project coverage is 20.96%. Comparing base (e04f6b3) to head (1189d79).

Files with missing lines Patch % Lines
...system-graph-is-initialized/provenance-defaults.ts 0.00% 8 Missing ⚠️
...em-graph-is-initialized/labels-icons-data-types.ts 0.00% 5 Missing ⚠️
...ations/003-create-linear-system-types.migration.ts 0.00% 4 Missing ⚠️
.../hash-api/src/graph/knowledge/system-types/file.ts 0.00% 4 Missing ⚠️
...grations/001-create-hash-system-types.migration.ts 0.00% 3 Missing ⚠️
...s/hash-api/src/graph/knowledge/system-types/org.ts 0.00% 3 Missing ⚠️
...ns/000-create-first-custom-data-types.migration.ts 0.00% 2 Missing ⚠️
.../019-add-doc-company-and-person-types.migration.ts 0.00% 2 Missing ⚠️
...m-graph-is-initialized/system-webs-and-entities.ts 0.00% 2 Missing ⚠️
...pps/hash-api/src/seed-data/seed-flow-test-types.ts 0.00% 2 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5982      +/-   ##
==========================================
- Coverage   21.19%   20.96%   -0.24%     
==========================================
  Files         580      582       +2     
  Lines       19872    19884      +12     
  Branches     2949     2935      -14     
==========================================
- Hits         4212     4168      -44     
- Misses      15603    15664      +61     
+ Partials       57       52       -5     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.34% <0.00%> (ø)
apps.hash-api 1.14% <0.00%> (-0.01%) ⬇️
local.hash-backend-utils 8.81% <0.00%> (ø)
local.hash-graph-sdk 58.62% <ø> (ø)
local.hash-isomorphic-utils 0.89% <0.00%> (ø)
local.hash-subgraph 24.54% <ø> (ø)

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.

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Benchmark results

@rust/hash-graph-benches – Integrations

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 25 entities $$3.39 \mathrm{ms} \pm 4.79 \mathrm{μs}\left({\color{gray}0.707 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$2.01 \mathrm{ms} \pm 7.43 \mathrm{μs}\left({\color{gray}0.530 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$2.02 \mathrm{ms} \pm 4.43 \mathrm{μs}\left({\color{gray}-1.069 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$2.13 \mathrm{ms} \pm 10.6 \mathrm{μs}\left({\color{gray}-4.680 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$4.07 \mathrm{ms} \pm 19.4 \mathrm{μs}\left({\color{lightgreen}-19.883 \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/uk-address/v/1 $$17.0 \mathrm{ms} \pm 182 \mathrm{μs}\left({\color{lightgreen}-26.347 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$18.3 \mathrm{ms} \pm 270 \mathrm{μs}\left({\color{lightgreen}-21.792 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$17.3 \mathrm{ms} \pm 198 \mathrm{μs}\left({\color{gray}1.22 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$16.6 \mathrm{ms} \pm 194 \mathrm{μs}\left({\color{gray}0.687 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$16.6 \mathrm{ms} \pm 214 \mathrm{μs}\left({\color{gray}0.703 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$15.3 \mathrm{ms} \pm 162 \mathrm{μs}\left({\color{lightgreen}-6.800 \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 178 \mathrm{μs}\left({\color{gray}-2.416 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$17.1 \mathrm{ms} \pm 200 \mathrm{μs}\left({\color{lightgreen}-6.077 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$17.6 \mathrm{ms} \pm 245 \mathrm{μs}\left({\color{red}6.04 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

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

representative_read_multiple_entities

Function Value Mean Flame graphs
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$87.8 \mathrm{ms} \pm 407 \mathrm{μs}\left({\color{gray}2.16 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$81.9 \mathrm{ms} \pm 336 \mathrm{μs}\left({\color{gray}-0.275 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$72.9 \mathrm{ms} \pm 317 \mathrm{μs}\left({\color{gray}-0.589 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$91.8 \mathrm{ms} \pm 505 \mathrm{μs}\left({\color{gray}2.11 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$99.7 \mathrm{ms} \pm 371 \mathrm{μs}\left({\color{gray}0.526 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$38.0 \mathrm{ms} \pm 242 \mathrm{μs}\left({\color{gray}-0.566 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$54.3 \mathrm{ms} \pm 260 \mathrm{μs}\left({\color{gray}2.43 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$48.6 \mathrm{ms} \pm 209 \mathrm{μs}\left({\color{gray}0.465 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$43.5 \mathrm{ms} \pm 163 \mathrm{μs}\left({\color{gray}1.37 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$57.7 \mathrm{ms} \pm 288 \mathrm{μs}\left({\color{gray}2.29 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=255, PT=255, ET=255, E=255 $$65.9 \mathrm{ms} \pm 221 \mathrm{μs}\left({\color{gray}-0.811 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$39.2 \mathrm{ms} \pm 152 \mathrm{μs}\left({\color{gray}1.87 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 25 entities $$179 \mathrm{ms} \pm 412 \mathrm{μs}\left({\color{gray}1.35 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.9 \mathrm{ms} \pm 90.0 \mathrm{μs}\left({\color{gray}-0.045 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$28.0 \mathrm{ms} \pm 289 \mathrm{μs}\left({\color{gray}3.25 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$32.0 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{lightgreen}-45.216 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 50 entities $$5.37 \mathrm{s} \pm 537 \mathrm{ms}\left({\color{red}1880 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 100 entities $$2.25 \mathrm{ms} \pm 9.64 \mathrm{μs}\left({\color{gray}0.289 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$3.06 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{gray}2.31 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$13.7 \mathrm{ms} \pm 46.5 \mathrm{μs}\left({\color{gray}0.639 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$2.01 \mathrm{ms} \pm 5.87 \mathrm{μs}\left({\color{gray}0.566 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$2.03 \mathrm{ms} \pm 7.05 \mathrm{μs}\left({\color{gray}0.254 \mathrm{\%}}\right) $$ Flame Graph

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-api Affects the HASH API (app) area/apps area/blocks Relates to first-party blocks (area) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests > integration New or updated integration tests area/tests > playwright New or updated Playwright tests area/tests New or updated tests type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team
Development

Successfully merging this pull request may close these issues.

1 participant