Skip to content

walk: Move repo walking to 'walk' package

Will Chandler requested to merge wc/walk-storages into master

The internalgitaly provides a way to walk a storage's directory tree and iterate over the repositories found, but does not expose this in a way that is easily consumed elsewhere within Gitaly.

Move the storage walking functionality into a new walk package` and take a closure to be run against each repository found to give flexibility to callers.

While we're at it, improve its efficient a bit by switching to filepath.WalkDir and skipping the internal +gitaly directory.

This preparatory work for starting to monitor the number of repositories present on a Gitaly node.

Related to https://gitlab.com/gitlab-org/gitaly/-/issues/5400

Merge request reports