diff --git a/AGENTS.md b/AGENTS.md index 21dd58add73..800d274e4c2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -133,3 +133,24 @@ Build a specific plugin: `yarn workspace @grafana-plugins/ dev` - **Config**: Defaults in `conf/defaults.ini`, overrides in `conf/custom.ini`. - **Database migrations**: Live in `pkg/services/sqlstore/migrations/`. Test with `make devenv sources=postgres_tests,mysql_tests` then `make test-go-integration-postgres`. - **CI sharding**: Backend tests use `SHARD`/`SHARDS` env vars for parallelization. + +## Cursor Cloud specific instructions + +### Prerequisites + +- **Node.js v24.x** (see `.nvmrc` for exact version). Use `nvm install` / `nvm use` to match. +- **Go 1.25.7** (see `go.mod`). Pre-installed in the VM. +- **Yarn 4.11.0** via corepack (bundled in `.yarn/releases/`). Run `corepack enable` if `yarn` is not found. +- **GCC** required for CGo/SQLite compilation of the backend. + +### Running services + +- **Backend**: `make run` — builds and starts Grafana backend with hot-reload (air) on `localhost:3000`. Default login: `admin`/`admin`. First build takes ~3 minutes due to debug symbols (`-gcflags all=-N -l`); subsequent hot-reload rebuilds are faster. +- **Frontend**: `yarn start` — starts webpack dev server that watches for changes. The backend proxies to it. First compile takes ~45s. +- No external databases required — Grafana uses embedded SQLite by default. + +### Testing gotchas + +- **Frontend tests**: The `yarn test` script includes `--watch` by default. Always use `yarn jest --no-watch` or add `--watchAll=false` to run tests once and exit. +- **Backend tests**: Some packages (e.g. `pkg/api/`) have slow test compilation (~2 min) due to large dependency graphs. Use targeted test runs with `-run TestName` where possible. +- All standard build/test/lint commands are documented in the Commands section above.