Skip to content

Conversation

@julio-lopez
Copy link
Collaborator

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

@julio-lopez julio-lopez requested a review from Copilot November 6, 2025 06:30
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 extendBlobRetentionTime function to improve code organization and type safety. The key changes make GetLockingStoragePrefixes() return []blob.ID instead of []string, unexport the main function while providing test access, and modernize the concurrency implementation.

  • Changed GetLockingStoragePrefixes() to return []blob.ID instead of []string for better type safety
  • Made extendBlobRetentionTime private and added a test helper to access it
  • Replaced manual goroutine management with errgroup and upgraded to atomic.Uint32

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
repo/locking_storage.go Updated GetLockingStoragePrefixes() return type from []string to []blob.ID
repo/open.go Added explicit type conversion to string(prefix) to match the new return type
repo/maintenance/blob_retain.go Refactored to use errgroup, atomic.Uint32, removed unused sync import, made function private
repo/maintenance/maintenance_run.go Updated call to use lowercase extendBlobRetentionTime
repo/maintenance/helper_test.go Added test helper to expose private extendBlobRetentionTime function

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 81.81818% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.01%. Comparing base (cb455c6) to head (9c49b07).
⚠️ Report is 737 commits behind head on master.

Files with missing lines Patch % Lines
repo/maintenance/blob_retain.go 79.16% 3 Missing and 2 partials ⚠️
repo/maintenance/maintenance_run.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4960      +/-   ##
==========================================
+ Coverage   75.86%   78.01%   +2.15%     
==========================================
  Files         470      545      +75     
  Lines       37301    31360    -5941     
==========================================
- Hits        28299    24467    -3832     
+ Misses       7071     4849    -2222     
- Partials     1931     2044     +113     

☔ 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.

@julio-lopez julio-lopez force-pushed the refactor/extend-retention branch from 02cdfee to 9c49b07 Compare November 6, 2025 06:53
@julio-lopez julio-lopez marked this pull request as ready for review November 6, 2025 07:26
Copilot AI review requested due to automatic review settings November 6, 2025 07:26
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 5 out of 5 changed files in this pull request and generated 1 comment.

Comment on lines +121 to 125
result := &maintenancestats.ExtendBlobRetentionStats{
ToExtendBlobCount: toExtend.Load(),
ExtendedBlobCount: extendedCount.Load(),
RetentionPeriod: extendOpts.RetentionPeriod.String(),
}
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

In dry-run mode, ExtendedBlobCount will always be 0 since the extension workers are not started (line 67 check). This is a behavioral change from the original code which returned early with only ToExtendBlobCount set. Consider returning early for dry-run mode to maintain the original behavior and avoid confusion.

Copilot uses AI. Check for mistakes.
@julio-lopez julio-lopez merged commit 1961ed4 into kopia:master Nov 6, 2025
28 checks passed
@julio-lopez julio-lopez deleted the refactor/extend-retention branch November 6, 2025 07:28
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