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

Bug: Mismatch in Studio and Engine handling of unresolved class mapping ID #880

Closed
1 of 2 tasks
Tracked by #941
akphi opened this issue Feb 23, 2022 · 1 comment · Fixed by #883
Closed
1 of 2 tasks
Tracked by #941

Bug: Mismatch in Studio and Engine handling of unresolved class mapping ID #880

akphi opened this issue Feb 23, 2022 · 1 comment · Fixed by #883
Assignees
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: Bug
Milestone

Comments

@akphi
Copy link
Contributor

akphi commented Feb 23, 2022

Similar issues

  • I have searched and found no existing similar issues

How are you using Studio?

Legend Studio

Current and expected behavior

A number of Pure users have mappings which contain class mapping IDs pointing at another mapping's class mappings. In Pure/Engine, we let this pass compilation phase. In Studio, we disallow this. This makes it hard for users to migrate to Studio. We should think of a strategy to make things loadable in Studio, but disallow users to make changes if they have this kind of error in their graph.

Steps to reproduce

Use the following grammar. Try compilation in text mode, Engine will pass while Studio graph builder will scream.

Model data

###Relational
Database model::Test
(
  Table FirmTable
  (
    id INTEGER PRIMARY KEY,
    Legal_name VARCHAR(200)
  )
  Table PersonTable
  (
    id INTEGER PRIMARY KEY,
    firm_id INTEGER,
    firstName VARCHAR(200),
    lastName VARCHAR(200)
  )

  Join FirmPerson(PersonTable.firm_id = FirmTable.id)
)


###Pure
Profile model::MyExtension
{
  stereotypes: [important];
  tags: [doc];
}

Enum model::IncType
{
  Corp,
  LLC
}

Class model::LegalEntity
{
  legalName: String[1];
}

Class model::Person
{
  firstName: String[1];
  lastName: String[1];
}

Class <<model::MyExtension.important>> {model::MyExtension.doc = 'This is a model of a firm'} model::Firm extends model::LegalEntity
[
  validName: $this.legalName->startsWith('')
]
{
  employees: model::Person[1..*];
  incType: model::IncType[1];
  employeeSize() {$this.employees->count()}: Number[1];
}


###Mapping
Mapping model::NewMapping
(
  *model::Firm: Relational
  {
    ~primaryKey
    (
      [model::Test]FirmTable.id
    )
    ~mainTable [model::Test]FirmTable
    legalName: concat([model::Test]FirmTable.Legal_name, '_LTD'),
    employees[idNotFound]: [model::Test]@FirmPerson
  }
  *model::Person: Relational
  {
    ~primaryKey
    (
      [model::Test]PersonTable.id
    )
    ~mainTable [model::Test]PersonTable
    firstName: [model::Test]PersonTable.firstName,
    lastName: [model::Test]PersonTable.lastName
  }
)

Environment

System:
    OS: macOS 11.6.4
  Binaries:
    Node: 16.8.0 - /private/var/folders/95/y32364512q77c1dvhkpnr_n80000gn/T/xfs-e9ca549e/node
    Yarn: 3.2.0 - /private/var/folders/95/y32364512q77c1dvhkpnr_n80000gn/T/xfs-e9ca549e/yarn
    npm: 7.21.0 - ~/.nvm/versions/node/v16.8.0/bin/npm
  Browsers:
    Chrome: 98.0.4758.102
    Firefox: 96.0.3

Possible solution and workaround

Discussed with @pierredebelen and @MauricioUyaguari. We will not hard-fail in Studio, the general strategy is detailed in #941

Contribution

  • I would like to work on the fix for this issue
@akphi akphi self-assigned this Feb 23, 2022
@akphi akphi added this to the 4.0.0 milestone Feb 23, 2022
@github-actions github-actions bot added the Studio Core Team Opened by a member of the Studio core team label Feb 23, 2022
@akphi akphi mentioned this issue Feb 24, 2022
8 tasks
@akphi akphi reopened this Feb 25, 2022
@akphi akphi added the Component: Graph Manager Issues related to graph processing and management (including interaction with engine server) logic label Feb 26, 2022
@akphi akphi modified the milestones: 4.0.0, 5.0.0 Mar 3, 2022
@akphi
Copy link
Contributor Author

akphi commented Mar 3, 2022

Moved to milestone 5.0.0 because this work needs engine change from @pierredebelen

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: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant