-
Notifications
You must be signed in to change notification settings - Fork 593
refactor(general): fix names in ExtendBlobRetentionStats
#4958
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
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
This PR refactors the ExtendBlobRetentionStats implementation to improve consistency and maintainability. The changes introduce a new statistics structure for tracking blob retention extension operations and integrate it into the maintenance workflow.
Key changes:
- Introduced
ExtendBlobRetentionStatsstruct to capture blob retention extension metrics - Modified
ExtendBlobRetentionTimefunction to return statistics instead of an integer count - Added comprehensive test coverage for the new statistics structure
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
repo/maintenancestats/stats_extend_blob_retention.go |
Defines the new ExtendBlobRetentionStats struct with JSON serialization and summary methods |
repo/maintenancestats/builder_test.go |
Adds test cases for serialization/deserialization of ExtendBlobRetentionStats |
repo/maintenancestats/builder.go |
Registers the new stats type in the BuildFromExtra factory function |
repo/maintenance/maintenance_run.go |
Updates task runner to properly handle and return the new statistics object |
repo/maintenance/blob_retain_test.go |
Adds assertions to verify the returned statistics values |
repo/maintenance/blob_retain.go |
Refactors ExtendBlobRetentionTime to return *ExtendBlobRetentionStats and populate statistics throughout execution |
| return nil, errors.Wrap(err, "error iterating packs") | ||
| } | ||
|
|
||
| if opt.DryRun { |
Copilot
AI
Nov 5, 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.
When opt.DryRun is true, the function returns early without setting ExtendedBlobCount in the result. This means the field will be zero even though ToExtendBlobCount is populated. In dry-run mode, ExtendedBlobCount should likely equal ToExtendBlobCount since all blobs that would be extended are counted.
| if opt.DryRun { | |
| if opt.DryRun { | |
| result.ExtendedBlobCount = result.ToExtendBlobCount |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4958 +/- ##
==========================================
+ Coverage 75.86% 78.00% +2.13%
==========================================
Files 470 545 +75
Lines 37301 31368 -5933
==========================================
- Hits 28299 24468 -3831
+ Misses 7071 4853 -2218
- Partials 1931 2047 +116 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d81cb50 to
6718068
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 4 out of 4 changed files in this pull request and generated no new comments.
Uh oh!
There was an error while loading. Please reload this page.