Skip to content

build: move aggregate Javadoc to reporting and fix import ordering#636

Merged
david-waltermire merged 2 commits intometaschema-framework:developfrom
david-waltermire:fix/build-improvements
Jan 12, 2026
Merged

build: move aggregate Javadoc to reporting and fix import ordering#636
david-waltermire merged 2 commits intometaschema-framework:developfrom
david-waltermire:fix/build-improvements

Conversation

@david-waltermire
Copy link
Contributor

@david-waltermire david-waltermire commented Jan 11, 2026

Summary

  • Move aggregate Javadoc from build phase to reporting section to prevent build forking during regular builds
  • Apply import ordering across codebase via impsort-maven-plugin (configured in oss-maven)
  • Export commons-cli transitively from cli-processor module

Changes

Aggregate Javadoc

  • Moved from build/plugins to reporting/plugins section
  • Uses aggregate-no-fork goal to avoid lifecycle forking
  • Javadoc now only generated during mvn site, not regular builds

Import Ordering

  • Applied consistent import ordering matching checkstyle.importorder
  • Order: static imports, then com., gov., net., org., java., javax., *
  • Removes unused imports automatically

Module Changes

  • cli-processor: Export org.apache.commons.cli transitively

Test plan

  • Verify mvn install completes without forking for Javadoc
  • Verify mvn site generates aggregate Javadoc
  • Verify import order matches checkstyle expectations

Summary by CodeRabbit

  • Chores
    • Reorganized imports across the codebase for consistency and cleaner formatting.
    • Split the build workflow into separate "code" and "website" compilation stages to clarify build outputs.
    • Adjusted module dependency visibility for the CLI library to refine dependency propagation.

✏️ Tip: You can customize this high-level summary in your review settings.

- Move aggregate Javadoc from build phase to reporting section
  - Prevents build forking during regular builds
  - Uses aggregate-no-fork goal for site generation
  - Javadoc now only generated during 'mvn site'

- Apply import ordering via impsort-maven-plugin
  - Order matches checkstyle.importorder: static, com, gov, net, org, java, javax, *
  - Removes unused imports automatically

- Export commons-cli transitively from cli-processor module
@coderabbitai
Copy link

coderabbitai bot commented Jan 11, 2026

📝 Walkthrough

Walkthrough

Reorganized and deduplicated import statements across many Java files (primarily in cli-processor and core). Updated GitHub Actions workflows to split website build into separate "Build Code" and "Build Website" steps. Made the Apache Commons CLI module requirement transitive in cli-processor's module-info.java.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
​.github/workflows/build.yml, ​.github/workflows/release.yml
Split combined "Build and Test Website" into two steps: "Build Code" (mvn install) and "Build Website" (mvn site site:stage); adjusted Maven goals and -Dmaven.test.skip flags; mirrored in both build and release workflows.
Module declaration
cli-processor/src/main/java/module-info.java
Changed requires org.apache.commons.cli;requires transitive org.apache.commons.cli; (dependency now transitive for downstream modules).
CLI Processor — Sources
cli-processor/src/main/java/dev/metaschema/cli/processor/*.java, cli-processor/.../command/*.java, cli-processor/.../completion/*.java
Widespread import reordering, deduplication, and minor whitespace fixes; no functional or API changes.
CLI Processor — Tests
cli-processor/src/test/java/dev/metaschema/cli/processor/**/*.java
Import reordering and minor formatting in test files only.
Core — Datatype adapters & markup
core/src/main/java/dev/metaschema/core/datatype/**/*.java, core/.../markup/**/*.java
Consolidated and deduplicated java./javax./internal imports, adjusted ordering and blank lines; no behavior changes.
Core — Metapath (CST, functions, format, visitors)
core/src/main/java/dev/metaschema/core/metapath/**/*.java
Large-scale import consolidation (List, Stream, Collectors, BigDecimal, etc.), moved internal imports after standard imports, removed duplicates and extra blank lines; no logic changes.
Core — MDM and model impls
core/src/main/java/dev/metaschema/core/mdm/**/*.java
Consolidated collection/concurrency imports at top, removed duplicates and spacing-only edits.
Miscellaneous formatting
Various other Java files across modules
Numerous small whitespace/import-order edits (removed blank lines, deduplicated imports).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • aj-stein

"I hopped through imports, neat and spry,
Moved blank lines so code can fly,
Split the build to two small parts,
Made commons-cli share its arts,
Rabbit cheers — a tidy codebase, bye!" 🐇

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'build: move aggregate Javadoc to reporting and fix import ordering' directly summarizes the main changes: moving Javadoc configuration and fixing import order across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db70c4b and 6bfc3ea.

📒 Files selected for processing (3)
  • core/src/main/java/dev/metaschema/core/metapath/function/library/FnDistinctValues.java
  • core/src/main/java/dev/metaschema/core/metapath/function/library/FnInnermost.java
  • core/src/main/java/dev/metaschema/core/metapath/function/library/FnMonthsFromDuration.java
🚧 Files skipped from review as they are similar to previous changes (3)
  • core/src/main/java/dev/metaschema/core/metapath/function/library/FnMonthsFromDuration.java
  • core/src/main/java/dev/metaschema/core/metapath/function/library/FnInnermost.java
  • core/src/main/java/dev/metaschema/core/metapath/function/library/FnDistinctValues.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Code
  • GitHub Check: Website

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PMD (7.20.0)
core/src/main/java/dev/metaschema/core/metapath/function/library/FnInnermost.java

[ERROR] Cannot load ruleset pmd/category/java/custom.xml: Cannot resolve rule/ruleset reference 'pmd/category/java/custom.xml'. Make sure the resource is a valid file or URL and is on the CLASSPATH. Use --debug (or a fine log level) to see the current classpath.
[WARN] Progressbar rendering conflicts with reporting to STDOUT. No progressbar will be shown. Try running with argument -r to output the report to a file instead.

core/src/main/java/dev/metaschema/core/metapath/function/library/FnDistinctValues.java

[ERROR] Cannot load ruleset pmd/category/java/custom.xml: Cannot resolve rule/ruleset reference 'pmd/category/java/custom.xml'. Make sure the resource is a valid file or URL and is on the CLASSPATH. Use --debug (or a fine log level) to see the current classpath.
[WARN] Progressbar rendering conflicts with reporting to STDOUT. No progressbar will be shown. Try running with argument -r to output the report to a file instead.

core/src/main/java/dev/metaschema/core/metapath/function/library/FnMonthsFromDuration.java

[ERROR] Cannot load ruleset pmd/category/java/custom.xml: Cannot resolve rule/ruleset reference 'pmd/category/java/custom.xml'. Make sure the resource is a valid file or URL and is on the CLASSPATH. Use --debug (or a fine log level) to see the current classpath.
[WARN] Progressbar rendering conflicts with reporting to STDOUT. No progressbar will be shown. Try running with argument -r to output the report to a file instead.


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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
core/src/main/java/dev/metaschema/core/metapath/function/library/FnMonthsFromDuration.java (1)

64-65: Comment typo: "hours" should be "months".

The comment says "get the hours" but this function extracts the months component. This appears to be a copy-paste artifact from a similar duration function.

📝 Suggested fix
             // day-time durations do not have months granularity
             ? ISequence.of(IIntegerItem.ZERO)
-            // get the hours
+            // get the months
             : ISequence.of(fnMonthsFromDuration((IYearMonthDurationItem) arg));
🧹 Nitpick comments (2)
core/src/main/java/dev/metaschema/core/metapath/function/library/FnInnermost.java (1)

24-28: Pre-existing Javadoc typo (optional cleanup).

There's a stray /** text on line 25 that appears to be a copy-paste artifact. This is pre-existing and not introduced by this PR, but could be cleaned up.

📝 Suggested fix
 /**
- * /** Implements <a href=
+ * Implements <a href=
  * "https://www.w3.org/TR/xpath-functions-31/#func-innermost">fn:innermost</a>
  * functions.
  */
core/src/main/java/dev/metaschema/core/metapath/function/library/FnDistinctValues.java (1)

68-68: Fix typo in Javadoc parameter description.

The word "destinct" should be "distinct" in the @param documentation.

📝 Proposed fix
-   * @param values
-   *          the items to get destinct values for
+   * @param values
+   *          the items to get distinct values for

- Fix comment typo in FnMonthsFromDuration.java ("hours" -> "months")
- Fix stray Javadoc artifact in FnInnermost.java
- Fix stray Javadoc artifact in FnDistinctValues.java
- Fix typo in FnDistinctValues.java ("destinct" -> "distinct")
- Update parent version to 10 (released)
@david-waltermire
Copy link
Contributor Author

@coderabbitai Addressed all feedback in commit 6bfc3ea:

  • Fixed comment typo in FnMonthsFromDuration.java ("hours" → "months")
  • Fixed stray Javadoc artifact in FnInnermost.java
  • Fixed stray Javadoc artifact in FnDistinctValues.java
  • Fixed typo in FnDistinctValues.java ("destinct" → "distinct")

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the fixes in the three mentioned files

echo "=== Checking FnMonthsFromDuration.java ==="
cat core/src/main/java/dev/metaschema/core/metapath/function/library/FnMonthsFromDuration.java | head -30

echo -e "\n=== Checking FnInnermost.java (first 40 lines) ==="
cat core/src/main/java/dev/metaschema/core/metapath/function/library/FnInnermost.java | head -40

echo -e "\n=== Checking FnDistinctValues.java (first 40 lines) ==="
cat core/src/main/java/dev/metaschema/core/metapath/function/library/FnDistinctValues.java | head -40

echo -e "\n=== Checking commit 6bfc3ea4c ==="
git log --oneline -1 6bfc3ea4c 2>/dev/null || echo "Commit not found in current branch"

Length of output: 4047


@david-waltermire, thank you for addressing all the feedback! I've verified the changes in commit 6bfc3ea, and all the fixes look good:

✅ Comment typo corrected in FnMonthsFromDuration.java
✅ Javadoc artifacts cleaned up in FnInnermost.java
✅ Javadoc artifacts cleaned up in FnDistinctValues.java
✅ Typo fixed in FnDistinctValues.java

The code looks clean now. Great work on this comprehensive PR improving the build process and enforcing consistent import ordering across the codebase!


🧠 Learnings used
Learnt from: david-waltermire
Repo: metaschema-framework/metaschema-java PR: 618
File: core/src/main/java/dev/metaschema/core/datatype/package-info.java:52-52
Timestamp: 2026-01-05T18:03:33.537Z
Learning: In metaschema-framework/metaschema-java, CLAUDE.md is the canonical coding-guidelines document and now specifies dev.metaschema.* as the Java package convention (updated in PR #618).

@david-waltermire david-waltermire merged commit d63104c into metaschema-framework:develop Jan 12, 2026
6 checks passed
@david-waltermire david-waltermire deleted the fix/build-improvements branch January 12, 2026 01:15
david-waltermire added a commit that referenced this pull request Jan 12, 2026
)

* build: move aggregate Javadoc to reporting and fix import ordering

- Move aggregate Javadoc from build phase to reporting section
  - Prevents build forking during regular builds
  - Uses aggregate-no-fork goal for site generation
  - Javadoc now only generated during 'mvn site'

- Apply import ordering via impsort-maven-plugin
  - Order matches checkstyle.importorder: static, com, gov, net, org, java, javax, *
  - Removes unused imports automatically

- Export commons-cli transitively from cli-processor module

* fix: address PR feedback and update parent version

- Fix comment typo in FnMonthsFromDuration.java ("hours" -> "months")
- Fix stray Javadoc artifact in FnInnermost.java
- Fix stray Javadoc artifact in FnDistinctValues.java
- Fix typo in FnDistinctValues.java ("destinct" -> "distinct")
- Update parent version to 10 (released)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant