Skip to content

Conversation

@MaximPlusov
Copy link
Contributor

@MaximPlusov MaximPlusov commented May 28, 2025

Summary by CodeRabbit

  • New Features

    • CLI published as a separate, installable component with its own launch scripts.
    • Installer lets you choose GUI and CLI independently.
  • Chores

    • Project reorganized into distinct GUI and CLI modules; packaging and distribution updated.
    • Documentation updated with new build/run instructions for the GUI component.

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

@codecov
Copy link

codecov bot commented May 28, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.33%. Comparing base (77e46c9) to head (ecef8c0).
⚠️ Report is 149 commits behind head on integration.

Files with missing lines Patch % Lines
...src/main/java/org/verapdf/cli/FormatterHelper.java 0.00% 5 Missing ⚠️
...ava/org/verapdf/cli/commands/VeraCliArgParser.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##             integration     #415       +/-   ##
==================================================
+ Coverage           0.00%   18.33%   +18.33%     
- Complexity             0       48       +48     
==================================================
  Files                  2        8        +6     
  Lines                  8      709      +701     
  Branches               0      107      +107     
==================================================
+ Hits                   0      130      +130     
- Misses                 8      562      +554     
- Partials               0       17       +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hueldoeu
Copy link

hueldoeu commented Jun 2, 2025

how can i install veraPDF with the help of winget?

@bdoubrov
Copy link
Contributor

bdoubrov commented Jun 5, 2025

@hueldoeu the veraPDF installer is based on izPack, which is a generic Java-based installer. It does into include WinGet manifest. There is however a way to install veraPDF from command line as described here: https://docs.verapdf.org/install/#automated-installation

BTW, your question doesn't seem to be related to this particular PR. If this is indeed the case, it would be better to post an issue in veraPDF-library repository.

Copy link
Contributor

@carlwilson carlwilson left a comment

Choose a reason for hiding this comment

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

So I like this all in all. I do have some comments as to the final build products and installer behaviour, but they're optimisations.

I'm not in love with the two fat jars approach, I know that we mentioned it in the call. This means a full install's bin directory looks like:

total 18M
drwxr-xr-x 2 cfw cfw 4.0K Jun 13 10:37 .
drwxr-xr-x 7 cfw cfw 4.0K Jun 13 10:37 ..
-rwxr-xr-x 1 cfw cfw 8.7M Jun 13 10:11 cli-1.29.0-SNAPSHOT.jar
-rwxr-xr-x 1 cfw cfw 8.9M Jun 13 10:11 gui-1.29.0-SNAPSHOT.jar

Nearly twice as big as before. I think we need to break the jars/modules apart for deployment. I'd also be interested to see what gets deployed to Maven, but we can review then.

My only other observation is regarding installation and clean-up. If you install on top of an old installation and change between CLI/GUI the jars in the bin directory get "cleaned" by the installer, i.e. installing the CLI will remove any existing GUI jar and vice-versa. The installer doesn't tidy up the corresponding script files so you are left with a "broken" verapdf-gui script:

$ ./verapdf-gui
Error: Could not find or load main class org.verapdf.apps.GreenfieldGuiWrapper
Caused by: java.lang.ClassNotFoundException: org.verapdf.apps.GreenfieldGuiWrapper

We should remove the unused script as well if possible, this could perhaps be done before merging.

@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

📝 Walkthrough

Walkthrough

Replaces the greenfield-apps module with two new modules (apps, cli), updates build and installer configurations to reference gui and cli packages, moves constants from GUI to Apps, and adjusts CI/reporting paths and resource lookup strings accordingly.

Changes

Cohort / File(s) Summary
Top-level modules & POMs
pom.xml, apps/pom.xml, cli/pom.xml, gui/pom.xml, installer/pom.xml
Removed greenfield-apps module; added apps and cli modules. New/updated POMs: assembly/manifest changes, new dependencies (org.verapdf.apps:apps, JAXB), and new installer packaging properties (verapdf.gui.package, verapdf.cli.package).
Apps module sources & resources
apps/src/main/java/org/verapdf/apps/Applications.java, apps/src/main/java/org/verapdf/apps/AppsConstants.java, apps/src/main/java/org/verapdf/apps/utils/ApplicationUtils.java, apps/src/main/resources/org/verapdf/release/apps.properties
New module providing AppsConstants (PDF, ZIP), apps.properties, and updated application details lookup (returns "apps"). Replaced uses of GUI constants with Apps constants in utilities.
CLI module sources & tests
cli/src/main/java/org/verapdf/cli/FormatterHelper.java, cli/src/main/java/org/verapdf/cli/VeraPdfCli.java, cli/src/main/java/org/verapdf/cli/commands/VeraCliArgParser.java, cli/src/test/java/org/verapdf/apps/test/MultithreadingTest.java
New CLI module: formatter calls use DefaultUsageFormatter.s(...); VeraPdfCli resource path changed to apps.*; VeraCliArgParser now uses AppsConstants.ZIP; unused import removed in test.
GUI changes
gui/src/main/java/org/verapdf/gui/PDFValidationApplication.java, gui/src/main/java/org/verapdf/gui/CheckerPanel.java, gui/src/main/java/org/verapdf/gui/utils/GUIConstants.java, gui/pom.xml
Resource/update-check lookups changed to "apps"; multiple UI classes updated to use AppsConstants for PDF/ZIP; removed PDF/ZIP constants from GUIConstants; GUI POM updated (assembly, dependencies switched/added).
Installer/IzPack configs
installer/src/main/izpack/install.xml, auto-install-tmp.xml, docker-install.xml
Installer packs reworked: GUI pack becomes optional; Mac/*nix Scripts and Batch packs removed; new CLI pack introduced with per-OS launcher scripts and jar references using verapdf.cli.package.
CI / Docs / Workflows
.github/workflows/test-pr.yml, README.md
CI coverage/report paths changed from greenfield-apps to cli/cli-report paths; README updated to reference gui sub-module and gui-${project.version}.jar examples.
Legacy cleanup
greenfield-apps/pom.xml, greenfield-apps/.gitignore
Deleted greenfield-apps/pom.xml; removed /target/ ignore from greenfield-apps/.gitignore (now tracked builds).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 New tunnels dug where old fields lay,
Apps and CLI hop out to play,
Constants moved to cheer the pack,
Installers trimmed and set on track,
I nibble bytes and bound away. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Separate cli and gui' directly reflects the main architectural change: the refactoring splits the previous monolithic greenfield-apps module into distinct cli and gui modules.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cli_gui

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76c89a1 and ecef8c0.

📒 Files selected for processing (6)
  • README.md
  • apps/src/main/java/org/verapdf/apps/AppsConstants.java
  • apps/src/main/java/org/verapdf/apps/SoftwareUpdaterImpl.java
  • cli/pom.xml
  • gui/src/main/java/org/verapdf/gui/CheckerPanel.java
  • gui/src/main/java/org/verapdf/gui/utils/GUIConstants.java
💤 Files with no reviewable changes (1)
  • gui/src/main/java/org/verapdf/gui/utils/GUIConstants.java
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/src/main/java/org/verapdf/apps/AppsConstants.java
  • cli/pom.xml
  • README.md
🧰 Additional context used
🧬 Code graph analysis (1)
gui/src/main/java/org/verapdf/gui/CheckerPanel.java (1)
apps/src/main/java/org/verapdf/apps/AppsConstants.java (1)
  • AppsConstants (3-9)
⏰ 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). (6)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Checkout and Build (8)
  • GitHub Check: Checkout and Build (17)
  • GitHub Check: Checkout and Build (11)
  • GitHub Check: Checkout and Build (25)
  • GitHub Check: Checkout and Build (21)
🔇 Additional comments (7)
apps/src/main/java/org/verapdf/apps/SoftwareUpdaterImpl.java (1)

55-55: The change is valid. Both the new gui artifact and the legacy greenfield-apps artifact are published to Maven Central and the queries return results successfully. Version 1.28.1 is available for both, confirming that the software update feature will function correctly with the new artifact name.

gui/src/main/java/org/verapdf/gui/CheckerPanel.java (6)

24-24: LGTM: Import added correctly.

The import for AppsConstants is properly placed and enables the refactored constant references throughout the file.


119-119: LGTM: File chooser setup updated correctly.

The PDF chooser initialization properly uses the relocated constants from AppsConstants.


270-270: LGTM: Drop target listener updated correctly.

The drag-and-drop listener initialization properly references the relocated PDF and ZIP extension constants.


285-290: LGTM: File selection action updated correctly.

The PDF selection action properly uses the relocated constant to filter file types in the chooser dialog.


785-789: LGTM: File processing logic updated correctly.

The switch case properly uses the relocated PDF constant for file type detection and processing.


892-898: LGTM: Extension validation correctly updated to AppsConstants.

The ZIP extension check properly uses the relocated constant. Migration from GUIConstants to AppsConstants is complete across the entire codebase with no remaining references.


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 and usage tips.

@MaximPlusov MaximPlusov marked this pull request as ready for review December 28, 2025 20:56
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: 2

🧹 Nitpick comments (5)
apps/src/main/java/org/verapdf/apps/AppsConstants.java (1)

1-8: Migration from GUIConstants is incomplete and results in code duplication.

The AppsConstants class provides new PDF and ZIP constants, but GUIConstants still defines these same constants and they remain actively used in CheckerPanel.java (lines 118, 269, 287, 785, 892). This creates duplication without a clear migration strategy. Consider either completing the migration by updating all GUI module usages to AppsConstants and deprecating the GUIConstants versions, or clearly document the intended separation of concerns between modules.

apps/pom.xml (1)

1-23: License header inconsistency.

The license header references "VeraPDF Library GUI" but this is the new apps module. Consider updating the header to reflect the correct module name.

cli/pom.xml (2)

1-23: License header inconsistency.

The license header references "VeraPDF Library GUI" but this is the cli module. Consider updating the header to reflect the correct module name.


125-133: Add test scope to test dependencies.

junit and equalsverifier are testing libraries and should have <scope>test</scope> to prevent them from being included in the runtime classpath and the jar-with-dependencies.

🔎 Proposed fix
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
+            <scope>test</scope>
         </dependency>

         <dependency>
             <groupId>nl.jqno.equalsverifier</groupId>
             <artifactId>equalsverifier</artifactId>
+            <scope>test</scope>
         </dependency>
installer/src/main/izpack/install.xml (1)

108-136: CLI pack structure is correct; consider deduplicating the plugins README.

The CLI pack mirrors the GUI pack structure appropriately. However, both packs include plugins/README.txt (line 88 and line 117). While IzPack handles duplicate file installations gracefully, consider extracting the plugins directory setup to a separate required pack or keeping it only in one location to avoid redundancy.

Additionally, since both GUI and CLI packs are now required="no", users could theoretically complete installation without either component. If this is unintended, consider adding pack dependencies or making at least one pack required.

🔎 Optional: Extract plugins setup to avoid duplication

You could create a minimal required "Core" pack that includes shared resources:

<pack name="veraPDF Core" required="yes">
  <description>Core veraPDF files.</description>
  <file targetdir="$INSTALL_PATH/plugins" src="plugins/README.txt"/>
</pack>

Then remove the plugins/README.txt entries from both GUI and CLI packs.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de94727 and 76c89a1.

⛔ Files ignored due to path filters (2)
  • cli/src/test/resources/tmpFilesTest.pdf is excluded by !**/*.pdf
  • cli/src/test/resources/veraPDFtest-pass-a.pdf is excluded by !**/*.pdf
📒 Files selected for processing (38)
  • .github/workflows/test-pr.yml
  • README.md
  • apps/pom.xml
  • apps/src/main/java/org/verapdf/apps/Applications.java
  • apps/src/main/java/org/verapdf/apps/AppsConstants.java
  • apps/src/main/java/org/verapdf/apps/SoftwareUpdater.java
  • apps/src/main/java/org/verapdf/apps/SoftwareUpdaterImpl.java
  • apps/src/main/java/org/verapdf/apps/utils/ApplicationUtils.java
  • apps/src/main/resources/org/verapdf/release/apps.properties
  • auto-install-tmp.xml
  • cli/pom.xml
  • cli/src/main/java/org/verapdf/apps/GreenfieldCliWrapper.java
  • cli/src/main/java/org/verapdf/cli/CliConstants.java
  • cli/src/main/java/org/verapdf/cli/FormatterHelper.java
  • cli/src/main/java/org/verapdf/cli/VeraPdfCli.java
  • cli/src/main/java/org/verapdf/cli/VeraPdfCliProcessor.java
  • cli/src/main/java/org/verapdf/cli/commands/VeraCliArgParser.java
  • cli/src/main/java/org/verapdf/cli/multithread/BaseCliRunner.java
  • cli/src/main/java/org/verapdf/cli/multithread/MultiThreadProcessor.java
  • cli/src/test/java/org/verapdf/apps/test/MultithreadingTest.java
  • cli/src/test/java/org/verapdf/apps/test/TempFileClosingTest.java
  • cli/src/test/java/org/verapdf/cli/VeraPdfCliProcessorTest.java
  • cli/src/test/java/org/verapdf/cli/commands/VerCliFlavourTest.java
  • cli/src/test/java/org/verapdf/cli/commands/VeraCliArgParserTest.java
  • cli/src/test/java/org/verapdf/cli/commands/VeraCliFormatTest.java
  • cli/src/test/java/org/verapdf/cli/commands/VeraCliGetPathsTest.java
  • cli/src/test/java/org/verapdf/cli/commands/VeraCliProfileOptionTest.java
  • cli/src/test/java/org/verapdf/cli/commands/VeraCliTasksTest.java
  • cli/src/test/java/org/verapdf/pdfa/validation/validators/test/CallableValidatorForTest.java
  • docker-install.xml
  • greenfield-apps/.gitignore
  • greenfield-apps/pom.xml
  • gui/pom.xml
  • gui/src/main/java/org/verapdf/apps/GreenfieldGuiWrapper.java
  • gui/src/main/java/org/verapdf/gui/PDFValidationApplication.java
  • installer/pom.xml
  • installer/src/main/izpack/install.xml
  • pom.xml
💤 Files with no reviewable changes (3)
  • greenfield-apps/pom.xml
  • cli/src/test/java/org/verapdf/apps/test/MultithreadingTest.java
  • greenfield-apps/.gitignore
🧰 Additional context used
🧬 Code graph analysis (2)
apps/src/main/java/org/verapdf/apps/utils/ApplicationUtils.java (1)
apps/src/main/java/org/verapdf/apps/AppsConstants.java (1)
  • AppsConstants (3-8)
cli/src/main/java/org/verapdf/cli/commands/VeraCliArgParser.java (1)
apps/src/main/java/org/verapdf/apps/AppsConstants.java (1)
  • AppsConstants (3-8)
⏰ 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). (6)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Checkout and Build (25)
  • GitHub Check: Checkout and Build (11)
  • GitHub Check: Checkout and Build (21)
  • GitHub Check: Checkout and Build (17)
  • GitHub Check: Checkout and Build (8)
🔇 Additional comments (21)
README.md (1)

114-117: LGTM!

The documentation correctly reflects the new module structure, updating references from greenfield-apps to gui for testing the build.

cli/src/main/java/org/verapdf/cli/FormatterHelper.java (1)

59-135: LGTM!

The explicit qualification of DefaultUsageFormatter.s(indentCount) improves code clarity by making the method source explicit. All usages have been consistently updated throughout the class.

.github/workflows/test-pr.yml (1)

49-90: LGTM!

The workflow correctly updates all references from greenfield-apps to cli for coverage reporting, while preserving GUI-related paths. The changes are consistent across artifact upload, download, and reporting steps.

gui/src/main/java/org/verapdf/gui/PDFValidationApplication.java (2)

351-351: Verify consistency with Applications.getAppDetails().

The update check now uses ReleaseDetails.byId("apps"), which should match the ID returned by Applications.getAppDetails(). This is correct based on the changes in apps/src/main/java/org/verapdf/apps/Applications.java.


432-432: The apps.properties resource file exists at the expected location.

The code change updating the path from "app." to "apps." is properly supported. The apps.properties file is present at apps/src/main/resources/org/verapdf/release/apps.properties.

cli/src/main/java/org/verapdf/cli/VeraPdfCli.java (1)

80-80: LGTM!

The resource path update from "app." to "apps." aligns with the broader refactoring to separate CLI and GUI modules. This change is consistent with the corresponding update in PDFValidationApplication.java.

apps/src/main/java/org/verapdf/apps/Applications.java (1)

91-91: The apps.properties resource file exists with valid release metadata.

The apps.properties file is present at apps/src/main/resources/org/verapdf/release/apps.properties and contains the required release metadata properties that support the ReleaseDetails.byId("apps") call.

cli/src/main/java/org/verapdf/cli/commands/VeraCliArgParser.java (2)

25-25: LGTM!

The import correctly references the new AppsConstants class from the apps module, aligning with the module restructuring in this PR.


728-731: LGTM!

The constant references are correctly updated from GUIConstants.ZIP to AppsConstants.ZIP. The logic for checking ZIP file extensions in password handling and metadata fixing remains unchanged.

Also applies to: 735-746

apps/src/main/java/org/verapdf/apps/utils/ApplicationUtils.java (3)

33-33: LGTM!

Import correctly added for the new AppsConstants class.


87-88: LGTM!

Extension checks correctly updated to use AppsConstants.PDF and AppsConstants.ZIP. The logic appropriately allows both PDF and ZIP files at the top-level filtering.


105-105: LGTM!

Extension check correctly updated to use AppsConstants.PDF. The intentional difference from filterPdfFiles (no ZIP check in recursive directory filtering) is preserved.

apps/src/main/resources/org/verapdf/release/apps.properties (1)

1-4: LGTM!

Properties file correctly configured with Maven placeholders for resource filtering. The file path (org/verapdf/release/apps.properties) aligns with the updated resource loading paths in VeraPdfCli and PDFValidationApplication.

auto-install-tmp.xml (1)

29-34: LGTM!

Pack configuration correctly updated to reflect the new module structure. The replacement of the old "Mac and *nix Scripts" and "Validation model" packs with the new "veraPDF CLI" pack is appropriate, and having both GUI and CLI selected by default for the automated install template provides a complete installation.

docker-install.xml (1)

29-34: LGTM!

Docker installation configuration correctly defaults to CLI-only (GUI deselected), which is appropriate for headless container environments. The pack structure aligns with the new module organization.

installer/pom.xml (2)

47-48: LGTM!

New properties correctly define separate package identifiers for GUI and CLI modules, replacing the previous single verapdf.apps.package property.


54-65: LGTM!

Dependencies correctly updated to reference the new cli and gui modules with version alignment via ${project.version}. This ensures the installer builds with the correct module artifacts.

apps/pom.xml (1)

65-68: Remove or add test scope to align with root pom.

The equalsverifier dependency is redeclared in apps/pom.xml without a scope, overriding the root pom's <scope>test</scope> declaration and making it compile-scoped. Since equalsverifier is not used in the apps module (or cli/gui), either add <scope>test</scope> to align with the parent declaration or remove this dependency entirely.

installer/src/main/izpack/install.xml (1)

79-107: GUI pack configuration looks well-structured.

The changes properly separate GUI into an optional pack with dedicated launcher scripts (verapdf-gui / verapdf-gui.bat). The OS-specific handling with parsable and executable directives is correct.

gui/pom.xml (2)

39-81: Build plugins configuration is correct. The assembly plugin is properly configured to create a fat JAR with the specified main class org.verapdf.apps.GreenfieldGuiWrapper (which exists in gui/src/main/java/org/verapdf/apps/), and appendAssemblyId=false produces a clean artifact name. The maven-compiler-plugin declaration correctly inherits its configuration from the parent POM, so no additional configuration is needed here.


84-117: JAXB dependency versions are properly managed in parent POM. The javax.xml.bind:jaxb-api, com.sun.xml.bind:jaxb-core, and com.sun.xml.bind:jaxb-impl dependencies without version tags correctly inherit versions from the root pom.xml's <dependencyManagement> section (2.3.1, 2.3.0.1, and 2.3.2 respectively).

The core dependency is necessary and not redundant. The gui module directly imports from org.verapdf.core in multiple source files (PDFValidationApplication.java, ValidateWorker.java, PolicyPanel.java, and CheckerPanel.java) for utilities like LogsFileHandler, VeraPDFException, and FileUtils. Therefore, the explicit core dependency declaration is appropriate alongside validation-model.

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.

5 participants