Skip to content

Conversation

@Rohit-BM18
Copy link
Collaborator

Added functionality to calculate aggregate statistics when comparing what's changed between snapshots using kopia diff

Statistics collected during snapshot diff computation includes:

  • files added/removed/modified
  • dirs added/removed/modified
  • files/dirs with metadata changes but same underlying content (OID)

Testing approach:

  • Added a test for verifying stats collected when comparing two directories with the same objectID but metadata changes across snapshots (dir mode, dir mod time, dir owner, etc), expectation is all the appropriate dir stats fields are updated.
  • Added another test for verifying stats collected when comparing two directories with similar file contents but the metadata for the files have changed between snapshots but content remains unchanged. Expectation is all the relevant file level stats fields are updated.
  • Existing tests have been updated due to stats now being printed in addition to previous output.

@codecov
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 83.47826% with 19 lines in your changes missing coverage. Please review.

Project coverage is 76.35%. Comparing base (cb455c6) to head (7ebced9).
Report is 442 commits behind head on master.

Files with missing lines Patch % Lines
internal/diff/diff.go 87.50% 12 Missing and 1 partial ⚠️
cli/command_diff.go 45.45% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4444      +/-   ##
==========================================
+ Coverage   75.86%   76.35%   +0.49%     
==========================================
  Files         470      527      +57     
  Lines       37301    40030    +2729     
==========================================
+ Hits        28299    30566    +2267     
- Misses       7071     7455     +384     
- Partials     1931     2009      +78     

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

@julio-lopez julio-lopez changed the title Compute stats during snapshot comparison using kopia diff feat(cli): compute snapshot diff stats Mar 7, 2025
@julio-lopez julio-lopez enabled auto-merge (squash) March 7, 2025 12:38
Copy link
Collaborator

@julio-lopez julio-lopez left a comment

Choose a reason for hiding this comment

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

Great job @Rohit-BM18

🥇Thanks for doing this.

@julio-lopez
Copy link
Collaborator

@jkowalski FYI

@julio-lopez julio-lopez merged commit 9b68189 into kopia:master Mar 7, 2025
23 of 24 checks passed
@julio-lopez julio-lopez deleted the compute-stats-during-snapshot-comparison-using-kopia-diff branch March 7, 2025 12:41
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.

2 participants