Skip to content

Conversation

@julio-lopez
Copy link
Collaborator

No description provided.

- make variables local to the test and rename accordingly
- make the purpose a `const (untyped) string`
@julio-lopez julio-lopez requested a review from Copilot November 19, 2025 19:50
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 purpose parameter in key derivation functions from []byte to string, simplifying the API and removing unnecessary byte slice conversions throughout the codebase.

Key changes:

  • Modified DeriveKeyFromMasterKey function signature to accept purpose as string instead of []byte
  • Converted several purpose variables from byte slice variables to string constants
  • Updated all call sites and test code to use string literals instead of byte slices

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/crypto/key_derivation.go Changed function signature and removed string conversion of purpose parameter
internal/crypto/aesgcm.go Converted purpose constants from byte slices to strings
internal/crypto/key_derivation_test.go Updated test variables to use string constant and renamed to follow Go naming conventions
repo/repository.go Updated interface and implementation signatures to accept string purpose
repo/open.go Changed purpose variable from byte slice to string constant
repo/maintenance/maintenance_schedule.go Moved purpose from variable to constant and changed type to string
repo/repository_test.go Updated test to use string constant instead of byte slice

@julio-lopez
Copy link
Collaborator Author

@miquella PTAL

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.02%. Comparing base (cb455c6) to head (0f21647).
⚠️ Report is 775 commits behind head on master.

Files with missing lines Patch % Lines
internal/crypto/key_derivation.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5015      +/-   ##
==========================================
+ Coverage   75.86%   78.02%   +2.15%     
==========================================
  Files         470      548      +78     
  Lines       37301    31398    -5903     
==========================================
- Hits        28299    24497    -3802     
+ Misses       7071     4850    -2221     
- Partials     1931     2051     +120     

☔ 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 marked this pull request as ready for review November 20, 2025 03:40
@julio-lopez julio-lopez merged commit 3d4cd24 into kopia:master Nov 20, 2025
26 of 27 checks passed
@julio-lopez julio-lopez deleted the refactor/purpose-string branch November 20, 2025 03: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.

1 participant