Repository navigation
Compile NeoJoin views into the generated VSUM - #57
Conversation
Combine with the NeoJoinChecker from #56: it validates the views with NeoJoin first, then NeoJoinViewDefinitionProcessor derives the generated view type names. The processor's regex checks for imports, duplicate exports, and duplicate nsURIs are removed, since NeoJoinChecker covers them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| export.group(2), | ||
| ProjectLayout.GENERATED_NEOJOIN_SOURCES); | ||
| int exportOffset = export.start(); | ||
| int count = problems.size(); |
There was a problem hiding this comment.
Distance between variable 'count' declaration and its first usage is 4, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).
uiysg
left a comment
There was a problem hiding this comment.
Hi, great PR. One thing: the new checks in NeoJoinViewDefinitionProcessor.check() don’t have their own tests yet, e.g. invalid file name, missing export, duplicate view type name, clash with a metamodel’s view type, and nsURI conflict. The new branches in BuildOutputParser aren’t covered by BuildOutputParserTest either. The end-to-end test only covers the case where everything works. Could you please add some unit tests for these?
| "java.lang.IllegalStateException", | ||
| "no root", | ||
| "java.lang.IllegalStateException: no root\n" | ||
| + "\tat tools.vitruv.neojoin.vitruv.views.ViewTypeImpl.createView(ViewTypeImpl.java:9)\n"); |
There was a problem hiding this comment.
Line is longer than 100 characters (found 103).
@uiysg I added new unit tests, also should i make new issue for beckend so that SetupServiceApiHandler.java send |
Thanks a lot. Yes, creating a backend Issue would be nice. In the mean time I'll approve this PR |
NeoJoin view definitions (
.nj) were only copied into the project and never compiled.They now become view types of the generated VSUM, which the Vitruv server offers under
GET /vsum/view/typesand/vsum/view.NeoJoin for Vitruvius has no runtime
fromClasspathfactory: it generates a JavaViewTypeclass per.njfile at build time. The integration therefore follows theMethodologist Template (
add-neojoin-view-type-example): aviewtypemodule.Generated project
viewtypemodule, only generated when views are uploaded: the xtext-maven-pluginwith
NeoJoinVitruvBuildSetupplus an MWE2 workflow for the view metamodels(
viewtypePom,viewtypeWorkflow,viewtypePluginXml,viewtypeProjecttemplates)rootPom:viewtypemodule and theneojoin.vitruv.versionproperty;vsumPom: dependency onviewtypevsumMain: one.withViewType(XViewType::new)per view, next to the identity view typesvsumTest: smoke test that checks each view type is registered and a view can be createdSetup service
NeoJoinViewDefinitionProcessorreplaces the stub. Before Maven runs, it reports asVIEWSproblems: a missingexport, file names that can't become a view type name,duplicate names, exports or nsURIs, clashes with metamodel view types, and imports of
metamodels that weren't uploaded
VsumValidationServiceruns the same checks;viewFilesmust have the.njextensionBuildOutputParserattributes NeoJoin compiler errors, javac errors inviewtype, andview smoke-test failures to the uploaded
.njfile (Source.VIEWS)setup.vsum.neojoin-vitruv-versionproperty andVSUM_VIEWS_ERRORerror codeDocker
components.njadded to the warm-up, so the image contains the NeoJoindependencies and offline builds with views work
Docs and tests
viewFiles, pipeline, errors) and theVsumControllerparameter docsVsumBuildEndToEndTest.builtVsumServesTheUploadedViews: builds a VSUM with a view,starts it, and checks
/vsum/view/typesand/vsum/view"view stub"test fixtures are replaced with the sample.njfileFollow-up
SetupServiceApiHandlershould send view files with the.njextension(it currently passes
null)