Skip to content

[ Skill ] Adds a "Flutter PR Failure Collector" skill#185480

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
bkonyi:pr_failure_collector
Apr 28, 2026
Merged

[ Skill ] Adds a "Flutter PR Failure Collector" skill#185480
auto-submit[bot] merged 4 commits into
flutter:masterfrom
bkonyi:pr_failure_collector

Conversation

@bkonyi

@bkonyi bkonyi commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

This skill is meant to make it easier for agents to retrieve the set of build and test failures in checks on Flutter PRs without requiring it to interact directly with rendered web pages and interpret screenshots.

It uses either the gh CLI tool or GitHub HTTP APIs to retrieve the state of a PR's checks. For each failing check, the agent is instructed to construct URLs to the raw LUCI log output based on heuristics created from https://flutter.googlesource.com/recipes, as well as the various configuration files in the flutter/flutter repository (.ci.yaml, engine/src/flutter/ci/builders/<config_name>.json, etc).

Once the logs are collected, the agent scans each log thoroughly for failures and reports:

  • The name of the failing bot/check
  • Which platform the check targets
  • A summary of the failure
  • A reproduction command (if possible)

This skill has been tested against PRs with failing Flutter Tool tests and failing engine builds / tests.

This skill is meant to make it easier for agents to retrieve the set of
build and test failures in checks on Flutter PRs without requiring it to
interact directly with rendered webpages and interpret screenshots.

It uses either the `gh` CLI tool or GitHub HTTP APIs to retrieve the
state of a PR's checks. For each failing check, the agent is instructed
to construct URLs to the raw LUCI log output based on heuristics created
from https://flutter.googlesource.com/recipes, as well as the various
configuration files in the flutter/flutter repository (.ci.yaml,
engine/src/flutter/ci/builders/<config_name>.json, etc).

Once the logs are collected, the agent scans each log thoroughly for
failures and reports:

- The name of the failing bot/check
- Which platform the check targets
- A summary of the failure
- A reproduction command (if possible)

This skill has been tested against PRs with failing Flutter Tool tests
and failing engine builds / tests.
@bkonyi bkonyi requested a review from reidbaker as a code owner April 23, 2026 15:53

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a new skill documentation file, SKILL.md, which outlines the workflow for collecting and parsing Flutter PR failures from LUCI. The review feedback identifies a duplicate instruction with a formatting error and corrects the description of how LUCI log URLs are constructed for flutter_drone builders.

Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
@bkonyi

bkonyi commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

Example output from a PR with failing engine checks:

Failures on PR #185377

Check Name Platform Failure Details Reproduction Command
Linux linux_unopt Linux Build failed in ci/host_debug_unopt flutter/tools/gn --target-dir ci/host_debug_unopt --runtime-mode debug --unoptimized --prebuilt-dart-sdk --asan --dart-debug --rbe --no-goma followed by ninja -C out/ci/host_debug_unopt
Linux linux_web_engine_tests Linux Widespread failures in platform_view_test.dart and wasm loading errors flutter/lib/web_ui/dev/felt test --run --suite=chrome-dart2wasm-wimp-ui

Details from Raw Logs for Linux linux_web_engine_tests

The logs show that multiple tests failed or failed to load entirely within the chrome-dart2wasm-wimp-ui suite:

  • Failures in platform_view_test.dart:

    • platformView sandwich [E]
    • transformed platformview [E]
    • embeds interactive platform views [E]
    • clips platform views with RRects [E]
    • clips platform views with Paths [E]
    • correctly transforms platform views [E]
    • correctly offsets platform views [E]
    • correctly offsets when clip chain length is changed [E]
    • converts device pixels to logical pixels (no clips) [E]
    • converts device pixels to logical pixels (with clips) [E]
    • renders overlays on top of platform views [E]
    • correctly reuses overlays [E]
    • embeds and disposes of a platform view [E]
    • preserves the DOM node of an unrendered platform view [E]
    • does not crash when resizing the window after textures have been registered [E]
    • does not create overlays for invisible platform views [E]
    • can dispose without crashing [E]
    • optimizes overlays when pictures and platform views do not overlap [E]
    • sinks platform view under the canvas if it does not overlap with the picture [E]
    • optimizes overlays correctly with transforms and clips [E]
    • correctly places pictures in case where next picture intersects multiple elements [E]
    • can customize amount of overlays [E]
    • correctly rearranges pictures to second-to-last canvas when hitting canvas limit [E]
  • Failed to Load (Wasm Loading Errors):
    Test files failed to load with errors resembling wasm module failures in:

    • picture_test.dart [E]
    • path_metrics_test.dart [E]
    • strut_style_test.dart [E]
    • font_collection_test.dart [E]
    • gradient_golden_test.dart [E]
    • vertices_test.dart [E]
    • surface_context_lost_test.dart [E]
    • image_filter_non_invertible_matrix_test.dart [E]
    • paragraph_builder_test.dart [E]
    • codecs_test.dart [E]
    • rect_test.dart [E]
    • async_rendering_test.dart [E]
    • color_filter_golden_test.dart [E]
    • image_filter_golden_test.dart [E]
    • rsuperellipse_contains_test.dart [E]
    • text_style_test_env_test.dart [E]
    • image/html_image_element_codec_test.dart [E]
    • image_golden_test.dart [E]
    • filters_test.dart [E]
    • draw_atlas_golden_test.dart [E]
    • paint_test.dart [E]
    • paragraph_style_test.dart [E]
    • image_test.dart [E]
    • platform_view_position_test.dart [E]
    • text_test.dart [E]
    • renderer_test.dart [E]
    • fallback_fonts_golden_test.dart [E]

Details from API Summary for Linux linux_unopt

The log indicates that the build failed:

  • Failing Build: ci/host_debug_unopt
  • LUCI URL: https://cr-buildbucket.appspot.com/build/8683798212315753825

To fix the formatting error discovered in the engine repository as part of this build, you can run et format.

@bkonyi

bkonyi commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

Example output for a PR with failing analysis checks and tools tests:

Failures on PR #184685

Check Name Platform Failure Details Reproduction Command
Windows tool_tests_general Windows Tests failed in test/general.shard/convert_test.dart dart run test test/general.shard/convert_test.dart
Mac tool_tests_general Mac Tests failed in test/general.shard/convert_test.dart dart run test test/general.shard/convert_test.dart
Linux tool_tests_general Linux Tests failed in test/general.shard/convert_test.dart dart run test test/general.shard/convert_test.dart
Linux analyzer_benchmark Linux Analysis failed due to a lint issue in convert_test.dart dart analyze test/general.shard/convert_test.dart
Linux analyze Linux Analysis failed due to trailing spaces and other issues in convert_test.dart dart analyze test/general.shard/convert_test.dart; dart format test/general.shard/convert_test.dart

Details from Raw Logs

For the checks with test failures, the identical failures were located in the same file:

  • Failing File: packages/flutter_tools/test/general.shard/convert_test.dart
  • Failing Tests:
    • Decode a malformed string prints a warning but returns the decoded string
    • Decode invalid UTF-8 bytes from external source
    • Decode multiple replacement characters

For the checks with analysis failures:

  • Linux analyzer_benchmark:
    • Found 1 issue: info • Omit the type annotation on a local variable when the type is obvious. Try removing the type annotation at line 160 in packages/flutter_tools/test/general.shard/convert_test.dart.
  • Linux analyze:
    • Found trailing space characters in packages/flutter_tools/test/general.shard/convert_test.dart at lines 164 and 183.
    • Also reported: Dart analyzer failed when --watch was used.

Reproduction Command

To reproduce the failures locally, navigate to the packages/flutter_tools directory and run the appropriate command:

  • To run tests:
    dart run test test/general.shard/convert_test.dart
  • To run analysis and check formatting:
    dart analyze test/general.shard/convert_test.dart; dart format test/general.shard/convert_test.dart

@bkonyi bkonyi added the CICD Run CI/CD label Apr 23, 2026
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated
Comment thread .agents/skills/flutter-pr-failure-collector/SKILL.md Outdated

@reidbaker reidbaker left a comment

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.

Dont forget to add yourself as CODEOWNER

- **TIP**: You can often access the raw logs directly by appending `?format=raw` to the log URL.
Example: `https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/<Build ID>/+/u/<Step Name>/stdout?format=raw`
- **NOTE**: Step names can be very specific and hard to guess.
- For builders using the **`flutter_drone`** recipe (check `.ci.yaml`), the step name usually follows the pattern: `run test.dart for <shard> shard and subshard <subshard>`. In the raw log URL, spaces are replaced by underscores. If `subshard` is not specified, it defaults to `None`. Example: For `Linux analyze` (which has `shard: analyze` and no `subshard`), the URL step name becomes `run_test.dart_for_analyze_shard_and_subshard_None`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

I think this is strong evidence that going from github pr to logs is a "primitive" that should probably be its own entity. I say not entity not skill because we can probably author a script for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That looks like it could be a useful input to this skill, but we'll still need these extra steps to be able to lookup the logs from LUCI.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think she's working on a draft to move it into the repo here #185084

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this is strong evidence that going from github pr to logs is a "primitive" that should probably be its own entity. I say not entity not skill because we can probably author a script for it.

I'm not sure this is something that we can create a useful script for, mostly because the LUCI APIs require authentication to use, so manually building the URL is the easiest way to retrieve the logs. When prompted to create a script for this, Gemini gave me this:

import 'dart:io';

void main(List<String> args) {
  if (args.length < 2) {
    print('Usage: dart build_luci_url.dart <Build_ID_or_Details_URL> <Step_Name>');
    exit(1);
  }

  String buildIdentifier = args[0];
  String stepName = args[1];

  // Extract Build ID if a full URL was passed
  String buildId = buildIdentifier;
  if (buildIdentifier.startsWith('http')) {
    final uri = Uri.parse(buildIdentifier);
    buildId = uri.pathSegments.last;
  }

  // Transform step name: spaces to underscores
  String formattedStepName = stepName.replaceAll(' ', '_');

  // Construct the URL
  String url = 'https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/$buildId/+/u/$formattedStepName/stdout?format=raw';

  print(url);
}

It's extremely trivial and most of the complicated work is still being done by the agent to determine the build ID and step name, so I'm not sure it's worth including.

@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 23, 2026
@bkonyi bkonyi added the CICD Run CI/CD label Apr 23, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 23, 2026
@bkonyi bkonyi added the CICD Run CI/CD label Apr 23, 2026
Comment on lines +8 to +11
## Prerequisites

- `gh` (GitHub CLI) must be installed and authenticated. If not in your PATH, check common locations like `/opt/homebrew/bin/gh` on macOS or `C:\Program Files\GitHub CLI\gh.exe` on Windows.
- Access to `curl` or similar tool to fetch raw logs from LUCI.

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.

FWIW @vashworth has authored steps for how to have the github mcp server installed and I think that is probably the longer term solution. Non blocking for now but I think you will want to set that up.

@reidbaker reidbaker left a comment

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.

I think these are good enough to land and experiment with.

@Piinks Piinks added c: contributor-productivity Team-specific productivity, code health, technical debt. team-infra Owned by Infrastructure team labels Apr 27, 2026
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 28, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 28, 2026
Merged via the queue into flutter:master with commit 828b6dc Apr 28, 2026
66 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. CICD Run CI/CD team-infra Owned by Infrastructure team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants