Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8175 +/- ##
=========================================
Coverage 90.29% 90.29%
Complexity 7650 7650
=========================================
Files 843 843
Lines 23059 23059
Branches 2309 2309
=========================================
Hits 20822 20822
Misses 1519 1519
Partials 718 718 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
cc @jaydeluca |
There was a problem hiding this comment.
Pull request overview
This PR updates the javadoc-crawler module’s minimum-version filtering so artifacts are compared using semantic version ordering instead of lexicographic String.compareTo, preventing incorrect skip/crawl decisions (e.g., 1.9.0 vs 1.49.0).
Changes:
- Replaced lexicographic version filtering with
compareVersions(...)inJavaDocsCrawler. - Added a small internal
SemanticVersionparser/comparator with basic qualifier handling. - Added unit tests to validate semantic ordering and to ensure artifacts below the minimum version do not trigger crawl requests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| javadoc-crawler/src/main/java/io/opentelemetry/javadocs/JavaDocsCrawler.java | Switches min-version filtering to semantic comparison and introduces SemanticVersion. |
| javadoc-crawler/src/test/java/io/opentelemetry/javadocs/JavaDocsCrawlerTest.java | Adds tests for semantic ordering and for skipping crawl requests below min version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
javadoc-crawler/src/main/java/io/opentelemetry/javadocs/JavaDocsCrawler.java
Show resolved
Hide resolved
javadoc-crawler/src/main/java/io/opentelemetry/javadocs/JavaDocsCrawler.java
Outdated
Show resolved
Hide resolved
javadoc-crawler/src/test/java/io/opentelemetry/javadocs/JavaDocsCrawlerTest.java
Outdated
Show resolved
Hide resolved
javadoc-crawler/src/test/java/io/opentelemetry/javadocs/JavaDocsCrawlerTest.java
Show resolved
Hide resolved
javadoc-crawler/src/test/java/io/opentelemetry/javadocs/JavaDocsCrawlerTest.java
Outdated
Show resolved
Hide resolved
jack-berg
left a comment
There was a problem hiding this comment.
Thanks for this. Couple of minor comments. I asked copilot for a review, and gave a 👍 to the comments I agree with.
|
while we're updating this, we could also update the minimum version block: private static final Map<String, String> GROUPS_AND_MIN_VERSION =
Map.of(
"io.opentelemetry", "1.60.1",
"io.opentelemetry.instrumentation", "2.25.0",
"io.opentelemetry.contrib", "1.54.0",
"io.opentelemetry.semconv", "1.40.0",
"io.opentelemetry.proto", "1.10.0"); |
|
Thanks! |
|
Thank you for your contribution @opensourcevk! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
Summary
This change fixes version filtering in the javadoc-crawler module by replacing lexicographic string comparison with semantic version comparison when deciding whether an artifact should be crawled.
Previously, crawlJavaDocs(...) compared artifact versions using String.compareTo(...). That produced incorrect ordering for versions such as 1.9.0 and 1.49.0, which could cause older artifacts to be treated as newer and crawled unnecessarily. The updated logic parses version components numerically and compares them semantically, including basic handling for qualifiers such as -alpha.
What Changed
• Replaced direct string comparison with a new compareVersions(...) helper in JavaDocsCrawler.java.
• Added a small internal SemanticVersion implementation to compare:
◦ dotted numeric version parts (1.9.0 vs 1.49.0)
◦ versions with different component lengths
◦ qualified vs non-qualified versions (1.60.0-alpha vs 1.60.0)
• Added tests in JavaDocsCrawlerTest.java to verify:
◦ semantic ordering works as expected
◦ artifacts below the minimum version are skipped without issuing crawl requests
Why
The crawler uses minimum version thresholds to avoid hitting javadoc.io for artifacts that are too old to matter. With string comparison, some older versions were incorrectly allowed through. This change makes that filtering accurate, reduces unnecessary HTTP requests, and avoids putting extra load on javadoc.io.