diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/domain/api/entity/EntityAccessContext.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/domain/api/entity/EntityAccessContext.java index 4747f92daf..3bbf0606df 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/domain/api/entity/EntityAccessContext.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/domain/api/entity/EntityAccessContext.java @@ -24,7 +24,12 @@ public interface EntityAccessContext { Entity getEntity(String path); - List getEntities(Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> entityContentPredicate); + default List getEntities(Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> entityContentPredicate) + { + return getEntities(entityPathPredicate, classifierPathPredicate, entityContentPredicate, false); + } + + List getEntities(Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> entityContentPredicate, boolean excludeInvalid); List getEntityPaths(Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> entityContentPredicate); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/gitlab/api/GitLabEntityApi.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/gitlab/api/GitLabEntityApi.java index d2baedbf72..81d115e873 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/gitlab/api/GitLabEntityApi.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/gitlab/api/GitLabEntityApi.java @@ -368,7 +368,12 @@ public Entity getEntity(String path) { try { - return sourceDirectory.deserialize(file); + Entity localEntity = sourceDirectory.deserialize(file); + if (!Objects.equals(localEntity.getPath(), path)) + { + throw new RuntimeException("Expected entity path " + path + ", found " + localEntity.getPath()); + } + return localEntity; } catch (Exception e) { @@ -390,11 +395,21 @@ public Entity getEntity(String path) } @Override - public List getEntities(Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> entityContentPredicate) + public List getEntities(Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> entityContentPredicate, boolean excludeInvalid) { - try (Stream stream = getEntityProjectFiles(getFileAccessContext(getProjectFileAccessProvider()), entityPathPredicate, classifierPathPredicate, entityContentPredicate)) + try (Stream stream = getEntityProjectFiles(getFileAccessContext(getProjectFileAccessProvider()), entityPathPredicate, classifierPathPredicate, entityContentPredicate, excludeInvalid)) { - return stream.map(EntityProjectFile::getEntity).collect(Collectors.toList()); + return stream.map(excludeInvalid ? epf -> + { + try + { + return epf.getEntity(); + } + catch (Exception ignore) + { + return null; + } + } : EntityProjectFile::getEntity).filter(Objects::nonNull).collect(Collectors.toList()); } catch (Exception e) { @@ -706,6 +721,11 @@ private Stream getEntityProjectFiles(String projectId, String } private Stream getEntityProjectFiles(ProjectFileAccessProvider.FileAccessContext accessContext, Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> contentPredicate) + { + return getEntityProjectFiles(accessContext, entityPathPredicate, classifierPathPredicate, contentPredicate, false); + } + + private Stream getEntityProjectFiles(ProjectFileAccessProvider.FileAccessContext accessContext, Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> contentPredicate, boolean excludeInvalid) { Stream stream = getEntityProjectFiles(accessContext); if (entityPathPredicate != null) @@ -714,11 +734,35 @@ private Stream getEntityProjectFiles(ProjectFileAccessProvide } if (classifierPathPredicate != null) { - stream = stream.filter(epf -> classifierPathPredicate.test(epf.getEntity().getClassifierPath())); + stream = stream.filter(excludeInvalid ? epf -> + { + Entity entity; + try + { + entity = epf.getEntity(); + } + catch (Exception ignore) + { + return false; + } + return classifierPathPredicate.test(entity.getClassifierPath()); + } : epf -> classifierPathPredicate.test(epf.getEntity().getClassifierPath())); } if (contentPredicate != null) { - stream = stream.filter(epf -> contentPredicate.test(epf.getEntity().getContent())); + stream = stream.filter(excludeInvalid ? epf -> + { + Entity entity; + try + { + entity = epf.getEntity(); + } + catch (Exception ignore) + { + return false; + } + return contentPredicate.test(entity.getContent()); + } : epf -> contentPredicate.test(epf.getEntity().getContent())); } return stream; } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/BackupWorkspaceEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/BackupWorkspaceEntitiesResource.java index b4211e9ec3..fd7f72de22 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/BackupWorkspaceEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/BackupWorkspaceEntitiesResource.java @@ -62,11 +62,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in backup user workspace " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getBackupUserWorkspaceEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getBackupUserWorkspaceEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/BackupWorkspaceRevisionEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/BackupWorkspaceRevisionEntitiesResource.java index ddef827e3b..ab7d81ad8e 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/BackupWorkspaceRevisionEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/BackupWorkspaceRevisionEntitiesResource.java @@ -63,11 +63,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in revision " + revisionId + " of backup user workspace " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getBackupUserWorkspaceRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getBackupUserWorkspaceRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ComparisonReviewEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ComparisonReviewEntitiesResource.java index 4ef6f71023..7ab7dc90d4 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ComparisonReviewEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ComparisonReviewEntitiesResource.java @@ -63,11 +63,14 @@ public List getReviewFromEntities(@PathParam("projectId") String project @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting [from] entities in review " + reviewId + " for project " + projectId, - () -> getEntities(this.entityApi.getReviewFromEntityAccessContext(projectId, reviewId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getReviewFromEntityAccessContext(projectId, reviewId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } @@ -87,11 +90,14 @@ public List getReviewToEntities(@PathParam("projectId") String projectId @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting [to] entities in review " + reviewId + " for project " + projectId, - () -> getEntities(this.entityApi.getReviewToEntityAccessContext(projectId, reviewId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getReviewToEntityAccessContext(projectId, reviewId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ConflictResolutionWorkspaceEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ConflictResolutionWorkspaceEntitiesResource.java index 40636f5ad7..bb4f6cebc2 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ConflictResolutionWorkspaceEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ConflictResolutionWorkspaceEntitiesResource.java @@ -62,11 +62,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in user workspace with conflict resolution " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getUserWorkspaceWithConflictResolutionEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getUserWorkspaceWithConflictResolutionEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ConflictResolutionWorkspaceRevisionEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ConflictResolutionWorkspaceRevisionEntitiesResource.java index a10e434c4d..b814785e49 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ConflictResolutionWorkspaceRevisionEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ConflictResolutionWorkspaceRevisionEntitiesResource.java @@ -50,7 +50,8 @@ public ConflictResolutionWorkspaceRevisionEntitiesResource(EntityApi entityApi) @ApiOperation("Get entities of the user workspace with conflict resolution at the revision") public List getAllEntities(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @QueryParam("classifierPath") @ApiParam("Only include entities with one of these classifier paths.") Set classifierPaths, @QueryParam("package") @@ -63,11 +64,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in revision " + revisionId + " of user workspace with conflict resolution " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getUserWorkspaceWithConflictResolutionRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getUserWorkspaceWithConflictResolutionRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } @@ -76,7 +80,8 @@ public List getAllEntities(@PathParam("projectId") String projectId, @ApiOperation("Get an entity of the user workspace with conflict resolution at the revision by its path") public Entity getEntityByPath(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @PathParam("path") String path) { return executeWithLogging( diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/EntityAccessResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/EntityAccessResource.java index 90d747a0a7..50c987c340 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/EntityAccessResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/EntityAccessResource.java @@ -37,12 +37,12 @@ protected List getEntityPaths(EntityAccessContext entityAccessContext, S return entityAccessContext.getEntityPaths(entityPathPredicate, classifierPathPredicate, contentPredicate); } - protected List getEntities(EntityAccessContext entityAccessContext, Set classifierPaths, Set packages, boolean includeSubPackages, String nameRegex, Set stereotypes, Collection taggedValueRegexes) + protected List getEntities(EntityAccessContext entityAccessContext, Set classifierPaths, Set packages, boolean includeSubPackages, String nameRegex, Set stereotypes, Collection taggedValueRegexes, boolean excludeInvalidEntities) { Predicate entityPathPredicate = getEntityPathPredicate(packages, includeSubPackages, nameRegex); Predicate classifierPathPredicate = getClassifierPathPredicate(classifierPaths); Predicate> contentPredicate = getContentPredicate(stereotypes, taggedValueRegexes); - return entityAccessContext.getEntities(entityPathPredicate, classifierPathPredicate, contentPredicate); + return entityAccessContext.getEntities(entityPathPredicate, classifierPathPredicate, contentPredicate, excludeInvalidEntities); } private Predicate getEntityPathPredicate(Set packages, boolean includeSubPackages, String nameRegex) diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupBackupWorkspaceEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupBackupWorkspaceEntitiesResource.java index a1edec5c66..88f0ccece3 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupBackupWorkspaceEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupBackupWorkspaceEntitiesResource.java @@ -62,11 +62,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in backup group workspace " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getBackupGroupWorkspaceEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getBackupGroupWorkspaceEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupBackupWorkspaceRevisionEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupBackupWorkspaceRevisionEntitiesResource.java index d351f29959..c61f93c524 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupBackupWorkspaceRevisionEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupBackupWorkspaceRevisionEntitiesResource.java @@ -50,7 +50,8 @@ public GroupBackupWorkspaceRevisionEntitiesResource(EntityApi entityApi) @ApiOperation("Get entities of the backup group workspace at the revision") public List getAllEntities(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @QueryParam("classifierPath") @ApiParam("Only include entities with one of these classifier paths.") Set classifierPaths, @QueryParam("package") @@ -63,11 +64,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in revision " + revisionId + " of backup group workspace " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getBackupGroupWorkspaceRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getBackupGroupWorkspaceRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupConflictResolutionWorkspaceEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupConflictResolutionWorkspaceEntitiesResource.java index 666f95f5d0..225efb1e56 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupConflictResolutionWorkspaceEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupConflictResolutionWorkspaceEntitiesResource.java @@ -62,11 +62,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in group workspace with conflict resolution " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getGroupWorkspaceWithConflictResolutionEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getGroupWorkspaceWithConflictResolutionEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupConflictResolutionWorkspaceRevisionEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupConflictResolutionWorkspaceRevisionEntitiesResource.java index 31dae06724..2224a52b2a 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupConflictResolutionWorkspaceRevisionEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupConflictResolutionWorkspaceRevisionEntitiesResource.java @@ -50,7 +50,8 @@ public GroupConflictResolutionWorkspaceRevisionEntitiesResource(EntityApi entity @ApiOperation("Get entities of the group workspace with conflict resolution at the revision") public List getAllEntities(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @QueryParam("classifierPath") @ApiParam("Only include entities with one of these classifier paths.") Set classifierPaths, @QueryParam("package") @@ -63,11 +64,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in revision " + revisionId + " of group workspace with conflict resolution " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getGroupWorkspaceWithConflictResolutionRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getGroupWorkspaceWithConflictResolutionRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } @@ -76,7 +80,8 @@ public List getAllEntities(@PathParam("projectId") String projectId, @ApiOperation("Get an entity of the group workspace with conflict resolution at the revision by its path") public Entity getEntityByPath(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @PathParam("path") String path) { return executeWithLogging( diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupWorkspaceEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupWorkspaceEntitiesResource.java index f2886d2ec4..1774b6bd50 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupWorkspaceEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupWorkspaceEntitiesResource.java @@ -70,12 +70,16 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid + ) { return execute( "getting entities in group workspace " + workspaceId + " for project " + projectId, "get entities of the group workspace", - () -> getEntities(this.entityApi.getGroupWorkspaceEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getGroupWorkspaceEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupWorkspaceRevisionEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupWorkspaceRevisionEntitiesResource.java index dfa2c38508..0445e6594c 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupWorkspaceRevisionEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/GroupWorkspaceRevisionEntitiesResource.java @@ -50,7 +50,8 @@ public GroupWorkspaceRevisionEntitiesResource(EntityApi entityApi) @ApiOperation("Get entities of the group workspace at the revision") public List getAllEntities(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @QueryParam("classifierPath") @ApiParam("Only include entities with one of these classifier paths.") Set classifierPaths, @QueryParam("package") @@ -63,11 +64,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in revision " + revisionId + " of group workspace " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getGroupWorkspaceRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getGroupWorkspaceRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } @@ -76,7 +80,8 @@ public List getAllEntities(@PathParam("projectId") String projectId, @ApiOperation("Get an entity of the group workspace at the revision by its path") public Entity getEntityByPath(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @PathParam("path") String path) { return executeWithLogging( diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ProjectEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ProjectEntitiesResource.java index d574226078..75bcb201d5 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ProjectEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ProjectEntitiesResource.java @@ -61,11 +61,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities for project " + projectId, - () -> getEntities(this.entityApi.getProjectEntityAccessContext(projectId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getProjectEntityAccessContext(projectId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ProjectRevisionEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ProjectRevisionEntitiesResource.java index 9a0ddc29e3..b3ae87c2e8 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ProjectRevisionEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/ProjectRevisionEntitiesResource.java @@ -49,7 +49,8 @@ public ProjectRevisionEntitiesResource(EntityApi entityApi) @GET @ApiOperation("Get entities of a revision of the project") public List getAllEntities(@PathParam("projectId") String projectId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @QueryParam("classifierPath") @ApiParam("Only include entities with one of these classifier paths.") Set classifierPaths, @QueryParam("package") @@ -62,20 +63,21 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities for revision " + revisionId + " of project " + projectId, - () -> getEntities(this.entityApi.getProjectRevisionEntityAccessContext(projectId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getProjectRevisionEntityAccessContext(projectId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } @GET @Path("{path}") @ApiOperation("Get an entity of a revision of the project by its path") - public Entity getEntityByPath(@PathParam("projectId") String projectId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, - @PathParam("path") String path) + public Entity getEntityByPath(@PathParam("projectId") String projectId, @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, @PathParam("path") String path) { return executeWithLogging( "getting entity " + path + " for revision " + revisionId + " of project " + projectId, diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/VersionEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/VersionEntitiesResource.java index 88bf4dce6d..dfffbd61fd 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/VersionEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/VersionEntitiesResource.java @@ -62,11 +62,14 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in version " + versionId + " for project " + projectId, - () -> getEntities(this.entityApi.getVersionEntityAccessContext(projectId, versionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getVersionEntityAccessContext(projectId, versionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/WorkspaceEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/WorkspaceEntitiesResource.java index f88869e859..983714e166 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/WorkspaceEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/WorkspaceEntitiesResource.java @@ -70,12 +70,15 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return execute( "getting entities in user workspace " + workspaceId + " for project " + projectId, "get entities of the user workspace", - () -> getEntities(this.entityApi.getUserWorkspaceEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getUserWorkspaceEntityAccessContext(projectId, workspaceId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/WorkspaceRevisionEntitiesResource.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/WorkspaceRevisionEntitiesResource.java index 89d2a23855..36ddb655bf 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/WorkspaceRevisionEntitiesResource.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/resources/WorkspaceRevisionEntitiesResource.java @@ -50,7 +50,8 @@ public WorkspaceRevisionEntitiesResource(EntityApi entityApi) @ApiOperation("Get entities of the user workspace at the revision") public List getAllEntities(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, + @PathParam("revisionId") + @ApiParam("Including aliases: head, latest, current, base") String revisionId, @QueryParam("classifierPath") @ApiParam("Only include entities with one of these classifier paths.") Set classifierPaths, @QueryParam("package") @@ -63,21 +64,21 @@ public List getAllEntities(@PathParam("projectId") String projectId, @QueryParam("stereotype") @ApiParam("Only include entities with one of these stereotypes. The syntax is PROFILE.NAME, where PROFILE is the full path of the Profile that owns the Stereotype.") Set stereotypes, @QueryParam("taggedValue") - @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes) + @ApiParam("Only include entities with a matching tagged value. The syntax is PROFILE.NAME/REGEX, where PROFILE is the full path of the Profile that owns the Tag, NAME is the name of the Tag, and REGEX is a regular expression to match against the value.") List taggedValueRegexes, + @QueryParam("excludeInvalid") + @DefaultValue("false") + @ApiParam("If true, exclude invalid entities and return valid entities only. If false, the endpoint will return an error if there are any invalid entities.") boolean excludeInvalid) { return executeWithLogging( "getting entities in revision " + revisionId + " of user workspace " + workspaceId + " for project " + projectId, - () -> getEntities(this.entityApi.getUserWorkspaceRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes) + () -> getEntities(this.entityApi.getUserWorkspaceRevisionEntityAccessContext(projectId, workspaceId, revisionId), classifierPaths, packages, includeSubPackages, nameRegex, stereotypes, taggedValueRegexes, excludeInvalid) ); } @GET @Path("{path}") @ApiOperation("Get an entity of the user workspace at the revision by its path") - public Entity getEntityByPath(@PathParam("projectId") String projectId, - @PathParam("workspaceId") String workspaceId, - @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, - @PathParam("path") String path) + public Entity getEntityByPath(@PathParam("projectId") String projectId, @PathParam("workspaceId") String workspaceId, @PathParam("revisionId") @ApiParam("Including aliases: head, latest, current, base") String revisionId, @PathParam("path") String path) { return executeWithLogging( "getting entity " + path + " in revision " + revisionId + " of user workspace " + workspaceId + " for project " + projectId, diff --git a/legend-sdlc-server/src/test/java/org/finos/legend/sdlc/server/inmemory/backend/api/InMemoryEntityApi.java b/legend-sdlc-server/src/test/java/org/finos/legend/sdlc/server/inmemory/backend/api/InMemoryEntityApi.java index 80d3206055..212a73a304 100644 --- a/legend-sdlc-server/src/test/java/org/finos/legend/sdlc/server/inmemory/backend/api/InMemoryEntityApi.java +++ b/legend-sdlc-server/src/test/java/org/finos/legend/sdlc/server/inmemory/backend/api/InMemoryEntityApi.java @@ -160,7 +160,7 @@ public Entity getEntity(String path) } @Override - public List getEntities(Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> entityContentPredicate) + public List getEntities(Predicate entityPathPredicate, Predicate classifierPathPredicate, Predicate> entityContentPredicate, boolean excludeInvalid) { Stream stream = StreamSupport.stream(this.entities.spliterator(), false); if (entityPathPredicate != null)