AgentSkillsCN

frb-fix-ci

在flutter_rust_bridge的CI流程出现故障时——在深入排查之前使用。

SKILL.md
--- frontmatter
name: frb-fix-ci
description: Use when CI fails in flutter_rust_bridge - before deep investigation

FRB Fix CI

Note: Check your user-level remote-testing rules before running commands. Tests and codegen may require remote execution.

Overview

CI failures in flutter_rust_bridge often have simple fixes. Try the appropriate approach below before deep investigation.

Core principle: Start with lazy fixes (re-run, copy diff, --fix) before expensive investigation.

Quick Reference

SymptomFix
Flaky test (passes sometimes)gh run rerun --failed
Git diff shown in CIgit apply OR regenerate
Lint/format errorsAdd --fix flag
Can't reproduce locallyUse same ./frb_internal command from CI

Fixes by Scenario

Flaky Test

Sometimes CI fails due to timing issues, not real bugs. Rerun only failed jobs:

bash
gh run rerun --failed

If it passes on retry → flaky, not your bug.

Git Diff Errors

When CI shows a diff, you have two options:

Option A: git apply (faster)

CI already ran the generator. Just apply what it computed:

bash
# Copy the diff from CI, then:
pbpaste | git apply   # macOS

Option B: Regenerate (slower but more "proper")

bash
./frb_internal precommit-generate

After codegen: Check your user-level remote-testing rules. If codegen was run remotely, pull changes back to local.

Both are correct. Option A is faster; Option B is more thorough.

Lint/Format Errors

For clippy, dart analyze, or format errors, use --fix:

bash
./frb_internal lint --fix

This runs:

  • cargo clippy --fix - Rust lint fixes
  • cargo fmt - Rust format
  • dart format - Dart format
  • dart fix --apply - Dart auto fixes

Can't Reproduce Locally

CI shows the command it ran. Run the same command:

bash
# CI shows: ./frb_internal test-dart --package frb_example/pure_dart
./frb_internal test-dart --package frb_example/pure_dart

Common Mistakes

  • Investigating root cause when a simple re-run would work
  • Not trying git apply first when CI provides a diff

Related Skills

  • frb-code-generation - Which generation commands to run
  • frb-debugging - Deep debugging when simple fixes don't work