Skip to content

refactor: add method that receives class instead of instance#157

Merged
paodb merged 1 commit intomasterfrom
add-method
Apr 30, 2026
Merged

refactor: add method that receives class instead of instance#157
paodb merged 1 commit intomasterfrom
add-method

Conversation

@javier-godoy
Copy link
Copy Markdown
Member

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

While the source URL resolver only requires the class type rather than a concrete instance, updating the interface would introduce a breaking change. Consequently, this refactor is being implemented specifically to facilitate unit testing without disrupting the public API.

Summary by CodeRabbit

  • Refactor
    • Improved source URL resolution mechanism for demo views by enhancing method delegation and class parameter handling to ensure more reliable URL generation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 169a4676-10e4-4d0d-b01c-405dc6a6b1d9

📥 Commits

Reviewing files that changed from the base of the PR and between fcf590d and d2a2ca1.

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

Walkthrough

A new overload of resolveURL was added to DefaultSourceUrlResolver that accepts a Class<? extends TabbedDemo> parameter instead of a TabbedDemo instance. The original method now delegates to this new overload, using the passed-in view class for metadata resolution instead of deriving it from the demo instance.

Changes

Cohort / File(s) Summary
DefaultSourceUrlResolver Method Overloading
base/src/main/java/com/flowingcode/vaadin/addons/demo/DefaultSourceUrlResolver.java
Added public resolveURL overload accepting viewClass parameter; existing method delegates to new overload. URL construction now sources GithubBranch and GithubLink metadata from explicit class parameter.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • scardanzan
  • paodb
🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new method overload that accepts a class parameter instead of requiring a demo instance.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 add-method

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@sonarqubecloud
Copy link
Copy Markdown

@javier-godoy javier-godoy marked this pull request as ready for review April 30, 2026 13:11
@paodb paodb merged commit fa5feea into master Apr 30, 2026
3 checks passed
@paodb paodb deleted the add-method branch April 30, 2026 17:00
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Apr 30, 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