| index b790d6ce..20a32c0e 100644 |
| --- a/internal/wire/tasks.go |
| +++ b/internal/wire/tasks.go |
| @@ -166,6 +166,13 @@ type Attachment struct { |
| Kind string `json:"kind"` |
| Ref string `json:"ref"` |
| Name string `json:"name"` |
| + // For a repository, from the runner's index: its default branch and |
| + // that branch's newest commit (SHA, subject, time); empty until the |
| + // index has read it. |
| + DefaultBranch string `json:"default_branch"` |
| + HeadSHA string `json:"head_sha"` |
| + HeadSubject string `json:"head_subject"` |
| + HeadAt *time.Time `json:"head_at"` |
| } |
| |
| // AttachmentRepo is a repository attachment. |
| @@ -243,6 +250,10 @@ type Step struct { |
| Into string `json:"into"` |
| Strategy string `json:"strategy"` |
| WithoutChecks bool `json:"without_checks"` |
| + // Activity is what the specialist did most recently in this attempt, |
| + // oldest first, at most MaxStepActivity lines; empty until the runner |
| + // reports any. It stays after the step ends (its last lines). |
| + Activity []ActivityLine `json:"activity"` |
| } |
| |
| // Task is one piece of work under a project. Branch is the task's own |
| @@ -290,6 +301,118 @@ type Task struct { |
| // Reports counts the person's reports attached to this task after it |
| // was recorded (the same problem reported again). |
| Reports int `json:"reports"` |
| + // CreatorName is the creator's display name (from the address until |
| + // people have profiles). |
| + CreatorName string `json:"creator_name"` |
| + // SourceMessageID is the person's message the task was noted from |
| + // (in the creator's conversation) and SourceAt its time; empty and |
| + // null when no message is known. |
| + SourceMessageID string `json:"source_message_id"` |
| + SourceAt *time.Time `json:"source_at"` |
| + // DuplicateOf is an open task in the same project that reads like this |
| + // one, when the coordinator recorded it anyway; null otherwise. A task |
| + // folded into another (POST /tasks/{id}/duplicate) is cancelled with |
| + // DuplicateOf naming where it went. |
| + DuplicateOf *TaskRef `json:"duplicate_of"` |
| + // Coordinator is what the coordinator is doing on the task right now |
| + // (looking into it, merging it); null when nothing. |
| + Coordinator *TaskActivity `json:"coordinator"` |
| +} |
| + |
| +// TaskRef names another task. |
| +type TaskRef struct { |
| + ID string `json:"id"` |
| + Title string `json:"title"` |
| + Stage string `json:"stage"` |
| +} |
| + |
| +// TaskActivity is the coordinator at work on a task: Kind is |
| +// CoordinatorLooking (its turn that noted the task is still running) or |
| +// CoordinatorMerging (the merge step), since Since. |
| +type TaskActivity struct { |
| + Kind string `json:"kind"` |
| + Since time.Time `json:"since"` |
| +} |
| + |
| +// Coordinator activities on a task. |
| +const ( |
| + CoordinatorLooking = "looking" |
| + CoordinatorMerging = "merging" |
| +) |
| + |
| +// ActivityLine is one thing a specialist started during a step: Kind is |
| +// an Activity* constant and Subject the file (repository-relative) or the |
| +// command's first line, clipped; At is when the runner saw it. |
| +type ActivityLine struct { |
| + Kind string `json:"kind"` |
| + Subject string `json:"subject"` |
| + At time.Time `json:"at"` |
| +} |
| + |
| +// Step activity kinds. |
| +const ( |
| + ActivityRead = "read" |
| + ActivitySearch = "search" |
| + ActivityEdit = "edit" |
| + ActivityRun = "run" |
| + ActivityOther = "other" |
| +) |
| + |
| +// MaxStepActivity is how many activity lines a step keeps; |
| +// MaxActivitySubject bounds a line's subject. |
| +const ( |
| + MaxStepActivity = 5 |
| + MaxActivitySubject = 160 |
| +) |
| + |
| +// FrameStepActivity reports what a running step's specialist started |
| +// (runner to instance, not durable: a lost line is only a lost line). |
| +const FrameStepActivity = "step_activity" |
| + |
| +// StepActivityReport is one activity line of a running step attempt. |
| +type StepActivityReport struct { |
| + TaskID string `json:"task_id"` |
| + StepID string `json:"step_id"` |
| + Attempt int64 `json:"attempt"` |
| + Kind string `json:"kind"` |
| + Subject string `json:"subject"` |
| +} |
| + |
| +// StepActivity is the activity event's data for resource "step": the |
| +// step's newest lines, oldest first. |
| +type StepActivity struct { |
| + TaskID string `json:"task_id"` |
| + StepID string `json:"step_id"` |
| + Attempt int64 `json:"attempt"` |
| + Activity []ActivityLine `json:"activity"` |
| +} |
| + |
| +// ResourceStep is the activity event's resource for a step. |
| +const ResourceStep = "step" |
| + |
| +// MarkDuplicate is the body of POST /api/v1/tasks/{id}/duplicate: the |
| +// task's creator folds it into Of, an open task in the same project. The |
| +// task is cancelled (its running step stopped first) and its brief goes |
| +// on Of's thread as a report. |
| +type MarkDuplicate struct { |
| + Of string `json:"of"` |
| +} |
| + |
| +// PersonRef is a team member as screens show them: the address, a |
| +// display name and initials for an avatar. |
| +type PersonRef struct { |
| + Address string `json:"address"` |
| + Name string `json:"name"` |
| + Initials string `json:"initials"` |
| +} |
| + |
| +// ProjectChecks says whether the project's checks can run on the team's |
| +// runner: Here with the Gate that runs, or not with Reason (a checks |
| +// reason such as needs_macos, or none when no gate was found). |
| +type ProjectChecks struct { |
| + Here bool `json:"here"` |
| + Gate string `json:"gate"` |
| + Reason string `json:"reason"` |
| } |
| |
| // Merged is how Equipo merged a task: SHA on Into, with Strategy; |