Skip to content

Extract fileChanges normalization#102

Merged
bluwy merged 1 commit into
mainfrom
normalize-file-changes
Jun 12, 2026
Merged

Extract fileChanges normalization#102
bluwy merged 1 commit into
mainfrom
normalize-file-changes

Conversation

@bluwy

@bluwy bluwy commented Jun 12, 2026

Copy link
Copy Markdown
Member

Refactor only. No changesets.

Previously, our APIs wraps other APIs like this:

  • commitFilesFromDirectory -> commitFilesFromBuffers -> commitFilesFromBase64
  • commitChangesFromRepo -> commitFilesFromBuffers -> commitFilesFromBase64
  • commitFilesFromBuffers -> commitFilesFromBase64
  • commitFilesFromBase64

What they have all in common is commitFilesFromBase64. They really only are commitFilesFromBase64 + syntactic sugar to compute the fileChanges differently. So my idea is that commitFilesFromBase64 should be the only function tested e2e/integration, how fileChanges are computed can be entirely tested as unit tests.

So in this PR, I refactored the APIs to like this:

  • commitFilesFromDirectory -> commitFilesFromBase64 + normalizeFileChanges
  • commitChangesFromRepo -> commitFilesFromBase64 + getFileChanges
  • commitFilesFromBuffers -> commitFilesFromBase64 + normalizeFileChanges
  • commitFilesFromBase64

Now, we're able to test each file changes themselves as unit test. The integration tests will later need to be refactored to test with commitFilesFromBase64 only and then it should be much simpler to run.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedfs-fixture@​2.14.0861009789100

View full report

@bluwy bluwy added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit 8bd7229 Jun 12, 2026
10 checks passed
@bluwy bluwy deleted the normalize-file-changes branch June 12, 2026 09:29
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