Flutter PR验证
- 作者仓库星标 176,634
- 作者仓库 flutter
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/ghon macOS orC:\Program Files\GitHub CLI\gh.exeon Windows.- Access to
curlor 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:
- Find the PR SHA:
Make an HTTP request to:
https://api.github.com/repos/flutter/flutter/pulls/<PR_NUMBER>Extract thehead.shafield. - List Check Runs:
Make an HTTP request to:
https://api.github.com/repos/flutter/flutter/commits/<PR_SHA>/check-runsParse the JSON response. CRITICAL: You must handle pagination to avoid missing failures! Check thetotal_countfield. If it is greater than the number of items in thecheck_runsarray (typically capped at 100 or what you set withper_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., whereconclusionisfailure).
Identify all checks that have failed.
2. Retrieve Failure Logs
For each failing check:
Find the Log URL:
- Look for the target URL or link associated with the check.
- The
flutter-dashboardlink 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
Build Raw Log URL:
- Manual: Reconstruct the raw log URL by appending
?format=rawto 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
- Manual: Reconstruct the raw log URL by appending
Fetch Raw Logs:
- Use
curlor 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.
- Use
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_droneRecipe- 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
subshardis not specified, it defaults toNone. - Example: For
Linux analyze(shard:analyze, no subshard), the URL step name isrun_test.dart_for_analyze_shard_and_subshard_None.
- Description: Originates from the cocoon or recipes repository. It is typically used for running sharded framework tests and lints (like
builder.py& Related Recipes- Description: Found in the
flutter/enginerepository (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).
- Description: Found in the
tester.py- Description: A common helper script in the engine's CI recipes used to execute tests.
- Pattern:
Run <shard> testsorRun <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:
- Look up the builder in .ci.yaml (engine) to find its
config_nameproperty. - Locate the corresponding JSON file in the builders folder directory.
- Read the JSON file to find the
testsarray and the specifictaskslisted 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.
- 流狐分类
- AI 智能
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @flutter · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- Shell 执行
- 检测到的网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Workflow
[!NOTE] Step names can be very specific and hard to guess. This section documents patterns to help find them. Recipes & Tools
# 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:
```bash
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.
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Prerequisites → Workflow → 1. Find Failing Checks → 2. Retrieve Failure Logs → Builder to Step Name Mapping
要点 -> Find the PR SHA · List Check Runs · CRITICAL · Find the Log URL · Build Raw Log URL · Manual · Fetch Raw Logs · flutterdrone Recipe
文件/命令 -> /opt/homebrew/bin/gh · C:\Program Files\GitHub CLI\gh.exe · curl · readurlcontent · https://api.github.com/repos/flutter/flutter/pulls/<PRNUMBER> · head.sha · https://api.github.com/repos/flutter/flutter/commits/<PRSHA>/check-runs · totalcount
内容 SHA-256 -> 26704af0520c
方法与流程
适用与边界
原文中的明确线索
/opt/homebrew/bin/gh、C:\Program Files\GitHub CLI\gh.exe、curl、readurlcontent、https://api.github.com/repos/flutter/flutter/pulls/<PRNUMBER>、head.sha、https://api.github.com/repos/flutter/flutter/commits/<PRSHA>/check-runs、totalcount