Skip to content

FINERACT-2645: add Spring Modulith cross-feature boundary test for al…#6044

Open
mansi75 wants to merge 3 commits into
apache:developfrom
mansi75:FINERACT-2645-modulith-architecture-overview
Open

FINERACT-2645: add Spring Modulith cross-feature boundary test for al…#6044
mansi75 wants to merge 3 commits into
apache:developfrom
mansi75:FINERACT-2645-modulith-architecture-overview

Conversation

@mansi75

@mansi75 mansi75 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a Spring Modulith based cross-feature boundary test that verifies, across every module in the codebase, that each feature module depends only on fineract-core and fineract-command. It is part of the ongoing modularization effort tracked under FINERACT-2645.

The test (AllModulesCrossFeatureBoundaryTest) builds the Spring Modulith application model over org.apache.fineract and inspects the direct dependencies of every module. A referenced type is treated as allowed "foundation" only when it physically resides in fineract-core or fineract-command. This is decided by the artifact the type is loaded from (via its source URI), not by package name, because fineract-core holds relocated DTOs and enums under packages such as organisation.* and portfolio.*; a package-name check would wrongly flag those, whereas an artifact-based check classifies them correctly.

The class provides:

  • printAllModulesCrossFeatureDependencyReport — a per-source-type report, for every module, showing each referenced feature package with its owning artifact and foundation/violation status.
  • printModuleToModuleDependencyViolations — a module-to-module rollup showing, for each source module, the other modules it depends on, the number of class-level edges into each, and the offending feature packages.
  • noModuleMayDependOnAnotherFeatureModule — the enforcement test that fails if any module references a type from another feature module, with a per-module breakdown to guide decoupling.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Copilot AI review requested due to automatic review settings June 26, 2026 06:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a Spring Modulith–based architecture test in fineract-provider intended to enforce cross-feature boundaries during the ongoing modularization work (FINERACT-2645). It builds an ApplicationModules model for org.apache.fineract and flags modules that directly reference types from other feature modules (allowing only fineract-core and fineract-command as “foundation”).

Changes:

  • Added AllModulesCrossFeatureBoundaryTest to analyze module dependencies and enforce the “no cross-feature dependency” rule.
  • Added Spring Modulith dependencies and pinned spring-modulith.version in fineract-provider.
  • Increased Gradle test JVM memory settings for fineract-provider.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
fineract-provider/src/test/java/org/apache/fineract/architecture/AllModulesCrossFeatureBoundaryTest.java Adds Modulith-based dependency reporting + an enforcement test for cross-feature boundaries.
fineract-provider/dependencies.gradle Adds Spring Modulith dependencies and sets the Modulith version property.
fineract-provider/build.gradle Adjusts test JVM heap/metaspace settings, likely to support Modulith model building.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread fineract-provider/dependencies.gradle Outdated
@adamsaghy

Copy link
Copy Markdown
Contributor
/home/runner/work/fineract/fineract/fineract-provider/src/test/java/org/apache/fineract/architecture/AllModulesCrossFeatureBoundaryTest.java:63: error: [StringSplitter] String.split(String) has surprising behavior
        String[] parts = typeName.substring(prefix.length()).split("\\.");
               

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.

3 participants