Skip to content

fix: support microseconds and timezone offsets in timestamp ignore regex#200

Merged
sohankshirsagar merged 1 commit intomainfrom
sohan/fix-timestampregex
Mar 19, 2026
Merged

fix: support microseconds and timezone offsets in timestamp ignore regex#200
sohankshirsagar merged 1 commit intomainfrom
sohan/fix-timestampregex

Conversation

@sohankshirsagar
Copy link
Copy Markdown
Contributor

Summary

The built-in ignore_timestamps regex only matched ISO 8601 timestamps with exactly 3 fractional-second digits and an optional Z suffix. Timestamps with microsecond precision (6 digits) or numeric timezone offsets like +00:00 were not recognized, causing false deviations during drift runs.

Changes

  • Updated the timestampRegex in dynamic_fields.go to accept any number of fractional-second digits (\.\d+ instead of \.\d{3}) and both Z and ±HH:MM timezone offsets ((Z|[+-]\d{2}:\d{2})? instead of Z?)
  • Added test cases in dynamic_fields_test.go covering microseconds with +00:00, microseconds with Z, non-UTC offsets (+05:30, -04:00), and milliseconds with offsets

@tusk-dev
Copy link
Copy Markdown
Contributor

tusk-dev Bot commented Mar 19, 2026

Generated 8 tests - 8 passed

Commit tests View tests

Tip

New to Tusk Unit Tests? Learn more here.

You are using "Only surface failing tests" mode, so Tusk will only surface failing tests in the PR comment but you can still see any passing tests in the Tusk UI.

Considered 8 test scenarios and 1 symbol in 1 file but found no failing tests.

View check history

Commit Status Output Created (UTC)
d94e4e9 Generated 8 tests - 8 passed Tests Mar 19, 2026 8:22PM

Was Tusk helpful? Give feedback by reacting with 👍 or 👎

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@sohankshirsagar sohankshirsagar merged commit 25e4cc2 into main Mar 19, 2026
15 checks passed
@sohankshirsagar sohankshirsagar deleted the sohan/fix-timestampregex branch March 19, 2026 20:33
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