Skip to content

refactor(api): use package imports in more situations#899

Merged
imnotjames merged 1 commit into
grimmory-tools:developfrom
imnotjames:refactor/853/use-proper-imports
Apr 26, 2026
Merged

refactor(api): use package imports in more situations#899
imnotjames merged 1 commit into
grimmory-tools:developfrom
imnotjames:refactor/853/use-proper-imports

Conversation

@imnotjames

@imnotjames imnotjames commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Description

For some reason, a number of references to packages are not using imports. This makes it more difficult to do a clean rename to use org.grimmory, so fixing these imports is helpful. this does not fix all cases of this - it seems some files do this more -- but it at least should get all cases of org.booklore

Linked Issue: Related to #853

Changes

  • use import where possible for referencing packages

Summary by CodeRabbit

  • Refactor

    • Internal code cleanup: simplified import statements and replaced fully-qualified type references with imported types across backend modules for improved code readability.
  • Tests

    • Updated test imports and type references to maintain consistency with codebase changes.

@coderabbitai

coderabbitai Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Import cleanup refactoring across multiple backend classes. Adds missing imports for commonly-used types and replaces fully-qualified class references with their imported simple names throughout repository, service, configuration, and test files. No functional logic changes.

Changes

Cohort / File(s) Summary
Repository imports
backend/src/main/java/org/booklore/repository/BookRepository.java, backend/src/main/java/org/booklore/repository/UserBookProgressRepository.java
Import BookEmbeddingProjection, ReadStatus, and Instant types; replace fully-qualified return type and parameter type references with imported simple names.
Service imports
backend/src/main/java/org/booklore/service/progress/ReadingProgressService.java, backend/src/main/java/org/booklore/service/reader/ChapterCacheService.java, backend/src/main/java/org/booklore/service/watcher/PendingDeletionPool.java
Import AuthenticationService, ApiError, and LibraryPathEntity; refactor import statements and replace fully-qualified type references with imported names in method signatures and exception handling.
Config/Security imports
backend/src/main/java/org/booklore/config/security/oidc/OidcTokenValidator.java
Import APIException and replace fully-qualified references across three exception catch blocks.
Test imports
backend/src/test/java/org/booklore/service/Rar5IntegrationTest.java
Import AppSettings, MetadataPersistenceSettings, ChapterCacheService, and FileUtils; replace fully-qualified class references in test instantiation and mocking code.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested labels

backend, chore

Suggested reviewers

  • zachyale

Poem

🐰 Twitching nose with glee,
Imports cleaned so neatly,
No more verbose declarations,
Just simple type abbreviations!
Hopping through cleaner code we go. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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
Title check ✅ Passed Title follows conventional commit format with type(scope) prefix and clearly summarizes the refactoring work of consolidating imports throughout the codebase.
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.
Description check ✅ Passed The PR description clearly explains the purpose (refactoring imports to facilitate renaming), includes a linked issue, and outlines the changes made.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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.

@imnotjames imnotjames marked this pull request as ready for review April 26, 2026 08:07
@imnotjames imnotjames changed the title refactor(api): use package imports when possible refactor(api): use package imports in more situations Apr 26, 2026
@coderabbitai coderabbitai Bot requested a review from zachyale April 26, 2026 08:08
@imnotjames imnotjames merged commit df40f84 into grimmory-tools:develop Apr 26, 2026
19 checks passed
paulbovbel pushed a commit to paulbovbel/grimmory that referenced this pull request Apr 27, 2026
@imnotjames imnotjames deleted the refactor/853/use-proper-imports branch April 28, 2026 20:46
dsmouse pushed a commit to dsmouse/grimmory that referenced this pull request May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants