Skip to content

chore: condense the output of preflight runs#823

Merged
mcncl merged 2 commits into
mainfrom
TE-5535/condensed_output
Jun 1, 2026
Merged

chore: condense the output of preflight runs#823
mcncl merged 2 commits into
mainfrom
TE-5535/condensed_output

Conversation

@mcncl
Copy link
Copy Markdown
Contributor

@mcncl mcncl commented May 5, 2026

Description

preflight runs will consume a lot of tokens with the current way we report to the LLM, this attempts to fix that by reducing the information density.

Changes

  • in JSON output, only returns a payload which contains relevant information for an LLM to use in order to get information on which jobs have failed

Caveats

This is entirely open to change/improvement

Testing

  • Tests have run locally (with go test ./...)
  • Code is formatted (with go fmt ./...)

Example build_summary JSON now looks more like:

  {
    "type": "preflight_summary",
    "timestamp": "2026-04-08T12:49:28.246592+10:00",
    "preflight_id": "019d6afe-407e-742a-a532-9eaf247099c7",
    "pipeline": "buildkite/cli",
    "build_number": 185541,
    "build_url": "https://buildkite.com/buildkite/cli/builds/185541",
    "build_state": "failed",
    "failed_jobs": [
      {
        "id": "019d6afe-80b8-4f62-a0e4-8871e94b977e",
        "name": ":pipeline: Upload Pipeline",
        "command": "./.buildkite/pipeline.sh | buildkite-agent pipeline upload",
        "state": "failed",
        "exit_status": 128,
        "soft_failed": false,
        "retried": false
      }
    ],
    "duration_ns": 27448501500
  }

For a live job_failure event:

  {
    "type": "job_failure",
    "timestamp": "2026-04-08T12:49:27.390000+10:00",
    "preflight_id": "019d6afe-407e-742a-a532-9eaf247099c7",
    "pipeline": "buildkite/cli",
    "build_number": 185541,
    "build_url": "https://buildkite.com/buildkite/cli/builds/185541",
    "job": {
      "id": "019d6afe-80b8-4f62-a0e4-8871e94b977e",
      "name": ":pipeline: Upload Pipeline",
      "command": "./.buildkite/pipeline.sh | buildkite-agent pipeline upload",
      "state": "failed",
      "exit_status": 128,
      "soft_failed": false,
      "retried": false
    }
  }

Disclosures / Credits

Written by Codex. YOLO acceped by me.

@mcncl mcncl requested review from a team as code owners May 5, 2026 05:24
@matthewborden matthewborden force-pushed the TE-5535/condensed_output branch from 3feedb2 to 9c642c3 Compare June 1, 2026 03:20
Comment thread cmd/preflight/event.go Outdated
Comment on lines +19 to +20
EventBuildSummary EventType = "build_summary"
EventBuildSummary EventType = "preflight_summary"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a breaking change, and I think this is referenced in the Preflight skill. https://github.com/buildkite/skills/blob/main/skills/buildkite-preflight/SKILL.md#reading-the-result

@mcncl mcncl force-pushed the TE-5535/condensed_output branch from 804aa4f to a670461 Compare June 1, 2026 05:15
@mcncl mcncl merged commit ab45636 into main Jun 1, 2026
3 checks passed
@mcncl mcncl deleted the TE-5535/condensed_output branch June 1, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants