fleetsync

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package fleetsync decides and performs the sync action for a single repo: clone or pull an active repo, or remove/keep an archived one's local clone. It has no TUI or terminal output of its own — callers (e.g. the wb sync worker pool) drive it and render results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Repo   discover.Repo
	Status Status
	Detail gitops.RepoStatus
	Err    error
}

Result is the outcome of syncing one repo.

func Sync

func Sync(repo discover.Repo, projectsRoot string, dryRun bool) Result

Sync reconciles a single repo's local clone with its GitHub state: clone if missing, pull if present and clean, skip if the working tree is dirty. For archived repos: remove the local clone if it is safe to (clean, no stash, nothing unpushed), otherwise keep it and report why. Forks and repos not owned by the authenticated user or their orgs (repo.Remote == false) are left untouched (NoOp). In dryRun mode no mutation happens; Status still reports what would be done.

type Status

type Status int

Status is the outcome fleetsync.Sync took for a single repo.

const (
	Cloned Status = iota
	Pulled
	SkippedDirty
	RemovedArchived
	KeptArchived
	AbsentArchived
	NoOp
	Failed
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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