implement timestamp correction utilities and tests for git commit data#3518
Open
shlokgilda wants to merge 2 commits intochaoss:mainfrom
Open
implement timestamp correction utilities and tests for git commit data#3518shlokgilda wants to merge 2 commits intochaoss:mainfrom
shlokgilda wants to merge 2 commits intochaoss:mainfrom
Conversation
Signed-off-by: Shlok Gilda <[email protected]>
…ction tests Signed-off-by: Shlok Gilda <[email protected]>
a354293 to
62f1c29
Compare
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
Fixes #3472 - PostgreSQL insertion failures due to invalid committer timestamps.
The Bug:
facade_bulk_insert_commits()only validatedcmt_author_timestampwhen handling DB insertion failures. If the author timestamp was valid but the committer timestamp had an invalid timezone (e.g.,-13068837from git corruption), the insert would fail permanently.The Fix:
augur/tasks/git/correction.pywith timezone validation functions (simple string operations)lib.pyto validate both author and committer timestamps when the binary search isolates a problematic commitChanges:
augur/tasks/git/correction.py- Timestamp validation utilitiesaugur/application/db/lib.py- Now validates both timestamps on failuretests/test_tasks/test_git/test_correction.py- 12 unit tests (all passing)Notes for Reviewers
POSTGRES_VALID_TIMEZONESincludes all real-world timezone offsets (-12:00 to +14:00). Some of the timezone offsets were missing. Reference: https://docs.oracle.com/cd/E19563-01/819-4437/anovd/index.htmlSigned commits
AI Disclosure: I used Claude Code to assist with writing docstrings, code review, writing test cases, and drafting this PR description. All test cases were manually verified and are passing locally.