Skip to content

Comments

✨ feat: Extend frontend and microblog service to use rag service for spam post predictions#166

Merged
LauraRandl merged 8 commits intorag-servicefrom
extend-existing-services-to-use-rag-service
Feb 17, 2026
Merged

✨ feat: Extend frontend and microblog service to use rag service for spam post predictions#166
LauraRandl merged 8 commits intorag-servicefrom
extend-existing-services-to-use-rag-service

Conversation

@LauraRandl
Copy link
Contributor

This PR integrates the new rag service into the rest of the Unguard application, mainly by extending the frontend and microblog service:

  • The Microblog service now requests and stores a spam prediction for each new post
  • The Microblog now stores user ratings for the spam prediction of each post and provides new routes for retrieving and manipulating them
  • New frontend component showing spam prediction from RAG service for each post
  • New frontend component allowing logged in users to rate the spam predictions of each post

The new frontend components are only rendered for posts that have a spam prediction.

@LauraRandl LauraRandl requested a review from a team as a code owner February 5, 2026 13:36
@LauraRandl LauraRandl force-pushed the extend-existing-services-to-use-rag-service branch from cb077ea to a269edb Compare February 5, 2026 13:38
@LauraRandl LauraRandl changed the title ✨ feat: Extend frontend and microblog service to use rag service for spam post predictions (WIP) ::sparkles: feat: Extend frontend and microblog service to use rag service for spam post predictions Feb 5, 2026
@LauraRandl LauraRandl changed the title (WIP) ::sparkles: feat: Extend frontend and microblog service to use rag service for spam post predictions ✨ feat: Extend frontend and microblog service to use rag service for spam post predictions Feb 5, 2026
@LauraRandl LauraRandl marked this pull request as draft February 5, 2026 13:42
@LauraRandl LauraRandl force-pushed the extend-existing-services-to-use-rag-service branch from 9059076 to db76ce3 Compare February 5, 2026 15:08
@LauraRandl LauraRandl force-pushed the extend-existing-services-to-use-rag-service branch 3 times, most recently from 6e5eb42 to 14bce2a Compare February 6, 2026 10:06
@LauraRandl LauraRandl force-pushed the extend-existing-services-to-use-rag-service branch from 14bce2a to 22cf85d Compare February 6, 2026 10:56
@LauraRandl LauraRandl marked this pull request as ready for review February 6, 2026 11:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

@orazefabian orazefabian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@orazefabian orazefabian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left additional, comments.

@LauraRandl LauraRandl merged commit 75330ba into rag-service Feb 17, 2026
3 checks passed
@LauraRandl LauraRandl deleted the extend-existing-services-to-use-rag-service branch February 17, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants