Skip to content

Optimise ArchUnit transitive analysis - #130

Merged
MarkusPaulsen merged 1 commit into
mainfrom
agent/optimise-archunit-transitive-analysis
Jul 20, 2026
Merged

Optimise ArchUnit transitive analysis#130
MarkusPaulsen merged 1 commit into
mainfrom
agent/optimise-archunit-transitive-analysis

Conversation

@MarkusPaulsen

Copy link
Copy Markdown
Collaborator

Summary

  • index ArchUnit accesses by origin method and memoise predicate/reachability results
  • classify canonical forbidden signatures with a hash lookup instead of rescanning and recanonicalising the complete blocklist for every access
  • cover transitive paths, cycles, shared targets and condition reuse with focused tests
  • move core and jqwik integration tests out of the ArchUnit + AspectJ matrix entry so all four mode jobs measure the same workload

Performance

  • representative ArchUnit instrumentation subset: 39.82 s -> 16.98 s test time (57% faster)
  • complete local matrix selection: ArchUnit + AspectJ 51.0 s; ArchUnit + instrumentation 56.0 s

This makes ArchUnit + AspectJ the fastest ArchUnit combination locally. The clean GitHub runners will confirm the requested overall ordering:

  1. ArchUnit + AspectJ
    2./3. ArchUnit + instrumentation and WALA + AspectJ
  2. WALA + instrumentation

Validation

  • mvn test -Punit-architecture-tests
  • complete ArchUnit + AspectJ integration selection
  • complete ArchUnit + instrumentation integration selection
  • mvn spotless:check checkstyle:check pmd:check spotbugs:check

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@MarkusPaulsen, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 15 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 82307989-9b38-4756-a905-ff5cc35d68e2

📥 Commits

Reviewing files that changed from the base of the PR and between 640a976 and 69bf9e0.

📒 Files selected for processing (4)
  • .github/workflows/maven.yml
  • src/main/java/de/tum/cit/ase/ares/api/architecture/java/archunit/JavaArchunitTestCaseCollection.java
  • src/main/java/de/tum/cit/ase/ares/api/architecture/java/archunit/TransitivelyAccessesMethodsCondition.java
  • src/test/java/de/tum/cit/ase/ares/api/architecture/java/archunit/TransitivelyAccessesMethodsConditionTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/optimise-archunit-transitive-analysis

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added architecture Automated area label: architecture tests Automated area label: tests other Automated area label: other labels Jul 20, 2026
@MarkusPaulsen
MarkusPaulsen marked this pull request as ready for review July 20, 2026 09:53
@MarkusPaulsen
MarkusPaulsen requested review from a team and krusche as code owners July 20, 2026 09:53
Copilot AI review requested due to automatic review settings July 20, 2026 09:53

Copilot AI 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.

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.

@MarkusPaulsen
MarkusPaulsen merged commit d134342 into main Jul 20, 2026
13 of 14 checks passed
@MarkusPaulsen
MarkusPaulsen deleted the agent/optimise-archunit-transitive-analysis branch July 20, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture Automated area label: architecture other Automated area label: other tests Automated area label: tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants