Documentation
¶
Index ¶
- Variables
- func ColoredStatusGlyph(status string, spinnerFrame int) string
- func DeriveRunStateFromReport(report RunStatusReport) migsapi.RunState
- func FormatDurationCompact(durationMs int64) string
- func FormatDurationForStatus(status string, durationMs int64, startedAt, finishedAt *time.Time, ...) string
- func FormatDurationMsOrElapsed(durationMs int64, startedAt, finishedAt *time.Time, now time.Time) string
- func FormatErrorOneLiner(lastErr *string) string
- func FormatNodeID(nodeID *domaintypes.NodeID) string
- func RenderFollowFrameText(frame FollowFrame) (string, int)
- func RenderRunSBOM(w io.Writer, result RunSBOMResult) error
- func RenderRunStatusReportJSON(w io.Writer, report RunStatusReport) error
- func RenderRunStatusReportText(w io.Writer, report RunStatusReport, opts TextRenderOptions) error
- func RenderRunStatusSnapshotText(w io.Writer, report RunStatusReport, opts TextRenderOptions) error
- func RenderSBOMDiff(w io.Writer, packages []migsapi.RunSBOMDiffPackage) error
- func StatusGlyph(status string, spinnerFrame int) string
- type CancelCommand
- type FollowDynamicSection
- type FollowFrame
- type FollowFrameRender
- type FollowRepoFrame
- type FollowRunCommand
- type FollowStepRow
- type GetRunSBOMCommand
- type GetRunStatusReportCommand
- type GetStatusCommand
- type ListRunDiffsCommand
- type ListRunDiffsResult
- type ListRunJobsCommand
- type ListRunJobsResult
- type RestartCommand
- type RunDiffEntry
- type RunDiffsCommand
- type RunEntry
- type RunJobArtifact
- type RunJobDetailEntry
- type RunJobEntry
- type RunJobIOPreview
- type RunSBOMResult
- type RunStatusReport
- type RunStatusReportDynamicSection
- type RunStatusReportTextLayout
- type TextRenderOptions
Constants ¶
This section is empty.
Variables ¶
var SpinnerFrames = []string{"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"}
SpinnerFrames defines deterministic spinner glyph order for running states.
Functions ¶
func ColoredStatusGlyph ¶
ColoredStatusGlyph returns status glyphs with semantic colors.
func DeriveRunStateFromReport ¶
func DeriveRunStateFromReport(report RunStatusReport) migsapi.RunState
DeriveRunStateFromReport computes terminal run state from repo statuses.
func FormatDurationCompact ¶
FormatDurationCompact renders duration_ms in status-report compact form.
func FormatDurationForStatus ¶
func FormatDurationForStatus(status string, durationMs int64, startedAt, finishedAt *time.Time, now time.Time) string
FormatDurationForStatus renders status-aware duration text. Terminal jobs are always rendered in seconds; non-terminal jobs keep millisecond-or-elapsed behavior.
func FormatDurationMsOrElapsed ¶
func FormatDurationMsOrElapsed(durationMs int64, startedAt, finishedAt *time.Time, now time.Time) string
FormatDurationMsOrElapsed renders duration for follow-mode rows. It prefers duration_ms; otherwise falls back to timestamps.
func FormatErrorOneLiner ¶
FormatErrorOneLiner normalizes a multi-line error to a single readable line.
func FormatNodeID ¶
func FormatNodeID(nodeID *domaintypes.NodeID) string
FormatNodeID renders node ID values with the shared placeholder semantics.
func RenderFollowFrameText ¶
func RenderFollowFrameText(frame FollowFrame) (string, int)
RenderFollowFrameText renders a reusable follow-style text frame and line count.
func RenderRunSBOM ¶
func RenderRunSBOM(w io.Writer, result RunSBOMResult) error
func RenderRunStatusReportJSON ¶
func RenderRunStatusReportJSON(w io.Writer, report RunStatusReport) error
RenderRunStatusReportJSON renders the canonical run status report payload as JSON.
func RenderRunStatusReportText ¶
func RenderRunStatusReportText(w io.Writer, report RunStatusReport, opts TextRenderOptions) error
RenderRunStatusReportText renders a one-shot, follow-style run snapshot.
func RenderRunStatusSnapshotText ¶
func RenderRunStatusSnapshotText(w io.Writer, report RunStatusReport, opts TextRenderOptions) error
RenderRunStatusSnapshotText renders a static status snapshot using the same output shape as `ploy run status`.
func RenderSBOMDiff ¶
func RenderSBOMDiff(w io.Writer, packages []migsapi.RunSBOMDiffPackage) error
func StatusGlyph ¶
StatusGlyph maps a status to a deterministic display glyph.
Types ¶
type CancelCommand ¶
type CancelCommand struct {
Client *http.Client
BaseURL *url.URL
RunID domaintypes.RunID
Reason string
Output io.Writer
}
CancelCommand requests cancellation for a run.
type FollowDynamicSection ¶
FollowDynamicSection describes one mutable line block in a rendered follow frame.
type FollowFrame ¶
type FollowFrame struct {
Repos []FollowRepoFrame
}
FollowFrame is a reusable follow-style text frame.
type FollowFrameRender ¶
type FollowFrameRender struct {
Text string
LineCount int
Sections []FollowDynamicSection
}
FollowFrameRender is the rendered follow frame with dynamic section metadata.
func RenderFollowFrameTextLayout ¶
func RenderFollowFrameTextLayout(frame FollowFrame) FollowFrameRender
RenderFollowFrameTextLayout renders a follow frame plus per-repo dynamic section metadata.
type FollowRepoFrame ¶
type FollowRepoFrame struct {
HeaderLine string
Columns []string
Rows []FollowStepRow
EmptyLine string
}
FollowRepoFrame is one repo block inside a follow-style frame.
type FollowRunCommand ¶
type FollowRunCommand struct {
Client *http.Client
BaseURL *url.URL
RunID domaintypes.RunID
Output io.Writer
EnableOSC8 bool
AuthToken string
SpecDisplayName string
MaxRetries int
PollInterval time.Duration
}
FollowRunCommand drives `run --follow` rendering with Bubble Tea v2.
type FollowStepRow ¶
FollowStepRow is one row in a repo table, with optional second-line summary.
type GetRunSBOMCommand ¶
type GetRunSBOMCommand struct {
Client *http.Client
BaseURL *url.URL
RunID domaintypes.RunID
View string
}
func (GetRunSBOMCommand) Run ¶
func (c GetRunSBOMCommand) Run(ctx context.Context) (RunSBOMResult, error)
type GetRunStatusReportCommand ¶
type GetRunStatusReportCommand struct {
Client *http.Client
BaseURL *url.URL
RunID domaintypes.RunID
}
GetRunStatusReportCommand builds the canonical RunStatusReport payload for a run.
func (GetRunStatusReportCommand) Run ¶
func (c GetRunStatusReportCommand) Run(ctx context.Context) (RunStatusReport, error)
Run assembles run summary, mig identity, run job rows, and links.
type GetStatusCommand ¶
GetStatusCommand retrieves detailed status for a single run using the run summary view (ID, repo refs, repo counts).
func (GetStatusCommand) Run ¶
func (c GetStatusCommand) Run(ctx context.Context) (domaintypes.RunSummary, error)
Run executes GET /v1/runs/{id} and returns the run domaintypes.RunSummary.
type ListRunDiffsCommand ¶
ListRunDiffsCommand fetches the diff listing for a run. It returns structured data suitable for machine consumption (e.g., TUI).
func (ListRunDiffsCommand) Run ¶
func (c ListRunDiffsCommand) Run(ctx context.Context) (ListRunDiffsResult, error)
Run executes GET /v1/runs/{run_id}/diffs and returns structured diffs.
type ListRunDiffsResult ¶
type ListRunDiffsResult struct {
Diffs []RunDiffEntry
}
ListRunDiffsResult is the response from ListRunDiffsCommand.
type ListRunJobsCommand ¶
type ListRunJobsCommand struct {
Client *http.Client
BaseURL *url.URL
RunID domaintypes.RunID
Attempt *int32 // Optional: specific attempt
}
ListRunJobsCommand fetches jobs for a run execution.
func (ListRunJobsCommand) Run ¶
func (c ListRunJobsCommand) Run(ctx context.Context) (ListRunJobsResult, error)
Run executes GET /v1/runs/{run_id}/jobs.
type ListRunJobsResult ¶
type ListRunJobsResult = migsapi.ListRunJobsResponse
ListRunJobsResult contains the response from listing run jobs.
type RestartCommand ¶
RestartCommand requests a new attempt for a terminal run.
func (RestartCommand) Run ¶
func (c RestartCommand) Run(ctx context.Context) (domaintypes.RunSummary, error)
type RunDiffEntry ¶
type RunDiffEntry struct {
ID domaintypes.DiffID `json:"id"`
JobID domaintypes.JobID `json:"job_id"`
CreatedAt time.Time `json:"created_at"`
Size int `json:"gzipped_size"`
Summary domaintypes.DiffSummary `json:"summary,omitempty"`
}
RunDiffEntry is a single diff item from the run diffs listing.
type RunDiffsCommand ¶
type RunDiffsCommand struct {
Client *http.Client
BaseURL *url.URL
RunID domaintypes.RunID // Run ID (KSUID-backed)
Output io.Writer
Download bool // when true, download newest diff and print to stdout (gunzipped)
SavePath string // optional path to save the gunzipped patch
}
RunDiffsCommand lists diffs for a specific run and optionally downloads the newest patch.
type RunEntry ¶
type RunEntry struct {
RepoID domaintypes.RepoID `json:"repo_id"`
RepoURL string `json:"repo_url"`
BaseRef string `json:"base_ref"`
SourceCommitSHA string `json:"source_commit_sha,omitempty"`
Attempt int32 `json:"attempt"`
Status domaintypes.RunStatus `json:"status"`
LastError *string `json:"last_error,omitempty"`
PatchURL string `json:"patch_url,omitempty"`
Jobs []RunJobEntry `json:"jobs"`
}
RunEntry captures repo-level status, job graph data, and report links for a single repo attempt.
type RunJobArtifact ¶
type RunJobArtifact struct {
Name string `json:"name"`
CID string `json:"cid"`
LookupURL string `json:"lookup_url,omitempty"`
}
RunJobArtifact is the per-job artifact view emitted by run status JSON. It includes the CID plus a lookup URL that resolves artifact bundle metadata.
type RunJobDetailEntry ¶
type RunJobEntry ¶
type RunJobEntry struct {
JobID domaintypes.JobID `json:"job_id"`
JobType domaintypes.JobType `json:"job_type"`
JobImage string `json:"job_image"`
NodeID *domaintypes.NodeID `json:"node_id,omitempty"`
Status domaintypes.JobStatus `json:"status"`
ExitCode *int32 `json:"exit_code,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
DurationMs int64 `json:"duration_ms"`
DisplayName string `json:"display_name,omitempty"`
BugSummary string `json:"bug_summary,omitempty"`
Artifacts []RunJobArtifact `json:"artifacts,omitempty"`
JobLogURL string `json:"job_log_url,omitempty"`
PatchURL string `json:"patch_url,omitempty"`
}
RunJobEntry is one row in the follow-style job graph.
type RunJobIOPreview ¶
RunJobIOPreview contains bounded stdout/stderr previews for a single job.
type RunSBOMResult ¶
type RunSBOMResult struct {
RunID domaintypes.RunID
View string
Packages []migsapi.RunSBOMPackage
DiffPackages []migsapi.RunSBOMDiffPackage
}
type RunStatusReport ¶
type RunStatusReport struct {
RunID domaintypes.RunID `json:"run_id"`
MigID domaintypes.MigID `json:"mig_id"`
MigName string `json:"mig_name"`
SpecID domaintypes.SpecID `json:"spec_id"`
Repos []RunEntry `json:"repos"`
WaitingRuns int `json:"waiting_runs,omitempty"`
SBOMDiff []migsapi.RunSBOMDiffPackage `json:"sbom_diff,omitempty"`
}
RunStatusReport is the canonical status report contract shared by all status renderers.
type RunStatusReportDynamicSection ¶
RunStatusReportDynamicSection represents one mutable block of lines in rendered run text.
type RunStatusReportTextLayout ¶
type RunStatusReportTextLayout struct {
Text string
LineCount int
DynamicSections []RunStatusReportDynamicSection
}
RunStatusReportTextLayout is a rendered run status report with per-repo mutable sections.
func RenderRunStatusReportTextLayout ¶
func RenderRunStatusReportTextLayout(report RunStatusReport, opts TextRenderOptions) (RunStatusReportTextLayout, error)
RenderRunStatusReportTextLayout renders run status report text plus mutable per-repo row sections.
type TextRenderOptions ¶
type TextRenderOptions struct {
EnableOSC8 bool
AuthToken string
BaseURL *url.URL
SpinnerFrame int
LiveDurations bool
Now time.Time
JobIOPreviews map[domaintypes.JobID]RunJobIOPreview
ExpandStdout bool
ExpandStderr bool
FilterRunningRepos bool
EmptyReposLine string
SpecDisplayName string
}
TextRenderOptions controls optional features for the text report renderer.