Repository navigation
fix(eval): accept space-separated fractional timestamps in time-part modifiers - #611
Merged
Merged
Conversation
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.
Stacked on #610; merge that first.
Closes #589.
rsigma-evalhad two string timestamp parsers. The one behind the time-part modifiers lacked%Y-%m-%d %H:%M:%S%.f, which the correlation engine's parser had, so"2024-07-10 12:30:00.500"worked as a correlation timestamp but madets|hour: 12never match.Changes
timestampmodule withparse_timestamp_str(RFC 3339, then theTand space naive forms with%.f, read as UTC) andnormalize_epoch(values above 10^12 are milliseconds). chrono's%.faccepts a missing fraction, so the two plain%Sformats are gone without losing any input.extract_timestamp_part(time-part modifiers) andparse_timestamp_value(correlation event timestamps) both use it. Correlation keeps its integer epoch path, so out-of-range epochs behave as before.EventValue::as_str, which already had identical rendering. Group keys skip null as before; thevalue_countkey still renders null as"null", now stated at that one call site.Testing
time_part_modifiers_accept_every_timestamp_formrunsts|hour: 12over RFC 3339 with and without a fraction and with an offset, theTand space forms with and without a fraction, integer, millisecond, and float epochs, and garbage. On the old matcher, only the space-separated fractional form fails, which is the bug.test_parse_timestamp_every_formruns the same table through the correlation path, plus unit tests for the shared module.main, 3748 compiled and 0 errors.cargo fmt,clippy -D warnings,cargo doc, the full workspace test suite, anddocs:build/docs:validatepass locally. CI does not run on this PR because its base is notmain.