Skip to content

Conversation

@julio-lopez
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Jun 14, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 76.41%. Comparing base (cb455c6) to head (42473d6).
Report is 573 commits behind head on master.

Files with missing lines Patch % Lines
internal/cache/content_cache.go 80.00% 0 Missing and 1 partial ⚠️
internal/cache/persistent_lru_cache.go 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4666      +/-   ##
==========================================
+ Coverage   75.86%   76.41%   +0.55%     
==========================================
  Files         470      529      +59     
  Lines       37301    40157    +2856     
==========================================
+ Hits        28299    30687    +2388     
- Misses       7071     7455     +384     
- Partials     1931     2015      +84     

☔ 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 requested a review from Copilot June 14, 2025 06:19
@julio-lopez julio-lopez marked this pull request as ready for review June 14, 2025 06:19
@julio-lopez julio-lopez enabled auto-merge (squash) June 14, 2025 06:20
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 performs miscellaneous cleanups across tests and code, focusing on refactoring OS checks, modernizing utility calls, and tightening test assertions and cache APIs.

  • Replace literal "windows" checks with windowsOSName constant.
  • Simplify slices.Compact usage and unify public/private cache methods.
  • Enhance and DRY up tests with require helpers and new verifyCached/verifyNotCached functions.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/end_to_end_test/snapshot_create_test.go Swapped runtime.GOOS literal for windowsOSName.
tests/end_to_end_test/snapshot_actions_test.go Same windowsOSName replacement in action script tests.
snapshot/policy/scheduling_policy.go Removed redundant type args from slices.Compact.
internal/stat/stat_unix.go Merged the package doc comments into one line.
internal/stat/stat_test.go Renamed variables, tightened assertions, removed unused import.
internal/cache/persistent_lru_cache.go Changed GetFull/GetPartial to private, updated internal calls.
internal/cache/export_test.go Added TestingGetFull to expose private cache fetch for tests.
internal/cache/content_cache.go Switched calls from GetFull/GetPartial to private versions.
internal/cache/persistent_lru_cache_test.go Refactored tests to use verifyCached and verifyNotCached.
Comments suppressed due to low confidence (4)

internal/cache/persistent_lru_cache.go:93

  • Removing the exported GetFull method breaks the public API. Consider retaining a public wrapper or marking it deprecated to avoid breaking external consumers.
// getFull fetches the contents of a full blob. Returns false if not found.

tests/end_to_end_test/snapshot_create_test.go:780

  • Ensure that windowsOSName is defined and imported in this test; otherwise the reference will cause a compile error.
if runtime.GOOS == windowsOSName {

tests/end_to_end_test/snapshot_actions_test.go:268

  • Ensure that windowsOSName is defined and imported in this test; otherwise the reference will cause a compile error.
if runtime.GOOS == windowsOSName {

internal/stat/stat_test.go:29

  • [nitpick] The magic number 512 may vary across platforms; consider documenting why this value was chosen or extracting it into a named constant.
const expectedMinAllocSize = 512

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@julio-lopez julio-lopez disabled auto-merge June 14, 2025 06:53
@julio-lopez julio-lopez merged commit 735adfc into kopia:master Jun 14, 2025
30 of 31 checks passed
@julio-lopez julio-lopez deleted the refactor/nits branch June 14, 2025 06:56
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