-
Notifications
You must be signed in to change notification settings - Fork 49
Update app name for html report #1537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: integration
Are you sure you want to change the base?
Conversation
0765f40 to
8f2888e
Compare
📝 WalkthroughWalkthroughHTMLReport replaces the private Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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. Comment |
8f2888e to
f698b2e
Compare
There was a problem hiding this 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
📒 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$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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=javaLength 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=javaLength 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=xmlLength 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.javaLength 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.
There was a problem hiding this 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
GUItoAPPS - Updated the string value from "gui" to "apps"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f698b2e to
a3d7766
Compare
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.