Skip to content

Conversation

@julio-lopez
Copy link
Collaborator

@julio-lopez julio-lopez commented Nov 5, 2025

@julio-lopez julio-lopez requested a review from Copilot November 5, 2025 23:52
Copy link

Copilot AI left a 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 ExtendBlobRetentionStats struct to capture blob retention extension metrics
  • Modified ExtendBlobRetentionTime function 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 {
Copy link

Copilot AI Nov 5, 2025

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.

Suggested change
if opt.DryRun {
if opt.DryRun {
result.ExtendedBlobCount = result.ToExtendBlobCount

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.00%. Comparing base (cb455c6) to head (6718068).
⚠️ Report is 734 commits behind head on master.

Files with missing lines Patch % Lines
...po/maintenancestats/stats_extend_blob_retention.go 66.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a 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.

@julio-lopez julio-lopez marked this pull request as ready for review November 6, 2025 00:36
@julio-lopez julio-lopez merged commit 16b88cb into kopia:master Nov 6, 2025
27 checks passed
@julio-lopez julio-lopez deleted the refactor/fix-names branch November 6, 2025 00:36
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.

1 participant