✨ feat: Extend frontend and microblog service to use rag service for spam post predictions#166
Merged
LauraRandl merged 8 commits intorag-servicefrom Feb 17, 2026
Conversation
cb077ea to
a269edb
Compare
9059076 to
db76ce3
Compare
6e5eb42 to
14bce2a
Compare
14bce2a to
22cf85d
Compare
There was a problem hiding this comment.
Pull request overview
This PR integrates the RAG (Retrieval-Augmented Generation) service for spam detection into the Unguard application, adding spam prediction capabilities to posts and enabling users to rate these predictions.
Changes:
- Backend integration: Microblog service now requests spam predictions from RAG service asynchronously and stores results in Redis with user rating functionality
- Frontend components: New UI components display spam predictions and allow logged-in users to upvote/downvote predictions
- Infrastructure updates: Helm chart templates and environment variable configuration for RAG service integration
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| src/rag-service/README.md | Added environment variables documentation table with typo and incorrect descriptions |
| src/microblog-service/src/test/java/org/dynatrace/microblog/utils/PostSerializerTest.java | Updated test to include new spam prediction parameter |
| src/microblog-service/src/main/java/org/dynatrace/microblog/utils/JwtTokensUtils.java | Added helper method to extract user ID from JWT token |
| src/microblog-service/src/main/java/org/dynatrace/microblog/redis/RedisClient.java | Added Redis operations for spam prediction ratings storage and retrieval with vote management |
| src/microblog-service/src/main/java/org/dynatrace/microblog/ragservice/RAGServiceClient.java | New client for communicating with RAG service to classify posts as spam/not spam |
| src/microblog-service/src/main/java/org/dynatrace/microblog/exceptions/InvalidSpamPredictionException.java | New exception for invalid spam prediction responses |
| src/microblog-service/src/main/java/org/dynatrace/microblog/dto/SpamPredictionRatings.java | New DTO for spam prediction voting data |
| src/microblog-service/src/main/java/org/dynatrace/microblog/dto/SerializedPost.java | Updated to include spam prediction label |
| src/microblog-service/src/main/java/org/dynatrace/microblog/dto/Post.java | Updated to include spam prediction label field |
| src/microblog-service/src/main/java/org/dynatrace/microblog/MicroblogController.java | Added async spam classification, new endpoints for spam prediction ratings, and executor service |
| src/microblog-service/README.md | Added RAG service environment variables documentation |
| src/microblog-service/Dockerfile | Changed AS keyword to uppercase for consistency |
| src/frontend-nextjs/services/api/SpamPredictionVotesService.ts | New service for backend API calls related to spam prediction voting |
| src/frontend-nextjs/services/SpamPredictionVotingService.ts | Service layer for handling spam prediction votes with trailing slash inconsistencies |
| src/frontend-nextjs/hooks/queries/useSpamPredictionUserRating.ts | React Query hook for fetching spam prediction ratings with type mismatch bug |
| src/frontend-nextjs/hooks/mutations/useRateSpamPrediction.ts | React mutation hooks for upvote/downvote actions |
| src/frontend-nextjs/enums/queryKeys.ts | Added query key for spam prediction ratings |
| src/frontend-nextjs/components/Timeline/Timeline.tsx | Updated to pass spam prediction prop to Post component |
| src/frontend-nextjs/components/Timeline/SpamPredictionUserRating.tsx | Component displaying vote counts and buttons for logged-in users |
| src/frontend-nextjs/components/Timeline/PostSpamPrediction.tsx | Alert component showing spam status with variable shadowing bug in ErrorBoundary |
| src/frontend-nextjs/components/Timeline/Post.tsx | Updated to display spam prediction component |
| src/frontend-nextjs/components/SwaggerUIReact.tsx | Minor whitespace cleanup |
| src/frontend-nextjs/app/post/page.tsx | Updated to pass spam prediction prop |
| src/frontend-nextjs/app/api/post/route.ts | Minor whitespace cleanup |
| src/frontend-nextjs/app/api/post/[postId]/spam-prediction-user-rating/upvote/route.ts | API route for upvote endpoint |
| src/frontend-nextjs/app/api/post/[postId]/spam-prediction-user-rating/route.ts | API route for fetching spam prediction ratings with missing error handling |
| src/frontend-nextjs/app/api/post/[postId]/spam-prediction-user-rating/downvote/route.ts | API route for downvote endpoint |
| chart/values.yaml | Added RAG service environment variables with unused configuration value |
| chart/templates/rag-service-configmap.yaml | Added optional LANGDOCK_API_KEY configuration |
| chart/templates/microblog-service.yaml | Added RAG service environment variables to deployment |
src/microblog-service/src/main/java/org/dynatrace/microblog/MicroblogController.java
Show resolved
Hide resolved
src/frontend-nextjs/hooks/queries/useSpamPredictionUserRating.ts
Outdated
Show resolved
Hide resolved
src/microblog-service/src/main/java/org/dynatrace/microblog/MicroblogController.java
Show resolved
Hide resolved
src/microblog-service/src/main/java/org/dynatrace/microblog/redis/RedisClient.java
Show resolved
Hide resolved
src/microblog-service/src/main/java/org/dynatrace/microblog/ragservice/RAGServiceClient.java
Outdated
Show resolved
Hide resolved
src/microblog-service/src/main/java/org/dynatrace/microblog/redis/RedisClient.java
Show resolved
Hide resolved
orazefabian
requested changes
Feb 16, 2026
Contributor
orazefabian
left a comment
There was a problem hiding this comment.
Pls do the requested changes and have a look at the remaining copilot comments. Some of them might be worth having a closer look at.
src/frontend-nextjs/hooks/queries/useSpamPredictionUserRating.ts
Outdated
Show resolved
Hide resolved
src/microblog-service/src/main/java/org/dynatrace/microblog/redis/RedisClient.java
Show resolved
Hide resolved
src/microblog-service/src/main/java/org/dynatrace/microblog/MicroblogController.java
Show resolved
Hide resolved
orazefabian
reviewed
Feb 17, 2026
Contributor
orazefabian
left a comment
There was a problem hiding this comment.
Left additional, comments.
src/microblog-service/src/main/java/org/dynatrace/microblog/redis/RedisClient.java
Show resolved
Hide resolved
orazefabian
approved these changes
Feb 17, 2026
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.
This PR integrates the new rag service into the rest of the Unguard application, mainly by extending the frontend and microblog service:
The new frontend components are only rendered for posts that have a spam prediction.