-
-
Notifications
You must be signed in to change notification settings - Fork 70
feat: merge thai letters programmatically #2343
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2343 +/- ##
=========================================
Coverage 16.89% 16.89%
Complexity 465 465
=========================================
Files 264 264
Lines 7826 7826
Branches 897 897
=========================================
Hits 1322 1322
Misses 6428 6428
Partials 76 76 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WalkthroughDependency versions updated for webapp and model in pom-dependency-tree. A Java source file comment was adjusted in Word.java, changing the deprecation note on the text field. No functional code changes or public API modifications are present. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (2)
src/main/java/ai/elimu/entity/content/Word.java (2)
50-54: Avoid side effects and high-cardinality logging in toString().
toString()should be inexpensive and side-effect free. Logging at INFO on every call can flood logs and add CPU I/O overhead, especially when entities are logged by frameworks.Apply:
- log.info("wordGson.getId(): " + wordGson.getId()); + if (log.isDebugEnabled()) { + log.debug("wordGson.getId(): {}", wordGson.getId()); + }Optionally, extract a dedicated method for a canonical display string (e.g.,
getDisplayText()that performs Thai letter merging) and keeptoString()concise:public String getDisplayText() { // return merged Thai letters, derived from letterSounds or other fields } @Override public String toString() { return getDisplayText(); }
28-30: Deprecation plan for Word.text: propagate, document, and migrateThe
textfield inWord.javais still heavily used across the codebase (controllers, REST converters, CSV exports, JSPs, schedulers, utility classes), so we need a clear, enforceable deprecation strategy and a defined migration path before removing it.• In src/main/java/ai/elimu/entity/content/Word.java
– Add a Javadoc block ontextexplaining the replacement (toString()) and scheduled removal milestone.
– Replace the bare@Deprecatedwith@Deprecated(forRemoval = true, since = "<version>").
– Annotate Lombok accessors to propagate deprecation:@lombok.Getter(onMethod_ = @Deprecated(forRemoval = true, since = "<version>")) @lombok.Setter(onMethod_ = @Deprecated(forRemoval = true, since = "<version>"))• Deprecate usage in API/DTO layers
– Mark thetextproperty inWordGson(JpaToGsonConverter and REST controllers) as deprecated and plan a versioned removal of the JSON field.
– Update WordCsvExportController and other export logic to usetoString()or a new getter, and update tests accordingly.• Deprecate view and UI dependencies
– JSPs (content/word/list.jsp, create/edit views) that referenceword.textshould be updated to call a helper (e.g.${word}) or a new display method, then mark the old property for removal.• Confirm database migration
– Define when and how thetextcolumn will be dropped or backfilled (e.g., a one-time migration copying computedtoString()back into the column for legacy clients).
– Coordinate with schema versioning (Liquibase/Flyway) to include a deprecation phase.• Communication and rollout
– Announce the deprecation in the next minor release notes (since = "2.X.Y").
– Provide migration examples for clients consuming the REST API or CSV exports.Apply within
Word.java:- @Deprecated // TODO: will be replaced by `toString()` + /** + * @deprecated Avoid persisting or reading this field directly; use {@link #toString()} for the word’s text. + * Removal is targeted for version 3.0 after all consumers have migrated. + */ + @Deprecated(forRemoval = true, since = "2.6.139") @NotNull private String text;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pom.xmlis excluded by!**/*.xml
📒 Files selected for processing (2)
pom-dependency-tree.txt(1 hunks)src/main/java/ai/elimu/entity/content/Word.java(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-03T08:01:30.217Z
Learnt from: jo-elimu
PR: elimu-ai/webapp#0
File: :0-0
Timestamp: 2025-05-03T08:01:30.217Z
Learning: The elimu-ai/webapp repository has a dependency on ai.elimu:model (version 2.0.97) that provides shared model classes and enums. The Language enum should be imported from ai.elimu.model.v2.enums.Language instead of creating local duplicates.
Applied to files:
pom-dependency-tree.txt
⏰ 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). (11)
- GitHub Check: test_ui
- GitHub Check: test_ui
- GitHub Check: test_rest
- GitHub Check: test_rest
- GitHub Check: test_rest
- GitHub Check: build (windows-latest, 17)
- GitHub Check: build (macos-latest, 17)
- GitHub Check: test_rest
- GitHub Check: build (macos-latest, 21)
- GitHub Check: build (windows-latest, 21)
- GitHub Check: build (ubuntu-latest, 21)
🔇 Additional comments (1)
pom-dependency-tree.txt (1)
1-2: Please verify the model dependency version bump in your POM(s)I was unable to locate any
pom.xmlfiles in the changeset, so I can’t confirm that the declared dependency has actually been updated. Before merging, please:
- Ensure that every relevant
pom.xmlcontains:<groupId>ai.elimu</groupId> <artifactId>model</artifactId> <version>2.0.124</version>- Commit those changes alongside your updated dependency tree.
- Double-check that your application code relies on the new Thai-letter merge APIs introduced in model 2.0.124.
Let me know once the POMs have been bumped and committed.
https://github.com/elimu-ai/model/releases/tag/model-2.0.124
Issue Number
Purpose
Technical Details
Testing Instructions
Screenshots
Format Checks
Note
Files in PRs are automatically checked for format violations with
mvn spotless:check.If this PR contains files with format violations, run
mvn spotless:applyto fix them.