Issue #78 required vcs/util.go as part of this PR, containing two utility functions: GetAllFilesInPath (recursive directory traversal returning map[string]string) and BuildLineToPositionMap (unified diff parser returning per-file new-line-to-diff-position maps). The exit criteria explicitly listed unit tests for both. The PR delivered vcs/interfaces.go and vcs/types.go but omitted vcs/util.go entirely.
Source
PR: #83 — feat(vcs): extract interfaces and types from gitea/ (Phase 1)
Linked issue: #78 — feat(vcs): extract interfaces and types from gitea/ (Phase 1)
File: vcs/util.go (not present)
What needs to happen
vcs/util.go is created with GetAllFilesInPath(ctx context.Context, client FileReader, owner, repo, path string) (map[string]string, error) and BuildLineToPositionMap(diff string) map[string]map[int]int
Unit tests for GetAllFilesInPath: empty dir, flat dir, nested dirs, mixed
Unit tests for BuildLineToPositionMap: single hunk, multi-hunk, deletion lines not in map, multiple files
## What was missed
Issue #78 required `vcs/util.go` as part of this PR, containing two utility functions: `GetAllFilesInPath` (recursive directory traversal returning `map[string]string`) and `BuildLineToPositionMap` (unified diff parser returning per-file new-line-to-diff-position maps). The exit criteria explicitly listed unit tests for both. The PR delivered `vcs/interfaces.go` and `vcs/types.go` but omitted `vcs/util.go` entirely.
## Source
- PR: #83 — feat(vcs): extract interfaces and types from gitea/ (Phase 1)
- Linked issue: #78 — feat(vcs): extract interfaces and types from gitea/ (Phase 1)
- File: `vcs/util.go` (not present)
## What needs to happen
- `vcs/util.go` is created with `GetAllFilesInPath(ctx context.Context, client FileReader, owner, repo, path string) (map[string]string, error)` and `BuildLineToPositionMap(diff string) map[string]map[int]int`
- Unit tests for `GetAllFilesInPath`: empty dir, flat dir, nested dirs, mixed
- Unit tests for `BuildLineToPositionMap`: single hunk, multi-hunk, deletion lines not in map, multiple files
- `go build ./...` and `go test ./...` pass
## References
- [PR #83](https://gitea.weiker.me/rodin/review-bot/pulls/83)
- [Issue #78](https://gitea.weiker.me/rodin/review-bot/issues/78)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What was missed
Issue #78 required
vcs/util.goas part of this PR, containing two utility functions:GetAllFilesInPath(recursive directory traversal returningmap[string]string) andBuildLineToPositionMap(unified diff parser returning per-file new-line-to-diff-position maps). The exit criteria explicitly listed unit tests for both. The PR deliveredvcs/interfaces.goandvcs/types.gobut omittedvcs/util.goentirely.Source
vcs/util.go(not present)What needs to happen
vcs/util.gois created withGetAllFilesInPath(ctx context.Context, client FileReader, owner, repo, path string) (map[string]string, error)andBuildLineToPositionMap(diff string) map[string]map[int]intGetAllFilesInPath: empty dir, flat dir, nested dirs, mixedBuildLineToPositionMap: single hunk, multi-hunk, deletion lines not in map, multiple filesgo build ./...andgo test ./...passReferences