Documentation
¶
Overview ¶
Package planio implements portable plan export and import for sharing cloop plans between teams without requiring git access. Supported formats: yaml, json, toml.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectFormat ¶
DetectFormat infers the serialization format from the file extension. Returns "yaml", "json", or "toml". Returns "" when the extension is unknown.
Types ¶
type ImportResult ¶
type ImportResult struct {
Plan *pm.Plan
Added int // tasks appended (merge mode only)
Skipped int // tasks skipped because they already existed (merge mode only)
Replaced int // tasks in the new plan (replace mode only)
}
ImportResult carries the imported plan along with diagnostic counters.
func Import ¶
func Import(filePath string, format string, existing *pm.Plan, mode MergeMode) (*ImportResult, error)
Import reads a plan file from filePath, validates it, and merges or replaces the existing plan according to mode. existing may be nil when there is no current plan (replace always succeeds; merge with a nil existing plan treats every imported task as new).
type LinkFile ¶ added in v0.0.5
type LinkFile struct {
URL string `json:"url" yaml:"url" toml:"url"`
Label string `json:"label,omitempty" yaml:"label,omitempty" toml:"label,omitempty"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty" toml:"kind,omitempty"`
}
LinkFile is the portable representation of a task link. pm.Link is tagged for JSON only, and TOML would otherwise spell its keys URL, Label and Kind.
type PlanFile ¶
type PlanFile struct {
SchemaVersion string `json:"schema_version" yaml:"schema_version" toml:"schema_version"`
ExportedAt string `json:"exported_at" yaml:"exported_at" toml:"exported_at"`
Goal string `json:"goal" yaml:"goal" toml:"goal"`
Tasks []TaskFile `json:"tasks" yaml:"tasks" toml:"tasks"`
}
PlanFile is the portable interchange representation of a plan. It uses string tags across all three serialization formats so that exported files are human-readable and round-trip cleanly.
type TaskFile ¶
type TaskFile struct {
ID int `json:"id" yaml:"id" toml:"id"`
Title string `json:"title" yaml:"title" toml:"title"`
Description string `json:"description,omitempty" yaml:"description,omitempty" toml:"description,omitempty"`
Priority int `json:"priority" yaml:"priority" toml:"priority"`
Status string `json:"status" yaml:"status" toml:"status"`
Role string `json:"role,omitempty" yaml:"role,omitempty" toml:"role,omitempty"`
DependsOn []int `json:"depends_on,omitempty" yaml:"depends_on,omitempty" toml:"depends_on,omitempty"`
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty" toml:"tags,omitempty"`
EstimatedMinutes int `json:"estimated_minutes,omitempty" yaml:"estimated_minutes,omitempty" toml:"estimated_minutes,omitempty"`
Assignee string `json:"assignee,omitempty" yaml:"assignee,omitempty" toml:"assignee,omitempty"`
Deadline string `json:"deadline,omitempty" yaml:"deadline,omitempty" toml:"deadline,omitempty"`
Condition string `json:"condition,omitempty" yaml:"condition,omitempty" toml:"condition,omitempty"`
Recurrence string `json:"recurrence,omitempty" yaml:"recurrence,omitempty" toml:"recurrence,omitempty"`
RequiresApproval bool `json:"requires_approval,omitempty" yaml:"requires_approval,omitempty" toml:"requires_approval,omitempty"`
MaxMinutes int `json:"max_minutes,omitempty" yaml:"max_minutes,omitempty" toml:"max_minutes,omitempty"`
ExternalURL string `json:"external_url,omitempty" yaml:"external_url,omitempty" toml:"external_url,omitempty"`
Result string `json:"result,omitempty" yaml:"result,omitempty" toml:"result,omitempty"`
// The fields statedb began storing in Task 20361. A plan exported before
// then simply lacks them, and imports as it always did.
Links []LinkFile `json:"links,omitempty" yaml:"links,omitempty" toml:"links,omitempty"`
SprintID int `json:"sprint_id,omitempty" yaml:"sprint_id,omitempty" toml:"sprint_id,omitempty"`
ComplexitySize string `json:"complexity_size,omitempty" yaml:"complexity_size,omitempty" toml:"complexity_size,omitempty"`
StoryPoints int `json:"story_points,omitempty" yaml:"story_points,omitempty" toml:"story_points,omitempty"`
OnSuccess []string `json:"on_success,omitempty" yaml:"on_success,omitempty" toml:"on_success,omitempty"`
OnFailure []string `json:"on_failure,omitempty" yaml:"on_failure,omitempty" toml:"on_failure,omitempty"`
RiskScore int `json:"risk_score,omitempty" yaml:"risk_score,omitempty" toml:"risk_score,omitempty"`
ImpactScore int `json:"impact_score,omitempty" yaml:"impact_score,omitempty" toml:"impact_score,omitempty"`
RetryBudget int `json:"retry_budget,omitempty" yaml:"retry_budget,omitempty" toml:"retry_budget,omitempty"`
TDDStatus string `json:"tdd_status,omitempty" yaml:"tdd_status,omitempty" toml:"tdd_status,omitempty"`
TDDScore int `json:"tdd_score,omitempty" yaml:"tdd_score,omitempty" toml:"tdd_score,omitempty"`
}
TaskFile is the portable representation of a single task. Only fields that are meaningful for interchange are included. Runtime-only fields (artifact paths, heal counters, internal state) are omitted.