Skip to content

[v2.3] hotfix 1 - #30

Closed
byteful wants to merge 1 commit into
mainfrom
dev
Closed

[v2.3] hotfix 1#30
byteful wants to merge 1 commit into
mainfrom
dev

Conversation

@byteful

@byteful byteful commented Jul 10, 2026

Copy link
Copy Markdown
Member

Confidence Score: 4/5

This PR has one contained analytics response regression to fix before merging.

The functional changes are narrow, but AnalyticsService changes a client-visible date format for daily chart data.

src/main/java/gg/modl/backend/analytics/service/AnalyticsService.java

T-Rex T-Rex Logs

What T-Rex did

  • I added a focused JUnit harness that mocks AnalyticsMongoRepository to return dailyTickets bucket id 2026-03-12 and asserted the service should expose Mar 12.
  • I attempted to run the narrow Gradle test command, but execution was blocked because no java command was in PATH and JAVA_HOME was unset.
  • I documented environment blockers from logs, including java not found and JAVA_HOME being empty, and Gradle wrapper abort messages.
  • I captured and prepared six artifacts (three from the harness attempt and three environment logs) for reviewer inspection.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/main/java/gg/modl/backend/analytics/service/AnalyticsService.java Removes date-label formatting from analytics chart responses; this regresses existing display-format behavior for daily analytics series.
src/main/java/gg/modl/backend/database/mongo/repository/AnalyticsMongoRepository.java Adds Mongo date-type filters before date aggregation to skip malformed date values; repository-layer placement is appropriate.
scripts/migrations/2026-03-12-consolidate-indexes.mongosh.js Only line-ending normalization; no functional migration changes detected.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/main/java/gg/modl/backend/analytics/service/AnalyticsService.java:113-116
**Preserve chart labels**
The analytics API now returns raw aggregation keys like `2026-03-12` instead of the previous `MMM dd` labels for date-based chart series. This affects `dailyTickets` here and the same changed mapping for `dailyPunishments` and `newPlayersTrend`, so existing panel/minecraft clients that render these fields as display labels will show the wrong format after this hotfix.

Reviews (1): Last reviewed commit: "LF + audit/analytics" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used:

  • Rule used - This is a Java Spring Boot REST API backed by Mong... (source)

Comment on lines 113 to 116
final List<TicketAnalyticsResponse.DailyTicket> dailyTickets = analyticsRepository.aggregateDailyTicketCounts(server, startDate, ANALYTICS_TIME_ZONE)
.stream()
.map(result -> new TicketAnalyticsResponse.DailyTicket(
formatDateLabel(result.id(), dateFormatter),
result.count()
))
.map(result -> new TicketAnalyticsResponse.DailyTicket(result.id(), result.count()))
.toList();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Preserve chart labels
The analytics API now returns raw aggregation keys like 2026-03-12 instead of the previous MMM dd labels for date-based chart series. This affects dailyTickets here and the same changed mapping for dailyPunishments and newPlayersTrend, so existing panel/minecraft clients that render these fields as display labels will show the wrong format after this hotfix.

Rule Used: This is a Java Spring Boot REST API backed by Mong... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/main/java/gg/modl/backend/analytics/service/AnalyticsService.java
Line: 113-116

Comment:
**Preserve chart labels**
The analytics API now returns raw aggregation keys like `2026-03-12` instead of the previous `MMM dd` labels for date-based chart series. This affects `dailyTickets` here and the same changed mapping for `dailyPunishments` and `newPlayersTrend`, so existing panel/minecraft clients that render these fields as display labels will show the wrong format after this hotfix.

**Rule Used:** This is a Java Spring Boot REST API backed by Mong... ([source](https://app.greptile.com/modl-gg/github/modl-gg/backend/-/custom-context?memory=b4136624-5265-466d-9689-920e361bc645))

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@byteful byteful closed this Jul 11, 2026
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.

1 participant