fix: correctly serialize RFC3339 datetimes in EI API types [Backport release/0.6.z] - #2577
Merged
Merged
Conversation
(cherry picked from commit 443b775)
Contributor
Reviewer's GuideBackport to release/0.6.z that ensures Exploit Intelligence API models serialize OffsetDateTime fields as RFC3339 strings and updates the job completion endpoint test to validate the new JSON representation, including datetime formatting and field values. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Strum355
approved these changes
Aug 12, 2026
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In the
get_job_completedtest, the second RFC3339 assertion uses the message "created should be valid RFC3339" while validatingupdated, which can be confusing when debugging failures; consider adjusting the message to reference the correct field. - The JSON field assertions in
get_job_completed(e.g.,body["id"],body["status"]) rely on implicitPartialEqwithValue; for stronger type safety and clearer failure messages, consider extracting the underlying string/number viaas_str()/as_i64()(withexpect) before comparing.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the `get_job_completed` test, the second RFC3339 assertion uses the message "created should be valid RFC3339" while validating `updated`, which can be confusing when debugging failures; consider adjusting the message to reference the correct field.
- The JSON field assertions in `get_job_completed` (e.g., `body["id"]`, `body["status"]`) rely on implicit `PartialEq` with `Value`; for stronger type safety and clearer failure messages, consider extracting the underlying string/number via `as_str()` / `as_i64()` (with `expect`) before comparing.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Description
Backport of #2565 to
release/0.6.z.Summary by Sourcery
Ensure exploit intelligence API timestamps are serialized as RFC3339 strings and adjust tests to validate the new JSON representation.
Enhancements:
Tests: