Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akphi committed Feb 24, 2022
1 parent c74d2c1 commit 6ef0df5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import React, { useRef, useEffect, forwardRef } from 'react';
import { useRef, useEffect, forwardRef } from 'react';
import { observer } from 'mobx-react-lite';
import { useResizeDetector } from 'react-resize-detector';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ test(unitTest('Missing class mapping'), async () => {
);
});

test(unitTest('Missing class mapping with ID'), async () => {
// TODO: This test is skipped because we want to temporarily relax graph building algorithm
// to ease Pure -> Legend migration push.
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */
test.skip(unitTest('Missing class mapping with ID'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
graphManagerState.graph,
Expand All @@ -138,7 +141,7 @@ test(unitTest('Missing class mapping with ID'), async () => {
);
});

// TODO This test is skipped because we don't support include mappings. We don't fail yet
// TODO: This test is skipped because we don't support include mappings. We don't fail yet
// Unskip when include mappings support is added
test.skip(unitTest('Missing set implementation'), async () => {
const buildGraph = flowResult(
Expand All @@ -152,7 +155,7 @@ test.skip(unitTest('Missing set implementation'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate enumeration values'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand All @@ -165,7 +168,7 @@ test.skip(unitTest('Duplicate enumeration values'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate profile tags'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand All @@ -178,7 +181,7 @@ test.skip(unitTest('Duplicate profile tags'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate profile stereotypes'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand All @@ -191,7 +194,7 @@ test.skip(unitTest('Duplicate profile stereotypes'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate class properties'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand All @@ -204,7 +207,7 @@ test.skip(unitTest('Duplicate class properties'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate aoociation properties'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export enum SET_IMPLEMENTATION_TYPE {
AGGREGATION_AWARE = 'aggregationAware',
}

/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */
/**
* When set implementation cannot be resolved by ID,
* we try to avoid failing graph building for now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ export class V1_SetImplementationTransformer
);
}

/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */
visit_TEMPORARY__UnresolvedSetImplementation(
setImplementation: TEMPORARY__UnresolvedSetImplementation,
): V1_ClassMapping | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class V1_ProtocolToMetaModelGraphSecondPassBuilder
const uniqueStereotypes = new Set<string>();
profile.stereotypes = element.stereotypes.map((stereotype) => {
if (uniqueStereotypes.has(stereotype)) {
/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
this.context.log.warn(
LogEvent.create(
`Found duplicated stereotype '${stereotype}' in profile '${element.path}'`,
Expand All @@ -110,7 +110,7 @@ export class V1_ProtocolToMetaModelGraphSecondPassBuilder
const uniqueTags = new Set<string>();
profile.tags = element.tags.map((tag) => {
if (uniqueTags.has(tag)) {
/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
this.context.log.warn(
LogEvent.create(
`Found duplicated tag '${tag}' in profile '${element.path}'`,
Expand Down Expand Up @@ -138,7 +138,7 @@ export class V1_ProtocolToMetaModelGraphSecondPassBuilder
`Enum value 'value' field is missing or empty`,
);
if (uniqueEnumValues.has(enumValue.value)) {
/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
this.context.log.warn(
LogEvent.create(
`Found duplicated value '${enumValue.value}' in enumeration '${enumeration.path}'`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class V1_ProtocolToMetaModelGraphThirdPassBuilder
const uniqueProperties = new Set<string>();
element.properties.forEach((property) => {
if (uniqueProperties.has(property.name)) {
/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
this.context.log.warn(
LogEvent.create(
`Found duplicated property '${property.name}' in class '${_class.path}'`,
Expand All @@ -132,7 +132,7 @@ export class V1_ProtocolToMetaModelGraphThirdPassBuilder
const first = guaranteeNonNullable(element.properties[0]);
const second = guaranteeNonNullable(element.properties[1]);
if (first.name === second.name) {
/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
this.context.log.warn(
LogEvent.create(
`Found duplicated property '${element.properties[0]?.name}' in association '${element.name}'`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,7 @@ import { GraphBuilderError } from '../../../../../../../graphManager/GraphManage
import type { AbstractProperty } from '../../../../../../metamodels/pure/packageableElements/domain/AbstractProperty';
import type { Mapping } from '../../../../../../metamodels/pure/packageableElements/mapping/Mapping';

/**
* When the ID cannot be resolve, we will not fail graph building for now
* instead, we will leave this loose end unresolved.
*
* See https://github.com/finos/legend-studio/issues/880
*/
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */
const TEMPORARY__getClassMappingByIdOrReturnUnresolved = (
mapping: Mapping,
id: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@
* limitations under the License.
*/

import React, {
Fragment,
useRef,
useEffect,
useState,
forwardRef,
} from 'react';
import { Fragment, useRef, useEffect, useState, forwardRef } from 'react';
import { observer } from 'mobx-react-lite';
import {
type TreeNodeContainerProps,
Expand Down

0 comments on commit 6ef0df5

Please sign in to comment.