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

Feature request: Metamodel verifier #288

Closed
akphi opened this issue Jun 24, 2021 · 1 comment
Closed

Feature request: Metamodel verifier #288

akphi opened this issue Jun 24, 2021 · 1 comment
Labels
Component: Graph Manager Issues related to graph processing and management (including interaction with engine server) logic Studio Core Team Opened by a member of the Studio core team Type: Feature Request Type: Refactor
Milestone

Comments

@akphi
Copy link
Contributor

akphi commented Jun 24, 2021

As we are moving in the direction of simplifying metamodel (#263), we need to be able to verify at runtime that the metamodels that we constructed, are compliant with the model, i.e. checking to make sure required fields are set. This is good for development and we should cover this with tests ideally.

Implementation Plan

Right now, we don't have a good strategy yet to automate this, so we might need to manually define verifier for each metamodel like we do for hashCode - NOTE we can probably make use of hashCode to do this check (e.g. as we compute the hashCodes for fields, we can also verify that they are present).

As such, we have a few different strategies:

  • Tinker with hashCode function to also do the verification.
  • Poke into the prototype or something and inject fields we want to exclude (using something similar to serializer createDefaultSchema)
defineVerifiedProperty(Enumeration, {
  ignore: ["owner"], // use KeyOf<Enumeration> or something (like Jest Spy) to make sure `owner` actually is one of the fields of the object
  // or alternatively, we can do what `mobx makeObservable` does
});
@akphi akphi added the Studio Core Team Opened by a member of the Studio core team label Oct 29, 2021
@akphi akphi changed the title RFC: Metamodel verifier Feature request: Metamodel verifier Nov 6, 2021
@akphi akphi modified the milestones: Marathon, Backlog Nov 18, 2021
@akphi akphi added the Component: Graph Manager Issues related to graph processing and management (including interaction with engine server) logic label Feb 28, 2022
@akphi
Copy link
Contributor Author

akphi commented Apr 10, 2022

In the spirit of #927 this is probably not a good idea. If we miss something, we would get a bug.

@akphi akphi closed this as completed Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Graph Manager Issues related to graph processing and management (including interaction with engine server) logic Studio Core Team Opened by a member of the Studio core team Type: Feature Request Type: Refactor
Projects
None yet
Development

No branches or pull requests

1 participant