Optimise ArchUnit transitive analysis - #130
Conversation
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR optimizes the ArchUnit-based transitive access analysis by introducing indexing and memoization for method-access traversal, and by speeding up forbidden-signature classification via hash lookups. It also expands targeted tests for transitive/cyclic paths and adjusts CI so the integration matrix jobs run a comparable workload.
Changes:
- Memoize transitive traversal results (per-access classification and per-method reachability/path caching) and index outgoing accesses by origin method to avoid repeated scans.
- Speed up forbidden-signature checks by splitting canonical forbidden entries into exact-signature set lookups vs prefix matching.
- Add focused tests for transitive paths, cycles, shared targets, and cache reset behavior; move core/jqwik integration tests into a separate workflow job.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/test/java/de/tum/cit/ase/ares/api/architecture/java/archunit/TransitivelyAccessesMethodsConditionTest.java | Adds test coverage for transitive reachability, cycles, shared targets, and cache reset via init(). |
| src/main/java/de/tum/cit/ase/ares/api/architecture/java/archunit/TransitivelyAccessesMethodsCondition.java | Introduces indexing + memoization for faster transitive access-path discovery and adds init() to clear caches between evaluations. |
| src/main/java/de/tum/cit/ase/ares/api/architecture/java/archunit/JavaArchunitTestCaseCollection.java | Uses canonical exact-signature hash lookup and separates prefix entries to reduce per-access scanning work. |
| .github/workflows/maven.yml | Splits core + jqwik integration tests into a dedicated job so matrix jobs measure comparable workloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Performance
This makes ArchUnit + AspectJ the fastest ArchUnit combination locally. The clean GitHub runners will confirm the requested overall ordering:
2./3. ArchUnit + instrumentation and WALA + AspectJ
Validation
mvn test -Punit-architecture-testsmvn spotless:check checkstyle:check pmd:check spotbugs:check