Skip to content

Commit e7f6787

Browse files
spalladinoclaude
andcommitted
feat: add support for downloading history logs via dlog
Extends the `dlog` command to handle Redis LIST keys (history_* and failed_tests*) in addition to gzipped string logs. Also adds `yarn ci` alias for accessing ci.sh from yarn-project and updates agent docs. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent ce8bad5 commit e7f6787

File tree

6 files changed

+40
-19
lines changed

6 files changed

+40
-19
lines changed

ci.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,16 @@ case "$cmd" in
220220
fi
221221
pager=${PAGER:-less}
222222
[ ! -t 0 ] && pager=cat
223-
redis_getz $1 | $pager
223+
key=$1
224+
# Handle list/* URLs or history_* keys (Redis LISTs, not strings)
225+
if [[ "$key" == list/* ]]; then
226+
key=${key#list/}
227+
fi
228+
if [[ "$key" == history_* || "$key" == failed_tests* ]]; then
229+
redis_cli LRANGE "$key" 0 -1 | $pager
230+
else
231+
redis_getz "$key" | $pager
232+
fi
224233
;;
225234

226235
#################

yarn-project/.claude/agents/analyze-logs.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,7 @@ Do not use `diff` as an analysis, since timestamps or random values will mean th
228228
## Key Behavior
229229

230230
1. **Use local file if provided** - never re-download
231-
2. If only hash given and file not at `/tmp/<hash>.log`, download via:
232-
```bash
233-
./ci.sh dlog <hash> > /tmp/<hash>.log 2>&1
234-
```
231+
2. If only hash or `ci.aztec-labs.com` url given and file not at `/tmp/<hash>.log`, then download via `yarn ci dlog <hash> > /tmp/<hash>.log 2>&1`
235232
3. **Always check Jest report at end first** to identify actual failure
236233
4. For huge logs (>10k lines): grep for ERROR/WARN first, then expand context
237234
5. **Return summary, not raw content** - extract only relevant snippets

yarn-project/.claude/agents/identify-ci-failures.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,34 @@ gh run view <RUN_ID> --repo AztecProtocol/aztec-packages --log 2>&1 | grep -i "C
6464

6565
### Step 2: Download Main Log
6666

67-
From repo root:
67+
Run from `yarn-project`:
6868
```bash
69-
./ci.sh dlog <hash> > /tmp/<hash>.log 2>&1
69+
yarn ci dlog <hash> > /tmp/<hash>.log 2>&1
7070
```
7171

7272
Verify download:
7373
```bash
7474
wc -l /tmp/<hash>.log
7575
```
7676

77+
Never use the `Fetch` tool or `curl` for downloading.
78+
7779
### Step 3: Check for History URL
7880

7981
Look in the first 20 lines for a `History:` URL:
8082
```bash
8183
head -20 /tmp/<hash>.log | grep -i "history"
8284
```
8385

84-
If found, this can be used to find successful runs for comparison.
86+
If found (e.g., `http://ci.aztec-labs.com/list/history_e3d65d7f0d7a03b5_next`), this can be used to find successful runs for comparison.
87+
88+
**To download history:**
89+
```bash
90+
# Extract the key from the URL (everything after /list/)
91+
yarn ci dlog history_e3d65d7f0d7a03b5_next > /tmp/history_e3d65d7f0d7a03b5_next.log 2>&1
92+
```
93+
94+
The history log contains timestamped entries showing PASSED/FAILED/FLAKED runs with commit info. Use this to find a recent successful run's hash for comparison.
8595

8696
### Step 4: Find Failure Type
8797

@@ -113,7 +123,7 @@ grep -E "compile_all.*failed|FAIL|ERROR|test all" /tmp/<hash>.log
113123

114124
For each nested log URL found (format: `http://ci.aztec-labs.com/<hash>`):
115125
```bash
116-
./ci.sh dlog <hash> > /tmp/<hash>.log 2>&1
126+
yarn ci dlog <hash> > /tmp/<hash>.log 2>&1
117127
```
118128

119129
### Step 6: Extract Error Details
@@ -142,6 +152,18 @@ FAIL src/e2e_something.test.ts (123.456s)
142152
error TS2345: Argument of type 'X' is not assignable to parameter of type 'Y'
143153
```
144154

155+
**History log format** (from `yarn ci dlog history_*`):
156+
```
157+
MM-DD HH:MM:SS: PASSED (http://ci.aztec-labs.com/<hash>): test_command (duration) (author: commit message)
158+
MM-DD HH:MM:SS: FAILED (http://ci.aztec-labs.com/<hash>): test_command (duration) (code: 1) (author: commit message)
159+
MM-DD HH:MM:SS: FLAKED (http://ci.aztec-labs.com/<hash>): test_command (duration) (code: 1) (author: commit message)
160+
```
161+
Each line represents a past test run. Extract the hash from PASSED entries to download successful run logs for comparison:
162+
```bash
163+
grep "PASSED" /tmp/history.log | head -1 # Find a successful run
164+
yarn ci dlog <hash> # Download the successful run's logs
165+
```
166+
145167
## Key Principles
146168

147169
- **Download once**: Save all logs to `/tmp/<hash>.log` for reuse

yarn-project/.claude/skills/debug-e2e/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ To understand when a test started failing:
136136
4. Check the PR mentioned in the commit message to understand what changed
137137
5. Download logs from both passing and failing runs to compare:
138138
- Use hash from history (e.g., `2614d91ec48f4047` for passed, `10d5f47f04025f1c` for failed)
139-
- `./ci.sh dlog <hash>` downloads the log
139+
- `yarn ci dlog <hash> > /tmp/<hash>.log 2>&1` downloads the log to a local tmp file
140140

141141
**Important**: Do NOT use `gh run list` - the history in the log file is more accurate for this specific test.
142142

@@ -252,4 +252,4 @@ Claude: [Searches codebase for MAXIMUM_GOSSIP_CLOCK_DISPARITY]
252252
Found in p2p/config.ts, default is 2 seconds. The PR added this validation
253253
but epoch proofs can take longer to propagate. Recommend increasing the
254254
disparity threshold for epoch-related messages.
255-
```
255+
```

yarn-project/CLAUDE.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@ Always run `yarn build` from the `yarn-project` root. Never run `tsgo` directly,
4848
yarn build
4949
```
5050

51-
### CI Log Access
52-
53-
Download and view CI logs from the repo root:
54-
55-
```bash
56-
./ci.sh dlog <hash> # Retrieves logs from CI cache
57-
```
58-
5951
### Before Committing (Quality Checklist)
6052

6153
Run from `yarn-project`:

yarn-project/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"packageManager": "[email protected]",
44
"private": true,
55
"scripts": {
6+
"ci": "../ci.sh",
67
"prepare": "node ./scripts/update_package_jsons.mjs && yarn workspaces foreach -A run prepare && workspaces-to-typescript-project-references --tsconfigPath tsconfig.json && prettier -w */tsconfig.json",
78
"prepare:check": "node ./scripts/update_package_jsons.mjs --check && workspaces-to-typescript-project-references --check --tsconfigPath tsconfig.json",
89
"docs": "typedoc --out docs/dist && cd docs && yarn serve",

0 commit comments

Comments
 (0)