Skip to content

Conversation

@MaximPlusov
Copy link
Contributor

@MaximPlusov MaximPlusov commented Jun 30, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted how the application label is determined in generated reports: when REST service details are present the REST identifier is used; otherwise the label now shows "apps" (previously "gui"), ensuring the correct identifier appears when REST details are unavailable.

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

📝 Walkthrough

Walkthrough

HTMLReport replaces the private GUI constant with APPS. getAppName() still returns VERAPDF_REST when REST details are present; otherwise it now returns APPS instead of GUI. No public API signature changes.

Changes

Cohort / File(s) Summary
Constant rename & logic update
core/src/main/java/org/verapdf/report/HTMLReport.java
Removed GUI = "gui", added APPS = "apps". Updated getAppName() to return APPS when REST details are absent; preserved REST return path (VERAPDF_REST).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐰 I hopped from GUI to APPS with flair,
A tiny tweak handled with care,
Constants renamed, the logic sings,
Rest stays true while change now springs,
A rabbit's hop — light as air. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% 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 'Update app name for html report' is directly related to the main change: updating the app name constant and its usage in the HTML report class.
✨ 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 html_app_name

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f698b2e and a3d7766.

📒 Files selected for processing (1)
  • core/src/main/java/org/verapdf/report/HTMLReport.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/src/main/java/org/verapdf/report/HTMLReport.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). (1)
  • GitHub Check: Codacy Static Code 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 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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ecf7c61 and f698b2e.

📒 Files selected for processing (1)
  • core/src/main/java/org/verapdf/report/HTMLReport.java (2 hunks)
⏰ 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: Quality Assurance
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
core/src/main/java/org/verapdf/report/HTMLReport.java (1)

99-106: LGTM!

The method logic is correct. It maintains the existing behavior of returning "verapdf-rest" when REST details are present, and now returns "apps" as the default fallback instead of "gui".

private static final String detailedReport = resourceRoot + "DetailedHtmlReport" + xslExt; //$NON-NLS-1$
private static final String summaryReport = resourceRoot + "SummaryHtmlReport" + xslExt; //$NON-NLS-1$
private static final String GUI = "gui"; //$NON-NLS-1$
private static final String APPS = "apps"; //$NON-NLS-1$
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the impact of renaming "gui" to "apps" in HTML templates and consuming code.

The constant declaration is correct. However, ensure that HTML report templates (XSL files) and any consuming code are updated to handle "apps" instead of "gui".

Run the following script to verify references to the old "gui" value and new "apps" value:


🏁 Script executed:

#!/bin/bash
# Description: Search for references to "gui" and "apps" in XSL templates and Java files

# Search for hardcoded "gui" strings that might expect the old constant value
rg -n -C3 '"gui"' --type=xml --type=xsl

# Search for references to the new "apps" value
rg -n -C3 '"apps"' --type=xml --type=xsl

# Search for usages of getAppName() to understand how the value is used
rg -n -C3 'getAppName\(\)' --type=java

Length of output: 1292


🏁 Script executed:

#!/bin/bash
# Find XSL template files
echo "=== Finding XSL/XSLT files ==="
fd -e xsl -e xslt

# Search for appName in all files
echo "=== Searching for appName references ==="
rg -n "appName" -C3

# Search for hardcoded gui values
echo "=== Searching for 'gui' string literals ==="
rg -n '"gui"' -C3

# Get complete getAppName method using ast-grep
echo "=== Complete getAppName() method ==="
ast-grep --pattern 'private static String getAppName() { $$$ }'

Length of output: 10593


🏁 Script executed:

#!/bin/bash
# Find ReleaseDetails class definition
echo "=== ReleaseDetails class ==="
rg -n "class ReleaseDetails" -A10 --type=java

# Search for where releaseDetails elements are created in XML
echo "=== releaseDetails XML creation ==="
rg -n "releaseDetails" -B2 -A2 --type=java

# Check buildInformation/releaseDetails generation
echo "=== BuildInformation class ==="
rg -n "class BuildInformation" -A10 --type=java

# Search for any enum or constant that defines app names
echo "=== App name constants/values ==="
rg -n '"gui"|"apps"|"rest"' -B1 -A1 --type=java

Length of output: 4196


🏁 Script executed:

#!/bin/bash
# Find release properties files
echo "=== Release properties files ==="
fd -e properties | grep -i release

# Check properties file content
echo "=== Properties file content (id values) ==="
rg -n '\bid=' --type=properties

# Find where XML is generated with releaseDetails
echo "=== XML generation with releaseDetails ==="
rg -n 'releaseDetails' -B3 -A3 --type=xml --type=java | head -60

# Check test resources for releaseDetails
echo "=== Test resource files with releaseDetails ==="
fd releaseDetails

# Search ReleaseDetails for getId() and id field
echo "=== ReleaseDetails ID field and getter ==="
ast-grep --pattern 'private $$$String id;' 

Length of output: 8455


🏁 Script executed:

#!/bin/bash
# View properties files
echo "=== library.properties ==="
cat core/src/main/resources/org/verapdf/release/library.properties

echo ""
echo "=== test.properties ==="
cat core/src/test/resources/org/verapdf/release/test.properties

# Find ReleaseDetails fields
echo ""
echo "=== ReleaseDetails fields ==="
ast-grep --pattern 'private $$$id;'

# Get complete ReleaseDetails class structure
echo ""
echo "=== ReleaseDetails members ==="
ast-grep --pattern 'public final class ReleaseDetails { $$$ }'

Length of output: 420


🏁 Script executed:

#!/bin/bash
# View full ReleaseDetails.java
echo "=== ReleaseDetails.java ==="
cat core/src/main/java/org/verapdf/ReleaseDetails.java

# Find all XML test files with id="gui"
echo ""
echo "=== Test files with id=gui ==="
rg -l 'id="gui"' --type=xml

# Count occurrences
echo ""
echo "=== Occurrences of id=gui in test files ==="
rg 'id="gui"' --type=xml

Length of output: 8059


🏁 Script executed:

#!/bin/bash
# Search for other references to "gui" in Java code (not just test XML)
echo "=== Java code references to 'gui' ==="
rg -n '"gui"' --type=java -B2 -A2

# Search for where DETAILS map gets populated (runtime behavior)
echo ""
echo "=== addDetailsFromResource calls ==="
rg -n 'addDetailsFromResource' -B1 -A1 --type=java

# Check pom.xml for project artifactId
echo ""
echo "=== Project artifactId in pom.xml ==="
rg -n 'artifactId' core/pom.xml | head -5

# Search for any constants or enums defining app names
echo ""
echo "=== App name definitions ==="
rg -n 'APPS|VERAPDF_REST|gui|apps' --type=java core/src/main/java/org/verapdf/report/HTMLReport.java

Length of output: 1252


Update test data to match new app name fallback value.

The code change replaces the fallback app name from "gui" to "apps" in HTMLReport.java (line 105). However, the test XML file still references id="gui", which will cause the XSL template lookup (releaseDetails[@id=$appName]) to fail at runtime.

Required change:
Update core/src/test/resources/org/verapdf/policy/font-checks-mrr.xml — change id="gui" to id="apps" in the releaseDetails element.

🤖 Prompt for AI Agents
In core/src/test/resources/org/verapdf/policy/font-checks-mrr.xml around the
releaseDetails element, the test XML still uses id="gui" which no longer matches
the new fallback appName ("apps") introduced in
core/src/main/java/org/verapdf/report/HTMLReport.java; update the releaseDetails
element to use id="apps" (i.e., change id="gui" to id="apps") so the XSL lookup
releaseDetails[@id=$appName] will find the correct node at runtime.

Copy link

Copilot AI left a comment

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 updates the default application identifier used in HTML report generation from "gui" to "apps", providing a more generic fallback name when REST service details are unavailable.

  • Changed the constant name from GUI to APPS
  • Updated the string value from "gui" to "apps"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants