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-3699, H-3374: Use and set value dataTypeId in the entity editor #5813

Merged
merged 10 commits into from
Dec 6, 2024

Conversation

CiaranMn
Copy link
Member

@CiaranMn CiaranMn commented Dec 5, 2024

🌟 What is the purpose of this PR?

We've updated entities' metadata to track the dataTypeId of each leaf value in their properties, to be able to distinguish between data types which have the same primitive value but different semantic meaning (or other constraints).

This PR updates the entity editor to actually use the dataTypeId to know what data type a value is of, rather than guessing it solely from the value, which is now impossible.

As a drive-by it removes reference to the EmptyList type which we are not using.

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

⚠️ Known issues

This PR has some partial code to do with validating entities which will be completed as part of H-3697 once unblocked by Graph API work.

H-3373: the editor doesn't yet support new custom data types, e.g. enums, tuples, array data.

🐾 Next steps

  • H-3700: the data type picker needs updating to handle inheritance trees for data type, and to respect abstract data types which can't be instantiated (i.e. don't allow selecting them as the type for a value)
  • H-3751: disable users creating types which aren't yet supported in the editor (various nested arrays)

🛡 What tests cover this?

  • Entity editor has a basic 'set property' test in the Playwright tests.

❓ How to test this?

  1. edit an entity in the preview deployment

@CiaranMn CiaranMn requested a review from vilkinsons December 5, 2024 19:52
@github-actions github-actions bot added area/apps > hash* Affects HASH (a `hash-*` app) 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/apps labels Dec 5, 2024
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 2.70270% with 72 lines in your changes missing coverage. Please review.

Project coverage is 23.00%. Comparing base (30313be) to head (00bd165).
Report is 454 commits behind head on main.

Files with missing lines Patch % Lines
...ibs/@local/hash-isomorphic-utils/src/data-types.ts 0.00% 61 Missing ⚠️
...i/src/graphql/resolvers/knowledge/entity/entity.ts 0.00% 5 Missing ⚠️
...s/hash-api/src/graph/knowledge/primitive/entity.ts 0.00% 4 Missing ⚠️
...hash-isomorphic-utils/src/generate-entity-label.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5813      +/-   ##
==========================================
- Coverage   23.07%   23.00%   -0.08%     
==========================================
  Files         568      568              
  Lines       19103    19165      +62     
  Branches     2697     2715      +18     
==========================================
  Hits         4408     4408              
- Misses      14643    14705      +62     
  Partials       52       52              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.32% <ø> (ø)
apps.hash-api 1.16% <0.00%> (-0.01%) ⬇️
local.hash-backend-utils 8.80% <ø> (ø)
local.hash-graph-sdk 100.00% <100.00%> (ø)
local.hash-isomorphic-utils 0.99% <0.00%> (-0.04%) ⬇️
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.

vilkinsons
vilkinsons previously approved these changes Dec 5, 2024
@CiaranMn CiaranMn enabled auto-merge December 6, 2024 09:58
@CiaranMn CiaranMn added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit 9768eb8 Dec 6, 2024
72 checks passed
@CiaranMn CiaranMn deleted the cm/use-and-set-datatypeid-in-editor-metadata branch December 6, 2024 10:15
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/libs Relates to first-party libraries/crates/packages (area) 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.

2 participants