hydration

package
v0.1.18-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitFetcher

type GitFetcher interface {
	// Fetch performs shallow clone and checkout of the specified repository.
	Fetch(ctx context.Context, repo *contracts.RepoMaterialization, dest string, auth gitauth.Options) error
}

GitFetcher fetches git repositories using shallow clones for base hydration.

Base Hydration Strategy: The fetcher uses git shallow clones (--depth 1) to create the logical "base snapshot" for each run on each node. This strategy minimizes network transfer and disk usage while providing a consistent starting point for applying per-step diffs during multi-step Migs runs.

The base snapshot is determined by:

  1. base_ref (if provided): Clones the specified branch/tag as the base.
  2. commit_sha (if provided): Fetches and checks out the specific commit after cloning.
  3. Default branch: Used when base_ref is not specified.

For multi-node execution, each node clones the same base_ref/commit_sha independently, ensuring identical base states across nodes before applying ordered diffs.

func NewGitFetcher

func NewGitFetcher(opts GitFetcherOptions) (GitFetcher, error)

NewGitFetcher creates a new git fetcher.

type GitFetcherOptions

type GitFetcherOptions struct {
	// CacheDir specifies the base directory for caching git clones.
	// When set (typically from PLOYD_CACHE_HOME), the fetcher reuses existing clones
	// for the same repo and resolved commit combination, avoiding repeated full clones.
	// When empty, caching is disabled and each fetch performs a fresh clone.
	CacheDir string
}

GitFetcherOptions holds configuration for the git fetcher.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL