Skip to content

DX: Preflight Builds — snapshot working tree, push, trigger CI, watch results #72

Description

@alexhraber

Problem

The Buildkite CLI has an experimental bk preflight run command that snapshots your working tree (including unstaged/untracked changes), pushes to a temporary branch, triggers a CI build, and watches results — all before you commit. builddeck has no equivalent, meaning you have to context-switch to the CLI for this workflow.

Proposed Feature

A Preflight overlay (keybinding: ctrl+p or P) that:

  1. Detects the local git repo (reads .git from CWD or a configurable path)
  2. Shows a diff summary of uncommitted changes (files changed, insertions/deletions)
  3. Offers to snapshot, push, and trigger a CI build on the selected pipeline
  4. Watches the preflight build live in the existing TUI polling loop, with a special indicator ("PREFLIGHT" badge)
  5. Cleans up the temp branch and optionally cancels the build on close

UX Flow

┌──────────────────────────────────────┐
│  ⚡ Preflight Build                    │
│                                       │
│  Working tree (2 files changed):      │
│  ┌───────────────────────────────┐    │
│  │ M src/handler.go  (+42 -12)   │    │
│  │ M tests/handler_test.go       │    │
│  │   (+8 -0)                     │    │
│  └───────────────────────────────┘    │
│                                       │
│  Target pipeline: my-pipeline         │
│  Branch:        preflight/<timestamp> │
│                                       │
│  [Cancel]  [Snap & Run]              │
└──────────────────────────────────────┘

Why this fits a TUI

  • This is the CLI's most unique capability — bringing it into the TUI makes the TUI the one-stop CI control center
  • The TUI already excels at watching build progress; preflight is a natural extension
  • Engineers can fire off a preflight check without leaving their terminal dashboard
  • Visual diff summary + live build watch is more informative than CLI output

Requirements

  • Git repo detection: scan CWD, BUILDKITE_REPO env var, or ~/.config/builddeck/repo-path config
  • Branch naming: preflight/builddeck-<timestamp>-<short-sha>
  • Push requires remote git credentials (assume they are configured)
  • Pipeline resolution: use current selected pipeline, or prompt
  • Cleanup on close: delete remote branch, optionally cancel build

Risk

  • Git push failure: if remote is unreachable or credentials missing, show clear error
  • Long-running branch accumulation: cleanup must be reliable; optionally add cleanup command equivalent

References

  • bk preflight run in buildkite/cli
  • Preflight code maps repo/snapshot/git operations

Acceptance

  • Preflight overlay opens with ctrl+p or P
  • Shows unstaged/staged/untracked file summary
  • Pre-fills pipeline from current selection
  • Creates snapshot branch, pushes, triggers build
  • Build is watched live in TUI with PREFLIGHT badge
  • Cleanup on exit or manual close

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions