Conversation
- Implement features - getFollowers - getFollowers - existsFollow - followUser - unfollowUser - Secure /users/follows endpoint for MEMBER role - Add user_follows table with unique constraint
- Add followerCount and followingCount to DTO, projection, and entity
- Allow `/users/follows/**` in security config - Fix query param name mismatch in UserMetaRepository - Replace getReferenceById with findById and throw not found
- Introduce NotificationExecutor for async processing - Publish events on posted
…erviceTest.AddStarTest
…n service - Rename `followerCount` to `followersCount` for consistency - Update service to maintain stats counters
- Upgrade Spring Boot to 4.0.5 - Upgrade kotlin-logging-jvm to 8.0.01 - Upgrade java-jwt to 4.5.1 - Upgrade resend-java to 4.13.0 - Bump project version to 0.11.0-SNAPSHOT
There was a problem hiding this comment.
Pull request overview
Release 0.11.0 introducing a user follow system (with follower stats + notifications) and migrating full-text search from ParadeDB to PGroonga, along with related dependency/test updates.
Changes:
- Add follow/unfollow domain (DB table, entity/repo/service/controller) and expose follower/following counts in user stats.
- Publish “post created” domain events (article/series/question) and asynchronously fan-out notifications to followers after commit.
- Replace ParadeDB search functions/indexes with PGroonga equivalents (Hibernate function contributor + SQL DDL).
Reviewed changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/kotlin/me/loghub/api/service/user/UserFollowServiceTest.kt | New unit tests for follow service behaviors (list/exists/follow/unfollow). |
| src/test/kotlin/me/loghub/api/service/series/SeriesServiceTest.kt | Verifies SeriesCreatedEvent publication on series creation. |
| src/test/kotlin/me/loghub/api/service/question/QuestionServiceTest.kt | Verifies QuestionCreatedEvent publication on question creation. |
| src/test/kotlin/me/loghub/api/service/article/ArticleStarServiceTest.kt | Updates tests to use findById-based article lookup. |
| src/test/kotlin/me/loghub/api/service/article/ArticleServiceTest.kt | Verifies ArticleCreatedEvent publication on article creation. |
| src/main/resources/database/public/tables.sql | Adds user_follows table + new follower/following counters in user_meta. |
| src/main/resources/database/public/indexes.sql | Replaces ParadeDB bm25 indexes with PGroonga indexes. |
| src/main/resources/database/extensions.sql | Switches DB extension from pg_search to pgroonga. |
| src/main/kotlin/me/loghub/api/service/user/UserFollowService.kt | New service for follower/followee listing and follow/unfollow mutations with stats updates. |
| src/main/kotlin/me/loghub/api/service/series/SeriesService.kt | Publishes SeriesCreatedEvent after saving a series. |
| src/main/kotlin/me/loghub/api/service/question/QuestionService.kt | Publishes QuestionCreatedEvent after saving a question. |
| src/main/kotlin/me/loghub/api/service/article/ArticleStarService.kt | Switches to findById + published validation for starring. |
| src/main/kotlin/me/loghub/api/service/article/ArticleService.kt | Publishes ArticleCreatedEvent for newly created published articles. |
| src/main/kotlin/me/loghub/api/scheduler/UserMetaJobConfig.kt | Removes redundant !! on builder build() calls. |
| src/main/kotlin/me/loghub/api/repository/user/UserRepository.kt | Minor formatting change (blank line). |
| src/main/kotlin/me/loghub/api/repository/user/UserMetaRepository.kt | Adds modifying queries to increment/decrement follow counters. |
| src/main/kotlin/me/loghub/api/repository/user/UserFollowRepository.kt | New repository for follow graph queries. |
| src/main/kotlin/me/loghub/api/repository/series/SeriesCustomRepository.kt | Uses PGroongaHibernateFunction for FTS condition. |
| src/main/kotlin/me/loghub/api/repository/question/QuestionCustomRepository.kt | Uses PGroongaHibernateFunction for FTS condition. |
| src/main/kotlin/me/loghub/api/repository/article/ArticleCustomRepository.kt | Uses PGroongaHibernateFunction for FTS condition. |
| src/main/kotlin/me/loghub/api/mapper/user/UserMapper.kt | Includes follower/following counts in UserStatsDTO mapping. |
| src/main/kotlin/me/loghub/api/listener/PostNotificationEventListener.kt | New async transactional event listener to notify followers on post creation. |
| src/main/kotlin/me/loghub/api/lib/hibernate/PostgresFunctionContributor.kt | Registers PGroonga functions instead of ParadeDB functions. |
| src/main/kotlin/me/loghub/api/lib/hibernate/ParadeDBHibernateFunction.kt | Removes ParadeDB function enum. |
| src/main/kotlin/me/loghub/api/lib/hibernate/PGroongaHibernateFunction.kt | Adds PGroonga function enum (FTS + score). |
| src/main/kotlin/me/loghub/api/entity/user/UserStats.kt | Adds followersCount and followingCount to embedded stats. |
| src/main/kotlin/me/loghub/api/entity/user/UserFollow.kt | New UserFollow entity. |
| src/main/kotlin/me/loghub/api/entity/series/Series.kt | Adds tableoid/ctid formulas used for PGroonga scoring. |
| src/main/kotlin/me/loghub/api/entity/question/Question.kt | Adds tableoid/ctid formulas used for PGroonga scoring. |
| src/main/kotlin/me/loghub/api/entity/article/Article.kt | Adds tableoid/ctid formulas used for PGroonga scoring. |
| src/main/kotlin/me/loghub/api/dto/user/UserStatsProjection.kt | Kotlin style cleanup (removes semicolons). |
| src/main/kotlin/me/loghub/api/dto/user/UserStatsDTO.kt | Adds followersCount and followingCount fields. |
| src/main/kotlin/me/loghub/api/dto/series/event/SeriesCreatedEvent.kt | New event payload for series creation. |
| src/main/kotlin/me/loghub/api/dto/series/SeriesSort.kt | Uses PGroonga score function and new formula fields for “relevant” sorting. |
| src/main/kotlin/me/loghub/api/dto/question/event/QuestionCreatedEvent.kt | New event payload for question creation. |
| src/main/kotlin/me/loghub/api/dto/question/QuestionSort.kt | Uses PGroonga score function and new formula fields for “relevant” sorting. |
| src/main/kotlin/me/loghub/api/dto/article/event/ArticleCreatedEvent.kt | New event payload for article creation. |
| src/main/kotlin/me/loghub/api/dto/article/ArticleSort.kt | Uses PGroonga score function and new formula fields for “relevant” sorting. |
| src/main/kotlin/me/loghub/api/controller/user/UserFollowController.kt | New REST endpoints for follow graph operations. |
| src/main/kotlin/me/loghub/api/constant/message/ResponseMessage.kt | Adds follow-related response messages. |
| src/main/kotlin/me/loghub/api/config/SecurityConfig.kt | Restricts GET access to follow endpoints to MEMBER role. |
| src/main/kotlin/me/loghub/api/config/AsyncConfig.kt | Adds dedicated notificationExecutor for async notification fan-out. |
| build.gradle.kts | Bumps Spring Boot + various dependencies; updates project version to 0.11.0-SNAPSHOT. |
| README.md | Updates docs to reflect PGroonga and new postgres image dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog