Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
627 changes: 620 additions & 7 deletions docs/api/openapi.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/incidents/pl_plan_follows_the_work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pl. `pl_plan_follows_the_work`

**What happened:** Two plans read wrong for weeks. In the first, a person approved one of three draft tasks from its row, as the page suggested. The worker filed its ticket, marked the task done and, with no task waiting on another, marked the plan done. The page hid the Approve buttons once a plan was not a draft, so the other two tasks stayed drafts with no way to start them, under a plan that said Done. In the second, all four tasks were filed and read done, and so did the plan, while one pull request merged, one closed unmerged, one run failed with no pull request, and one task took eleven runs and seven pull requests (about $130) without merging. No run or pull request was ever written back to a task.

**The guarantee:** A task's state is derived from the runs of its ticket and their pull requests, never from filing the ticket (`common::plan_state`): Draft, Queued, Working, Needs you, Failed (with its reason), In review, Merged or Dropped. The plan's state comes from its tasks, and it is Done only when every task merged or was dropped. A refresh (`common::plan_sync`) links each run to its plan and task and writes the states; it runs on every run status change, on pull request events, on approval and on the plan page, and the plans list refreshes plans written before it (the backfill). Approving one task never ends the plan: the drafts left are listed as something a person has to approve or drop.
2 changes: 2 additions & 0 deletions services/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ pub mod paged;
pub mod placeholders;
/// Which waiting plan tasks a merged run releases.
pub mod plan_dependents;
pub mod plan_state;
pub mod plan_sync;
/// Every body CoderHelm sends GitHub fits GitHub's limit.
pub mod pr_body;
pub mod pr_body_fit;
Expand Down
Loading
Loading