Skip to content

fix: migrate dirhash to symlink aware analog#31

Merged
alexey-igrychev merged 1 commit intomainfrom
fix/migrate-dirhash-to-symlink-aware-analog
Apr 14, 2026
Merged

fix: migrate dirhash to symlink aware analog#31
alexey-igrychev merged 1 commit intomainfrom
fix/migrate-dirhash-to-symlink-aware-analog

Conversation

@reyreavman
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

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 replaces dirhash.HashDir usage in HashContentsAndPathsRecurse with a custom symlink-aware directory hashing helper to avoid failures when encountering directory symlinks, and adds tests validating compatibility and symlink behavior.

Changes:

  • Replaced dirhash.HashDir call with a new internal hashDir helper that handles directory symlinks.
  • Implemented hashDir to hash directory symlink targets as link-path strings (instead of attempting to read directory contents).
  • Added Ginkgo/Gomega tests covering file/dir hashing, compatibility with dirhash.HashDir (no symlinks), and symlink target changes.

Reviewed changes

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

File Description
pkg/util/hashsum.go Introduces hashDir and switches directory hashing to the symlink-aware implementation.
pkg/util/hashsum_test.go Adds unit tests for success cases, compatibility with dirhash.HashDir, and symlink target-change behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/util/hashsum.go
Comment thread pkg/util/hashsum_test.go
Comment thread pkg/util/hashsum_test.go
Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
@reyreavman reyreavman force-pushed the fix/migrate-dirhash-to-symlink-aware-analog branch from cea937b to ca4733c Compare April 6, 2026 07:30
@alexey-igrychev alexey-igrychev merged commit 0558f83 into main Apr 14, 2026
2 checks passed
@alexey-igrychev alexey-igrychev deleted the fix/migrate-dirhash-to-symlink-aware-analog branch April 14, 2026 10:35
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.

4 participants