FINERACT-2645: add Spring Modulith cross-feature boundary test for al…#6044
Open
mansi75 wants to merge 3 commits into
Open
FINERACT-2645: add Spring Modulith cross-feature boundary test for al…#6044mansi75 wants to merge 3 commits into
mansi75 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
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
AllModulesCrossFeatureBoundaryTestto analyze module dependencies and enforce the “no cross-feature dependency” rule. - Added Spring Modulith dependencies and pinned
spring-modulith.versioninfineract-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.
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-coreandfineract-command. It is part of the ongoing modularization effort tracked under FINERACT-2645.The test (
AllModulesCrossFeatureBoundaryTest) builds the Spring Modulith application model overorg.apache.fineractand inspects the direct dependencies of every module. A referenced type is treated as allowed "foundation" only when it physically resides infineract-coreorfineract-command. This is decided by the artifact the type is loaded from (via its source URI), not by package name, becausefineract-coreholds relocated DTOs and enums under packages such asorganisation.*andportfolio.*; 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!