Skip to content

Commit dc58ce0

Browse files
FredKSchottFred K. Schott
andauthored
auto-triage improvements: fix tests, subagents, triage directory (#15522)
* docs: fix test command syntax in AGENTS.md to use astro-scripts directly Replace package.json script references (test:unit, test:match, etc.) with direct astro-scripts test invocations. Add 'exec' to pnpm commands so astro-scripts is resolved as a bin, not a script name. Document key flags (--match, --parallel, --watch, --timeout, --only). * docs: improve triage skill reproduce step with path validation Clarify that triageDir must be passed as a positional argument to create-astro, and add a verification step to confirm the project was created at the expected path before proceeding. * fix: use cp from examples/ instead of create-astro for triage scaffolding create-astro pulls the latest published Astro from npm, which doesn't match the monorepo version during beta. Copy from examples/ instead to ensure the workspace-linked version is always used. * update @flue/cli to 0.0.31 --------- Co-authored-by: Fred K. Schott <fschott@cloudflare.com>
1 parent 40f10bb commit dc58ce0

File tree

4 files changed

+36
-23
lines changed

4 files changed

+36
-23
lines changed

.agents/skills/triage/reproduce.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Skip if a repository maintainer has commented that this issue should not be repr
7373

7474
Every bug report should include some sort of reproduction. The reproduction project goes in the `triageDir` directory (e.g. `triage/gh-123`). If no `triageDir` is provided, default to `triage/gh-<issue_number>`.
7575

76-
Set up the reproduction project based on what the issue provides you. Once the reproduction project directory has been completed, run `pnpm install` in the workspace to connect it to the rest of the monorepo.
76+
Set up the reproduction project based on what the issue provides you. Once the reproduction project directory has been completed, run `pnpm install` in the workspace top-level root to connect it to the rest of the monorepo.
7777

7878
### StackBlitz Project URL (`https://stackblitz.com/edit/...`)
7979

@@ -110,22 +110,29 @@ You may still need to set up a project from scratch (see fallback below) and app
110110

111111
### Manual Steps Reproduction
112112

113-
If no reproduction URL is provided, you will need to follow the manual steps that the user provided instead.
114-
115-
Scaffold a fresh Astro project into the triage directory using `create-astro`. Use `--no-install` to skip dependency installation (we will run `pnpm install` later) and `--no-git` to avoid creating a nested git repo. Use `--template` to pick a starting template — if the user didn't mention a specific one, use `minimal` as the default.
113+
If no reproduction URL is provided, you will need to follow the manual steps that the user provided instead. If the user didn't mention a specific template, use `minimal` as the default.
116114

117115
```bash
118-
npx create-astro@latest <triageDir> --template minimal --no-install --no-git -y
116+
# 1. List available example templates
117+
ls examples/
118+
# 2. Remove the selected template's node_modules directory to avoid problems with `cp -r`
119+
rm -rf examples/<template>/node_modules
120+
# 3. Copy over the selected template into the triage directory
121+
cp -r examples/<template> <triageDir>
122+
# 4. Re-run install (at the workspace root) to add back missing node_modules dependencies
123+
pnpm install
119124
```
120125

121-
Then, modify the triage project as needed:
126+
Verify that the project was created in the correct place (`cat <triageDir>/package.json`).
127+
128+
Then, modify the triage project as needed to attempt your reproduction:
122129

123-
1. Update `astro.config.mjs` with required configuration
124-
2. Add any required dependencies or Astro integrations (`@astrojs/react`, etc.)
125-
3. Create pages, components, or middleware that trigger the bug
130+
1. Update `astro.config.mjs` with required configuration changes
131+
2. Add/modify any dependencies or Astro integrations (`@astrojs/react`, etc.)
132+
3. Add/modify any pages, components, middleware, etc. that trigger the bug
126133
4. Add/modify any additional files mentioned in the issue
127134

128-
Keep the reproduction as minimal as possible — only add what's needed to trigger the bug.
135+
Keep the reproduction as minimal as possible — only add what the issue reporter has documented as needed to trigger the bug.
129136

130137
## Step 4: Attempt Reproduction in the Triage Project
131138

AGENTS.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ Note: Edits to source files take effect after rebuilding the package via `pnpm b
2121

2222
# Running Tests
2323

24-
- Run `pnpm test` in the workspace root to run the full suite (slow).
25-
- Run `pnpm -C <package-directory> test` to run a package’s tests (example: `pnpm -C packages/astro test`, `pnpm -C packages/integrations/react test`).
26-
- Run an individual test file with `node path/to/test.js` (non-E2E).
27-
- For focused Astro package runs: `pnpm -C packages/astro test:unit`, `pnpm -C packages/astro test:integration`, `pnpm -C packages/astro test:cli`, `pnpm -C packages/astro test:types`.
28-
- For matching a subset by test name in Astro: `pnpm -C packages/astro test:match -- "<pattern>"`.
29-
- For E2E: `pnpm test:e2e` or `pnpm test:e2e:match -- "<pattern>"`.
24+
- Run `pnpm test` in workspace root or package directory to run full test suite (can be slow!)
25+
- Integration tests live in special `packages/integrations` folders.
26+
- Example: `pnpm -C <package-directory> exec astro-scripts test` - Run a single package test suite
27+
- Example: `pnpm -C <package-directory> exec astro-scripts test "test/actions.test.js"` - Run a single test file
28+
- Example: `pnpm -C <package-directory> exec astro-scripts test "test/**/*.test.js" --match "CSS"` - Run specific tests matching a string or regex patterns
29+
- Example: `pnpm -C <package-directory> exec astro-scripts test "test/{actions,css,middleware}.test.js"` - Run multiple test files
30+
- Key flags:
31+
- `--match` / `-m`: Filter tests by name pattern (regex)
32+
- `--only` / `-o`: Run only tests marked with `.only`
33+
- `--parallel` / `-p`: Run tests in parallel (default is sequential)
34+
- `--timeout` / `-t`: Set timeout in milliseconds
35+
- `--watch` / `-w`: Watch mode
3036

3137
# Astro Quick Reference
3238

@@ -43,7 +49,7 @@ Note: Edits to source files take effect after rebuilding the package via `pnpm b
4349

4450
- Use `astro dev` and `astro preview` in the background to prevent hanging your entire session, and use `&` to run them in the background. Use `--port RANDOM_NUMBER --strictPort` to avoid port conflicts. Cleanup old servers when you're done.
4551
- Use `astro dev` and `astro preview` as web servers for Astro project. They are reliable. Don't use other web servers for testing.
46-
- Use `pnpm -C <dir> <command>` for project-local commands when working in packages/examples/triage directories. Only omit `-C` flag when intentionally working in the monorepo root. (Example: `pnpm -C packages/astro build`, `pnpm -C examples/blog dev`)
52+
- Use `pnpm -C <dir> <command>` for project-local script commands when working in packages/examples/triage directories. Only omit `-C` flag when intentionally working in the monorepo root. (Example: `pnpm -C packages/astro build`, `pnpm -C examples/blog dev`)
4753
- Use `agent-browser` for web automation or when UI interaction, long-running browsers, or HMR testing is required. Use `agent-browser --help` for all commands. Use this core workflow:
4854
- Example: `agent-browser open <url>` - Navigate to page
4955
- Example: `agent-browser snapshot -i` - Get interactive elements with refs (@e1, @e2)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@biomejs/biome": "2.3.6",
6565
"@changesets/changelog-github": "^0.5.2",
6666
"@changesets/cli": "^2.29.8",
67-
"@flue/cli": "^0.0.30",
67+
"@flue/cli": "^0.0.31",
6868
"@flue/client": "^0.0.17",
6969
"@types/node": "^18.19.115",
7070
"esbuild": "0.25.5",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)