Skip to content

[Flaky Test Fixer] Let the agent read Buildkite artifacts#271916

Merged
csr merged 8 commits into
elastic:mainfrom
csr:failed-test-investigator-minor-tweaks
Jun 1, 2026
Merged

[Flaky Test Fixer] Let the agent read Buildkite artifacts#271916
csr merged 8 commits into
elastic:mainfrom
csr:failed-test-investigator-minor-tweaks

Conversation

@csr
Copy link
Copy Markdown
Member

@csr csr commented May 29, 2026

This PR equips the Failed Test Investigator workflow with a bk CLI and a repository-provided Buildkite token so it can read failure screenshots, DOM snapshots, or kibana.log from the failing build. We also tighten the comment format for an improved reading experience.

All changes were tested with the gh aw trial command using a sample GitHub issue. Sample command:

gh aw trial ./.github/workflows/failed-test-investigator.md \
  --logical-repo elastic/kibana \
  --trigger-context https://github.com/elastic/kibana/issues/271915

@csr csr self-assigned this May 29, 2026
- defaults
- buildkite.com
- '*.buildkite.com'
- buildkiteartifacts.com
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Whitelist buildkiteartifacts.com so the agent can download the test failure screenshot (when available). I'd get a 403 error otherwise.

env:
BK_VERSION: 3.44.0
BK_SHA256: 88867c0b983ad2afe1efc26f0df6b46b5673577c1aea95eba76992636fb9abe9
OPS_BUILDKITE_TOKEN: ${{ secrets.OPS_BUILDKITE_TOKEN }}
Copy link
Copy Markdown
Member Author

@csr csr May 29, 2026

Choose a reason for hiding this comment

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

Interact with Buildkite via the bk CLI and using the OPS_BUILDKITE_TOKEN token stored in Kibana's repository secrets.

## Comment format

Post exactly one comment. Keep the visible portion very short and easy to read:
Post exactly one comment on the issue. Keep it concise, actionable, and prioritize the most critical findings at the very top. Adapt the sections below to best fit the specific failure. **Use `####` for all subsections** (e.g., `#### Proposed Fix`, `#### Root Cause`).
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Improve the comment formatting to make reading the investigations easier.

@csr csr changed the title [Flaky Test Fixer] Pass OPS_BUILDKITE_TOKEN to workflow, improve comment format [Flaky Test Fixer] Let the agent read Buildkite artifacts May 29, 2026
@csr csr added backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes labels May 29, 2026
@csr csr marked this pull request as ready for review May 29, 2026 15:35
@csr csr requested review from a team as code owners May 29, 2026 15:35
Copy link
Copy Markdown
Contributor

@steliosmavro steliosmavro left a comment

Choose a reason for hiding this comment

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

flaky-test-investigator looks good!

@csr csr added the reviewer:codex PR review and comments with Codex label May 30, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Found one regression risk in the prompt-format change: the human-readable format can change, but the previously documented machine-readable findings block should remain stable for downstream consumers.

Generated by Codex Reviewer for issue #271916

Comment thread .github/workflows/failed-test-investigator.md
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Found one prompt/CLI mismatch that can break artifact listing during investigations.

Generated by Codex Reviewer for issue #271916

Comment thread .agents/skills/flaky-test-investigator/SKILL.md
@csr csr enabled auto-merge (squash) June 1, 2026 07:40
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #64 / Cloud Security Posture - Group 5 (KSPM + Flyouts) Security Alerts Page - Graph visualization expanded flyout - filter by node
  • [job] [logs] Scout Lane #14 - stateful-classic / default / local-stateful-classic - Create Data View wizard - data stream is accepted as an index pattern source and wizard auto-detects the timestamp field

Metrics [docs]

✅ unchanged

History

cc @csr

@csr csr merged commit 438073e into elastic:main Jun 1, 2026
31 checks passed
@csr csr deleted the failed-test-investigator-minor-tweaks branch June 1, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes reviewer:codex PR review and comments with Codex v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants