Skip to content

Conversation

@FranckLecuyer
Copy link
Contributor

PR Summary

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Replaced raw Class-based JSON parsing with a TypeReference-based overload in ConsumerService to correctly deserialize generic types (e.g., List<ProcessExecutionStep>). Added a test that asserts parsing invalid JSON for step-status updates throws an UncheckedIOException and leaves state unchanged.

Changes

Cohort / File(s) Summary
Consumer service
monitor-server/src/main/java/org/gridsuite/monitor/server/services/ConsumerService.java
Added TypeReference import; new private parsePayload(String, TypeReference<T>) overload that throws UncheckedIOException on failure; updated handleStepsStatusesUpdate to parse payload as TypeReference<List<ProcessExecutionStep>>; retained existing parsePayload(String, Class<T>).
Tests
monitor-server/src/test/java/org/gridsuite/monitor/server/services/ConsumerServiceTest.java
Added consumeMonitorUpdateStepsStatusesThrowsOnInvalidJson test verifying invalid JSON payload for STEPS_STATUSES_UPDATE causes UncheckedIOException and that neither updateExecutionStatus nor updateStepsStatuses are invoked.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hopped through JSON, neat and bright,
TypeReference made the generics right,
When malformed payloads dare to pry,
An IOException says "not today, bye!"
Hooray for tests that watch and bite.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is completely empty, containing only a template comment with no actual description of the changes, objectives, or context for the pull request. Provide a detailed description explaining what deserialization issue was fixed, why the change was necessary, and how the new parsePayload method resolves the problem.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix Jackson deserialization pb' is directly related to the main change, which involves updating Jackson deserialization logic in ConsumerService to handle TypeReference for proper parsing of List.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_deserialization_pb_when_updating_steps_statuses

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

@FranckLecuyer FranckLecuyer merged commit 2a7fd1e into main Feb 4, 2026
4 checks passed
@FranckLecuyer FranckLecuyer deleted the fix_deserialization_pb_when_updating_steps_statuses branch February 4, 2026 15:51
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