Documentation
¶
Overview ¶
Package recipe implements wb's config-driven fleet operations: a Recipe describes how to detect and mutate matching repos, and how to land the result via the same worktree/commit/push-or-PR flow used everywhere else in wb.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Land ¶
Land applies r to repoPath and lands the result via git (direct push, or an auto-merge PR when the branch is protected or the local clone is dirty) — reusing gitops.Land. err is non-nil only for a hard failure (unreadable template, a git/gh command failing); "nothing changed" is a normal, successful Outcome with Changed=false.
Types ¶
type Action ¶
type Action int
Action describes what a template-section recipe did (or would do) to its target file.
type Config ¶
Config is the parsed wb.yaml.
func LoadConfig ¶
LoadConfig reads, parses, and validates the recipe config at path.
type Preview ¶
Preview is what dry-run mode reports for one repo.
func Evaluate ¶
Evaluate previews what r would do to repoPath without mutating anything.
For a template-section recipe, this fetches and inspects the target file at origin/<default-branch> — matching what Land will actually work from (a fresh worktree off the default branch), not any local uncommitted state. For a command recipe, DryRunCommand (if set) runs directly against repoPath's current local working tree, mirroring how a linter is normally invoked.
type Recipe ¶
type Recipe struct {
Name string `yaml:"-"` // set from the config map key, not the YAML body
Type Kind `yaml:"type"`
AppliesIf string `yaml:"applies_if"`
// template-section fields
Target string `yaml:"target"`
Template string `yaml:"template"`
Marker string `yaml:"marker"`
// command fields
Command string `yaml:"command"`
DryRunCommand string `yaml:"dry_run_command"`
CountRegex string `yaml:"count_regex"`
// landing fields (shared, all optional — defaulted from Name)
CommitMessage string `yaml:"commit_message"`
PRBranch string `yaml:"pr_branch"`
PRTitle string `yaml:"pr_title"`
PRBody string `yaml:"pr_body"`
}
Recipe describes one fleet-wide operation, as configured in wb.yaml.