Skip to content

fix: process resource files AND fix: normalize leading slash in DemoSource path values#156

Merged
paodb merged 2 commits intomasterfrom
fix-processor
Apr 15, 2026
Merged

fix: process resource files AND fix: normalize leading slash in DemoSource path values#156
paodb merged 2 commits intomasterfrom
fix-processor

Conversation

@javier-godoy
Copy link
Copy Markdown
Member

@javier-godoy javier-godoy commented Apr 15, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved resource file handling efficiency and reliability in the build process.
    • Fixed an issue where packaged resources were being incorrectly duplicated.
    • Enhanced resource path resolution and normalization for better accuracy.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

Walkthrough

Updated DemoSourceProcessor to introduce a RESOURCE_ROOTS constant containing resource directory paths. Modified resource-copying logic to normalize paths by stripping leading slashes and skip files originating from META-INF/resources/. Extended openSourceFile() method to resolve resource paths from StandardLocation.CLASS_OUTPUT when matching resource roots.

Changes

Cohort / File(s) Summary
Resource Processing Logic
processor/src/main/java/com/flowingcode/vaadin/addons/demo/DemoSourceProcessor.java
Added RESOURCE_ROOTS constant with src/test/resources/ and src/main/resources/. Introduced path normalization and filtering logic in writeResource() to skip copying files under META-INF/resources/. Extended openSourceFile(String path) to resolve resources from StandardLocation.CLASS_OUTPUT when paths match resource roots.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 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 title is partially related to the changeset—it mentions processing resource files and normalizing leading slashes, which are real aspects of the change, but the phrasing with 'AND' and two separate 'fix:' prefixes makes it awkward and less clear about the primary focus.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-processor

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.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@processor/src/main/java/com/flowingcode/vaadin/addons/demo/DemoSourceProcessor.java`:
- Around line 259-267: isFromMetaInfResources currently only checks
RESOURCE_ROOTS prefixes so a direct normalizedPath like
"/META-INF/resources/foo.js" is missed; update isFromMetaInfResources to first
normalize and test for a direct META-INF/resources prefix (e.g., check
normalizedPath.startsWith("META-INF/resources") ||
normalizedPath.startsWith("/META-INF/resources")) and return true for those
before iterating RESOURCE_ROOTS, preserving the existing logic that computes
relative = normalizedPath.substring(root.length()) and checks for
"META-INF/resources" there.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 91ae1666-8f63-400b-88de-bf29a5147c65

📥 Commits

Reviewing files that changed from the base of the PR and between 5e8e663 and e8f5695.

📒 Files selected for processing (1)
  • processor/src/main/java/com/flowingcode/vaadin/addons/demo/DemoSourceProcessor.java

@javier-godoy javier-godoy marked this pull request as ready for review April 15, 2026 17:57
@paodb paodb merged commit 97a6285 into master Apr 15, 2026
3 checks passed
@paodb paodb deleted the fix-processor branch April 15, 2026 18:50
@github-project-automation github-project-automation bot moved this from To Do to Pending release in Flowing Code Addons Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

2 participants