Skip to content

Upgrade classgraph from 4.8.198 to 5.0.0 - #858

Merged
asolntsev merged 1 commit into
mainfrom
classgraph-5.0.0
Oct 16, 2026
Merged

asolntsev merged 1 commit into
mainfrom
classgraph-5.0.0

Conversation

@asolntsev

@asolntsev asolntsev commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Bump io.github.classgraph:classgraph 4.8.198 → 5.0.0.
  • ClassGraph 5 scans nothing unless a source is enabled explicitly. Without enableClasspath(), getClasspathFiles() returns an empty list and the play.classes.scanJars scan finds no classes, so controllers in scanned jars fail with "action not found". Added enableClasspath() to both calls in JavaClassesScanner.
  • ClassInfoList.loadClasses() was removed in 5.0. Scanned classes are now loaded with Class.forName(name, false, contextClassLoader), the same way the directory scan does it, and still without initializing them.

6.0.0 was not used because it is compiled for Java 25 (class file version 69) and RePlay targets Java 17.

Test plan

  • ./gradlew check
  • ./gradlew uitest (netty3, netty4, javanet). Before the enableClasspath() fix, multi-module-app failed 3 tests.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved project class scanning when configured to scan JAR files, helping the application discover and load classes from the runtime classpath.

ClassGraph 5 no longer scans anything unless a source is enabled
explicitly, so call enableClasspath() for both the directory listing and
the scanJars scan. ClassInfoList.loadClasses() was removed; load the
scanned classes via Class.forName without initializing them, like the
directory scan already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ee935c5e-e77f-4776-9fb7-aab711123890
📥 Commits

Reviewing files that changed from the base of the PR and between 4cc6391 and d68dd9a.

📒 Files selected for processing: 2
  • framework/src/play/classloading/JavaClassesScanner.java
  • gradle/libs.versions.toml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The scanner enables ClassGraph classpath discovery and loads discovered class names through the thread context class loader without initialization. The ClassGraph catalog version changes to 5.0.0.

Changes: Classpath scanning

Layer / File(s) Summary
Class discovery and loading
framework/src/play/classloading/JavaClassesScanner.java, gradle/libs.versions.toml
The scanner enables ClassGraph classpath support and loads discovered class names through the thread context class loader without initialization. The catalog updates ClassGraph to version 5.0.0.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: xabolcs

Merge Risk: ⚪ Minimal · up to d68dd

This change upgrades ClassGraph to 5.0.0 and adapts the scanner to the new API. It explicitly enables classpath scanning and loads discovered classes without initializing them. No concrete regression was established, and the change looks ready to merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: upgrading ClassGraph from version 4.8.198 to 5.0.0.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@asolntsev asolntsev added this to the 2.8.4 milestone Oct 16, 2026
@asolntsev
asolntsev merged commit 06910a6 into main Oct 16, 2026
8 checks passed
@asolntsev
asolntsev deleted the classgraph-5.0.0 branch October 16, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant