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 ¶
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 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.