chore(backend): local-path-configs#1594
Conversation
…FIG and APP_BOOKDROP_FOLDER as environment variables.
provides: - Local shared directory (relative to backend/) for path-config / bookdrop-folder - database-details for the docker backend-db Unifies `just api::run`/ IDE and the Docker dev-environment.
WalkthroughParameterize application paths with environment variables, add an ChangesDevelopment Configuration Externalization
Sequence Diagram(s)sequenceDiagram
participant SpringBoot
participant ConfigFiles
participant Database
SpringBoot->>ConfigFiles: load `application.yaml` (env placeholders)
SpringBoot->>ConfigFiles: load `application-dev.yaml` when 'dev' profile active
SpringBoot->>Database: connect using `spring.datasource` (env or defaults)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/DEVELOPMENT.md`:
- Around line 68-69: Add a blank line immediately after the "### IDE" Markdown
heading so the heading is properly separated from the following paragraph
("**Spring Boot:** Active Profile = `dev`,"); update the section where the
heading "### IDE" appears to insert one empty line below it to satisfy
markdownlint MD022 and ensure correct rendering.
In `@backend/src/main/resources/application-dev.yaml`:
- Line 7: The dev datasource URL overrides the base spring.datasource.url but
omits required connection params; update the default value for the `url`
property (the `${DATABASE_URL:...}` entry) so the fallback JDBC string includes
`createDatabaseIfNotExist=true`, `connectionTimeZone=UTC`, and
`forceConnectionTimeZoneToSession=true` (keeping the existing host/port/schema
and allowing env override via DATABASE_URL) to restore parity with the base
profile and avoid timezone/schema mismatches.
🪄 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: Repository YAML (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: e5bba260-257e-43f7-9a66-0cfb8e462ac2
📒 Files selected for processing (3)
backend/DEVELOPMENT.mdbackend/src/main/resources/application-dev.yamlbackend/src/main/resources/application.yaml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*
⚙️ CodeRabbit configuration file
**/*: This project is being developed using current and future-facing technologies:
- Java 25 with --enable-preview (preview features are INTENTIONAL and encouraged)
- Spring Boot 4 (latest major version, check APIs accordingly)
- Jackson 3 (new package: tools.jackson.* instead of com.fasterxml.jackson.*)
- Hibernate 7.3.x (Jakarta Persistence 3.2, new APIs; avoid deprecated Hibernate 5/6 patterns)
- Angular 21 (signals-based reactivity, no NgModules unless legacy)
Grimmory Internal Tools
- epub4j and pdfium4j are our own internal tools developed by the Grimmory team.
- Always verify behavior and API changes against the upstream repositories:
- If you encounter issues with these libraries, check if a fix exists in the upstream grimmory-tools organization.
Metadata Standards and Compliance
- For all metadata writing and parsing logic, double-check against Dublin Core and ANSI standards to ensure perfect official compliance.
- We strictly follow the widespread and official XML-compliant methods for EPUB2, EPUB3, CBX, and PDF formats.
General Java and Spring rules
- ALWAYS prefer modern, idiomatic Java 25 constructs over legacy patterns.
- Preview features (--enable-preview) are enabled and intentional; do NOT flag them as risky unless there is a concrete runtime issue.
- Prefer: records, sealed classes/interfaces, pattern matching (switch expressions, instanceof), structured concurrency (StructuredTaskScope), scoped values, string templates, unnamed patterns/variables.
- Prefer virtual threads (Thread.ofVirtual(), Executors.newVirtualThreadPerTaskExecutor()) over platform threads for I/O-bound work.
- Prefer the new Sequenced Collections API (SequencedCollection, SequencedMap) where applicable.
- Prefer
varfor local variables when the type is obvious from context.- Use stream().toList() instead of stream().collect(Collectors.toList()) for imm...
Files:
backend/src/main/resources/application.yamlbackend/DEVELOPMENT.mdbackend/src/main/resources/application-dev.yaml
🧠 Learnings (1)
📚 Learning: 2026-05-18T14:54:39.422Z
Learnt from: alexhb1
Repo: grimmory-tools/grimmory PR: 1379
File: frontend/src/assets/styles/tailwind.css:3-4
Timestamp: 2026-05-18T14:54:39.422Z
Learning: In the grimmory-tools/grimmory repository, Biome is not used for linting/formatting (no `biome.json` and no Biome dependency in `package.json`). During code reviews, do not raise Biome-related issues or recommend adding/changing `biome.json`/Biome dependencies for formatting or linting in this project.
Applied to files:
backend/DEVELOPMENT.md
🪛 markdownlint-cli2 (0.22.1)
backend/DEVELOPMENT.md
[warning] 68-68: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🔀 Multi-repo context grimmory-tools/grimmory-docs
Linked repositories findings
grimmory-tools/grimmory-docs
- docs/installation.md — references bookdrop path and Docker volume mapping (
./bookdrop:/bookdrop) and suggests creating ~/grimmory/bookdrop. [::grimmory-tools/grimmory-docs::docs/installation.md] - docs/getting-started.md — instructs creating ~/grimmory/{...,bookdrop} and shows Docker mapping
./bookdrop:/bookdrop. [::grimmory-tools/grimmory-docs::docs/getting-started.md] - docs/bookdrop.md — multiple references to
/bookdropand examples showing- /path/to/bookdrop:/bookdrop(UI screenshots and explanatory text). [::grimmory-tools/grimmory-docs::docs/bookdrop.md] - sidebars.ts — contains entries linking Bookdrop docs (indirect consumer of bookdrop documentation). [::grimmory-tools/grimmory-docs::sidebars.ts]
Notes: I did not find occurrences of the new environment variable names (APP_PATH_CONFIG or APP_BOOKDROP_FOLDER) in this repo; docs currently assume /bookdrop or a host-mounted ./bookdrop path.
🔇 Additional comments (1)
backend/src/main/resources/application.yaml (1)
2-3: LGTM!
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
imnotjames
left a comment
There was a problem hiding this comment.
Good aside from the minor markdown nit
Co-authored-by: James Ward <james@notjam.es>
|
Thanks for the contribution! |
Description
Introduce environment variables for path-config and backdrop-folder.
Linked Issue
fixes #1592
Changes
Manual Testing Steps
just run,dev-up, andjust image-build && just image-runwith and without environment variables set.Screenshots (Optional)
Additional Context (Optional)
AI Disclosure
None
Checklist
just ui checkandjust api check.Summary by CodeRabbit
Documentation
Chores