-
Notifications
You must be signed in to change notification settings - Fork 29
feat(dbsync): Introduce DBSyncSnapshotService and snapshot freshness test #3222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a8f523c to
db17a54
Compare
01807d5 to
86dc869
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
…test Introduces new components to cleanly implement the Cardano DB-Sync snapshot freshness check using the S3 REST API. * **DBSyncSnapshotService:** A new service class responsible for interacting with the IOHK S3 repository, encapsulating API calls and robust XML parsing logic (including handling S3 namespaces and date formats). * **Clarity:** Uses `dataclass` for snapshot metadata and standard Pytest best practices.
86dc869 to
be0c004
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
f64d3a8 to
e3c64fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
|
||
| assert latest_snapshot.last_modified >= five_days_ago, ( | ||
| f"The latest snapshot is too old. " | ||
| f"Age: {(now_utc - latest_snapshot.last_modified).days} days. " |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The age calculation using .days may be incorrect for snapshots less than a full day old. The .days attribute returns only the integer number of complete days in a timedelta, so a snapshot that's 23 hours old would show as 0 days in the error message. Consider using total_seconds() / 86400 for a more accurate age representation, or clarify that this is intentional.
| f"Age: {(now_utc - latest_snapshot.last_modified).days} days. " | |
| f"Age: {(now_utc - latest_snapshot.last_modified).total_seconds() / 86400:.1f} days. " |
- Refactor `get_test_id` to accept either ClusterLib or ClusterManager. - Update `TestDBSyncSnapshot` to use ClusterManager and instantiate DBSyncSnapshotService directly, removing the fixture. - Move imports to use module import for dbsync_snapshot_service. - Use `dataclasses` and `typing` consistently in dbsync_snapshot_service.py. - Minor docstring and formatting improvements.
e3c64fa to
96be26c
Compare
Introduces new components to cleanly implement the Cardano DB-Sync snapshot freshness check using the S3 REST API.
dataclassfor snapshot metadata and standard Pytest best practices.