flutter-pr-checks-finder

작성자: flutter

Flutter PR에서 실패한 검사를 찾고 해당 LUCI 로그 URL을 찾습니다.

npx skills add https://github.com/flutter/flutter --skill flutter-pr-checks-finder

Flutter PR Checks Finder

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.

Workflow

1. Find Failing Checks

You can use the gh CLI if it's installed and authenticated, or use direct HTTP requests to the GitHub API as a fallback.

Option A: Using gh CLI (Preferred)

Run the following command to list checks:

gh pr checks <PR_NUMBER>

Option B: Using GitHub API via HTTP

If gh is not available, you can use read_url_content or a similar method to interact with the public GitHub API:

  1. Find the PR SHA: Make an HTTP request to: https://api.github.com/repos/flutter/flutter/pulls/<PR_NUMBER> Extract the head.sha field.
  2. List Check Runs: Make an HTTP request to: https://api.github.com/repos/flutter/flutter/commits/<PR_SHA>/check-runs Parse the JSON response. CRITICAL: You must handle pagination to avoid missing failures! Check the total_count field. If it is greater than the number of items in the check_runs array (typically capped at 100 or what you set with per_page), make additional HTTP requests by appending ?per_page=100&page=<N> to the URL for each subsequent page until all check runs are fetched. Identify all checks that have failed (i.e., where conclusion is failure).

Identify all checks that have failed.

2. Retrieve Failure Logs

For each failing check:

  1. Find the Log URL:

    • Look for the target URL or link associated with the check.
    • The flutter-dashboard link typically appears as "View more details on flutter-dashboard" at the bottom of the check view on GitHub.
    • Alternatively, you can reconstruct the link to the LUCI page based on the name of the failing check and the build number if available. Example LUCI URL structure: https://ci.chromium.org/ui/p/flutter/builders/try/<Builder Name>/<Build Number>/overview
  2. Build Raw Log URL:

    • Manual: Reconstruct the raw log URL by appending ?format=raw to the log URL or by following the pattern: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/<Build ID>/+/u/<Step Name>/stdout?format=raw
  3. Fetch Raw Logs:

    • Use curl or similar tool to fetch the content of the raw log URL.
    • CRITICAL: You must use the raw log URL to avoid HTML formatting and truncated output. Do NOT rely solely on the check summary in the GitHub API, as it may be truncated or lack full context.

Builder to Step Name Mapping

[!NOTE] Step names can be very specific and hard to guess. This section documents patterns to help find them.

Recipes & Tools

  • flutter_drone Recipe

    • Description: Originates from the cocoon or recipes repository. It is typically used for running sharded framework tests and lints (like analyze, test_general) as specified in .ci.yaml (root).
    • Pattern: run test.dart for <shard> shard and subshard <subshard>
    • URL Transformation: Spaces are replaced by underscores.
    • Default: If subshard is not specified, it defaults to None.
    • Example: For Linux analyze (shard: analyze, no subshard), the URL step name is run_test.dart_for_analyze_shard_and_subshard_None.
  • builder.py & Related Recipes

    • Description: Found in the flutter/engine repository (or recipes repository) and used to execute builds and tests according to target JSON configurations in the builders folder directory.
    • Pattern: Typically the task name specified in the JSON configuration, often prefixed with test: .
    • URL Transformation: Spaces are replaced by underscores.
    • Gotcha: If the test name already starts with test: in the JSON file, the recipe might still add the prefix again (e.g., test:_test:_Check_formatting).
  • tester.py

    • Description: A common helper script in the engine's CI recipes used to execute tests.
    • Pattern: Run <shard> tests or Run <shard> <subshard> tests.
    • URL Transformation: Spaces are replaced by underscores.

Locating Exact Names in Engine

If guessing fails, find the exact test and task names in the engine configuration:

  1. Look up the builder in .ci.yaml (engine) to find its config_name property.
  2. Locate the corresponding JSON file in the builders folder directory.
  3. Read the JSON file to find the tests array and the specific tasks listed within them.

Fallback

If read_url_content fails with 404 on guessed step names, you may need to find the step name from the LUCI overview page or other sources.

flutter의 다른 스킬

adding-release-notes
flutter
사용자 대상 변경 사항 설명을 DevTools 릴리스 노트에 추가합니다. NEXT_RELEASE_NOTES.md 파일에 개선 사항, 수정 사항 또는 새로운 기능을 문서화할 때 사용하세요.
official
dart-modern-features
flutter
현대화를 위한 후보를 찾으려면:
official
api-review
flutter
지정된 코드를 표준 API 설계 지침에 맞춰 검토합니다. 사용자가 API 리뷰를 요청하거나 API 설계에 따라 코드를 확인할 때 이 스킬을 사용하세요…
official
code-documentation
flutter
효과적인 코드 문서 작성 가이드로, docstrings, JSDoc, dartdoc 및 구현 주석을 포함합니다. 새 코드를 작성하거나 추가할 때 이 스킬을 사용하세요…
official
dart-add-unit-test
flutter
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains…
official
dart-build-cli-app
flutter
진입점 구조, 종료 코드, 크로스 플랫폼 스크립트. 명령줄 유틸리티, 스크립트 또는 애플리케이션을 빌드할 때 사용합니다.
official
dart-collect-coverage
flutter
coverage 패키지를 사용하여 커버리지를 수집하고 LCOV 보고서를 생성합니다
official
dart-fix-runtime-errors
flutter
get_runtime_errors와 lsp를 사용하여 활성 스택 트레이스를 가져오고, 실패한 줄을 찾아 수정을 적용한 후 hot_reload를 통해 해결 여부를 확인합니다.
official