Skip to content

Compile NeoJoin views into the generated VSUM - #57

Merged
Davit-Tsulaia merged 3 commits into
mainfrom
55-Compile-NeoJoin-views-into-the-generated-VSUM
Nov 18, 2026
Merged

Davit-Tsulaia merged 3 commits into
mainfrom
55-Compile-NeoJoin-views-into-the-generated-VSUM

Conversation

@Davit-Tsulaia

Copy link
Copy Markdown
Contributor

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/types and /vsum/view.

NeoJoin for Vitruvius has no runtime fromClasspath factory: it generates a Java
ViewType class per .nj file at build time. The integration therefore follows the
Methodologist Template (add-neojoin-view-type-example): a viewtype module.

Generated project

  • New viewtype module, only generated when views are uploaded: the xtext-maven-plugin
    with NeoJoinVitruvBuildSetup plus an MWE2 workflow for the view metamodels
    (viewtypePom, viewtypeWorkflow, viewtypePluginXml, viewtypeProject templates)
  • rootPom: viewtype module and the neojoin.vitruv.version property;
    vsumPom: dependency on viewtype
  • vsumMain: one .withViewType(XViewType::new) per view, next to the identity view types
  • vsumTest: smoke test that checks each view type is registered and a view can be created

Setup service

  • NeoJoinViewDefinitionProcessor replaces the stub. Before Maven runs, it reports as
    VIEWS problems: a missing export, 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
  • VsumValidationService runs the same checks; viewFiles must have the .nj extension
  • BuildOutputParser attributes NeoJoin compiler errors, javac errors in viewtype, and
    view smoke-test failures to the uploaded .nj file (Source.VIEWS)
  • New setup.vsum.neojoin-vitruv-version property and VSUM_VIEWS_ERROR error code

Docker

  • Sample components.nj added to the warm-up, so the image contains the NeoJoin
    dependencies and offline builds with views work

Docs and tests

  • README (features, viewFiles, pipeline, errors) and the VsumController parameter docs
  • VsumBuildEndToEndTest.builtVsumServesTheUploadedViews: builds a VSUM with a view,
    starts it, and checks /vsum/view/types and /vsum/view
  • The "view stub" test fixtures are replaced with the sample .nj file

Follow-up

  • Backend: SetupServiceApiHandler should send view files with the .nj extension
    (it currently passes null)

@Davit-Tsulaia Davit-Tsulaia linked an issue Nov 16, 2026 that may be closed by this pull request
7 tasks
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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
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).

@Davit-Tsulaia Davit-Tsulaia self-assigned this Nov 16, 2026

@uiysg uiysg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 103).

@Davit-Tsulaia

Copy link
Copy Markdown
Contributor Author

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?

@uiysg I added new unit tests, also should i make new issue for beckend so that SetupServiceApiHandler.java send
.nj instead of null?

@uiysg

uiysg commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

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?

@uiysg I added new unit tests, also should i make new issue for beckend so that SetupServiceApiHandler.java send .nj instead of null?

Thanks a lot. Yes, creating a backend Issue would be nice. In the mean time I'll approve this PR

@Davit-Tsulaia
Davit-Tsulaia merged commit d2a767e into main Nov 18, 2026
5 checks passed
@Davit-Tsulaia
Davit-Tsulaia deleted the 55-Compile-NeoJoin-views-into-the-generated-VSUM branch November 18, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile NeoJoin views into the generated VSUM

2 participants