Skip to content

Commit f5d27be

Browse files
sebawoclaude
andcommitted
chore: add Trunk.io MCP/plugin guidance to fix-flaky-go-test skill
Documents how to: - extract the Trunk test case link from Jira tickets via atlassian MCP - fetch failure history and rate from the Trunk test page (Scrapling) - call the Trunk fix-flaky-test MCP tool with the correct fix/investigation ID (distinct from the test-case UUID in the page URL) - distinguish "investigation not found" from a real result Also adds Docker/Solana sync.Once root cause pattern from CCIP-10960. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Made-with: Cursor
1 parent 29b3d15 commit f5d27be

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

  • .agents/skills/fix-flaky-go-test

.agents/skills/fix-flaky-go-test/SKILL.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,62 @@ Core tests need Postgres and usually CL_DATABASE_URL. CI uses tools/bin (gotests
1515
Read README.md Running tests, .github/workflows/ci-core.yml, tools/bin for parity.
1616
</scope>
1717

18+
<trunk>
19+
## Trunk.io — gather context before touching code
20+
21+
Trunk.io tracks flaky test history, failure rates, and AI-generated root cause analysis.
22+
Always check Trunk first — it may already have a fix recommendation.
23+
24+
### Finding the Trunk test link
25+
26+
Jira tickets for flaky tests almost always contain a Trunk link. Look for:
27+
- A URL matching `https://app.trunk.io/chainlink/flaky-tests/test/<uuid>/`
28+
- The UUID in that URL is the **test case ID** (not a fix/investigation ID)
29+
30+
To extract it from a Jira ticket:
31+
```
32+
mcp__atlassian__getJiraIssue issue: "CCIP-XXXX"
33+
```
34+
Then look for `app.trunk.io` URLs in the description or comments.
35+
36+
### Reading test history and failure data
37+
38+
Open the test case page directly — it shows failure rate, timeline, and recent CI runs:
39+
```
40+
https://app.trunk.io/chainlink/flaky-tests/test/<test-case-uuid>/
41+
```
42+
43+
Use the Scrapling MCP to fetch it (JS-rendered page):
44+
```
45+
mcp__ScraplingServer__fetch url: "https://app.trunk.io/chainlink/flaky-tests/test/<uuid>/"
46+
```
47+
48+
### Getting an AI fix recommendation (Trunk MCP)
49+
50+
The Trunk MCP tool `fix-flaky-test` requires a **fix/investigation ID**, which is different
51+
from the test case ID in the URL. Investigations must be triggered from the Trunk UI first.
52+
53+
If an investigation exists, call:
54+
```
55+
mcp__plugin_trunk_trunk__fix-flaky-test
56+
repoName: "smartcontractkit/chainlink"
57+
orgSlug: "chainlink"
58+
fixId: "<fix-or-investigation-uuid>"
59+
```
60+
61+
If the tool returns "Investigation not found", the investigation has not been triggered yet.
62+
Ask the reporter to open the test case page and click "Investigate" — or proceed with
63+
code-level analysis using the workflow below.
64+
65+
### What to read from Trunk
66+
67+
- **Failure rate** — how often it fails (e.g. 12% over last 30 days)
68+
- **Failure pattern** — does it cluster around certain times, branches, or PR authors?
69+
- **First seen / last seen** — did it regress recently after a change?
70+
- **CI job name** — which workflow step fails (unit, race, integration, ccip-deployment)
71+
- **Trunk root cause label** — if already classified (race, timing, docker, network, etc.)
72+
</trunk>
73+
1874
<setup>
1975
Run README prep: pnpm, make mockery, make generate, Postgres, make setup-testdb, source .dbenv, make testdb after pulls. Use make testdb-force if DB stuck.
2076
Unset env vars except CL_DATABASE_URL when tests act wrong.
@@ -81,6 +137,8 @@ Re-run the same repro command. Record shuffle seed in commit or comment if order
81137
General: package init and globals, t.Parallel plus shared fixtures, wall clock without fakes, port or path collisions, map order assumptions, leaked env or cwd, goroutines after test end.
82138

83139
Chainlink: shared Postgres or stale schema; missing pgtest.NewSqlxDB(t); cltest.TestApplication teardown or leaked HTTP; ports without :0 or CL_RESERVE_PORTS; stress without --tags integration on integration files; wrong module root.
140+
141+
Docker/Solana: WithSolanaContainerN port conflicts or slow startup; sync.Once download helpers that mark a failed download as done (causing cascading file-not-found failures in parallel runs); LoadCCIPPrograms network timeouts. If a test spins up Docker/Solana but the code under test early-exits before any chain interaction, remove the unnecessary infra.
84142
</root_causes>
85143

86144
<fix_patterns>

0 commit comments

Comments
 (0)