pull

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

mig_pull.go implements the `ploy mig pull` subcommand for pulling Migs diffs into the current git worktree based on mig project context.

Command structure:

ploy mig pull [--origin <remote>] [--dry-run] [--last-failed | --last-succeeded] [<mig-name|id>]

Behavior:

  • If <mig-name|id> is provided, use it to select the mig.
  • If <mig-name|id> is omitted, infer the mig from the current repo: Call GET /v1/migs?repo_url=<current_repo_url>&archived=false If exactly one mig matches: use it. If multiple migs match: error with list of matching migs.
  • Uses POST /v1/migs/{mig_id}/pull to resolve the run and repo.
  • Pulls diffs via GET /v1/runs/{run_id}/diffs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleMigPull

func HandleMigPull(args []string, stderr io.Writer) error

HandleMigPull implements `ploy mig pull [--origin <remote>] [--dry-run] [--last-failed] [<mig-id|name>]`. Parses CLI flags, validates arguments, enforces git worktree preconditions, and resolves the mig + run.

The command:

  • Must be executed from inside a git repository
  • Derives repo identity from git remote URL (origin by default)
  • Optionally accepts a mig ID/name; if omitted, infers from current repo
  • Uses POST /v1/migs/{mig_id}/pull to resolve run execution identifiers
  • Pulls diffs via GET /v1/runs/{run_id}/diffs

Arguments:

  • args: remaining arguments after "pull" has been stripped
  • stderr: writer for user-facing output and error messages

Returns an error if argument parsing fails, preconditions are not met, mig/run resolution fails, or git/API operations fail.

func ListRunDiffs

func ListRunDiffs(ctx context.Context, httpClient *http.Client, baseURL *url.URL, runID domaintypes.RunID, repoID domaintypes.RepoID) ([]migs.DiffEntry, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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