From 5985d27d2f551a93c2c18e80d044fca53310e254 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 24 Jul 2026 15:33:44 +0000 Subject: [PATCH 1/3] Add AGENTS.md with Cursor Cloud setup instructions Co-authored-by: Daniel Szoke --- AGENTS.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..9db014ac --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,32 @@ +# AGENTS.md + +## Cursor Cloud specific instructions + +This repo is the **Sentry SDK for Rust** — a Cargo workspace of library crates (`sentry`, +`sentry-core`, `sentry-types`, and integration crates). There is no long-running server or +GUI; the "applications" are the examples under `sentry/examples/` and `sentry-actix/examples/`. + +### Toolchain / environment (already provisioned by the update script + snapshot) +- MSRV is **1.88** (`Cargo.toml` `rust-version`), so the default toolchain is Rust **stable** + (>= 1.88). The base image's older 1.83 toolchain is not sufficient — stable is installed and + set as default in the snapshot, with `rustfmt` and `clippy` components. +- System libs `libssl-dev` and `pkg-config` are required (the `native-tls`/`openssl-sys` and + `curl` code paths pull in OpenSSL). These are baked into the snapshot. If a build fails with + "system library `openssl` was not found", reinstall with + `sudo apt-get install -y libssl-dev pkg-config`. + +### Standard commands (mirror CI in `.github/workflows/`) +- Lint: `cargo fmt --all -- --check` and + `cargo clippy --all-features --workspace --tests --examples --locked -- -D clippy::all` +- Build/check: `cargo check --all-features --locked` +- Test: `cargo test --workspace --all-features --all-targets --locked` plus + `cargo test --workspace --all-features --doc --locked` +- CI sets `RUSTFLAGS: -Dwarnings`; export it when reproducing CI locally. + +### Running an example (the "app") +- `cargo run --example message-demo` runs, but with **no DSN the client is disabled** and no + event is transmitted (it just logs "initialized disabled sentry client"). +- To exercise the full capture → serialize → transport path, provide a DSN via the + `SENTRY_DSN` env var (read automatically by `sentry::init`), e.g. point it at a local mock + ingest server: `SENTRY_DSN="http://key@127.0.0.1:9999/42" cargo run --example message-demo`. + A real event envelope is then POSTed to `/api//envelope/`. From 913789f7d6d5c7d1d49371351ba194a25070f63d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 24 Jul 2026 15:39:41 +0000 Subject: [PATCH 2/3] meta: document pre-commit hooks and PR-from-commit workflow Configure the dev environment so that commits run pre-commit hooks and so that PRs reuse commit messages instead of the repo PR template. - `pre-commit` is installed in the environment and the repo's `commit-msg` hook is installed at `.git/hooks/commit-msg`. Cursor's hook dispatcher (`core.hooksPath`) chains to the repo hooks, so the pre-commit `commit-msg` hook (which expands issue footers via `scripts/commit-msg-expand-issues.py`) runs on every commit. - Document in `AGENTS.md` how the hook is wired up, how to reinstall it when `core.hooksPath` blocks `pre-commit install`, and the convention that commit messages are reused verbatim as PR title/description with no template. Co-authored-by: Daniel Szoke --- AGENTS.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 9db014ac..ca032b9e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -30,3 +30,24 @@ GUI; the "applications" are the examples under `sentry/examples/` and `sentry-ac `SENTRY_DSN` env var (read automatically by `sentry::init`), e.g. point it at a local mock ingest server: `SENTRY_DSN="http://key@127.0.0.1:9999/42" cargo run --example message-demo`. A real event envelope is then POSTed to `/api//envelope/`. + +### Pre-commit hooks +- Always commit with pre-commit hooks enabled. `pre-commit` (the tool) is installed in the + snapshot and the repo's `commit-msg` hook is installed at `.git/hooks/commit-msg`. +- Cursor sets `core.hooksPath` to its own dispatcher, which chains to the repo hooks in + `/workspace/.git/hooks`, so the pre-commit `commit-msg` hook runs alongside Cursor's hooks. +- Because `core.hooksPath` is set, `pre-commit install` refuses to run directly. If the hook is + ever missing, reinstall with: `HP="$(git config --get core.hooksPath)"; git config --unset-all + core.hooksPath; pre-commit install --install-hooks; git config core.hooksPath "$HP"`. +- The `commit-msg` hook runs `scripts/commit-msg-expand-issues.py`, which expands issue footers + like `Closes #123` into Markdown links (and Linear links) via `gh`. It is a no-op when the + message has no issue footer. Do NOT manually add Linear links — let the hook do it. + +### Commit messages & pull requests +- Commit messages are reused as PR descriptions (see `.agents/skills/commit/SKILL.md`). Write + each commit's subject + body for human reviewers/maintainers. +- When opening a PR, use the commit message as the PR **title and description** verbatim. Do + **not** use the `.github/pull_request_template.md` template. +- Use Conventional Commits style for the subject (`feat:`, `fix:`, `ref:`, `meta:`, etc.). +- Reference issues only via footers in the exact `Closes #123` / `Related to owner/repo#123` + format so the `commit-msg` hook can expand them. From 8f89f0184d5ab7d620591ab3b5682f45fa1aece4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 24 Jul 2026 15:45:41 +0000 Subject: [PATCH 3/3] meta: move Cursor Cloud env notes out of AGENTS.md into a Cursor rule `AGENTS.md` is a cross-agent file, but these notes are Cursor-Cloud specific (snapshot provisioning, Cursor's `core.hooksPath` dispatcher). Keeping them in `AGENTS.md` adds noise for the other agents used against this repo. Move the content to `.cursor/rules/cloud-environment.mdc` (an `alwaysApply` Cursor rule) so it stays available to Cursor agents without affecting other agents, mirroring how the repo already keeps `CLAUDE.md` for Claude. No behavior change to the toolchain, tests, or hooks. Co-authored-by: Daniel Szoke --- .../rules/cloud-environment.mdc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) rename AGENTS.md => .cursor/rules/cloud-environment.mdc (88%) diff --git a/AGENTS.md b/.cursor/rules/cloud-environment.mdc similarity index 88% rename from AGENTS.md rename to .cursor/rules/cloud-environment.mdc index ca032b9e..45c4cce3 100644 --- a/AGENTS.md +++ b/.cursor/rules/cloud-environment.mdc @@ -1,12 +1,15 @@ -# AGENTS.md +--- +description: Cursor Cloud dev environment, build/test commands, and commit/PR workflow for the sentry-rust workspace +alwaysApply: true +--- -## Cursor Cloud specific instructions +# Cursor Cloud environment & workflow This repo is the **Sentry SDK for Rust** — a Cargo workspace of library crates (`sentry`, `sentry-core`, `sentry-types`, and integration crates). There is no long-running server or GUI; the "applications" are the examples under `sentry/examples/` and `sentry-actix/examples/`. -### Toolchain / environment (already provisioned by the update script + snapshot) +## Toolchain / environment (already provisioned by the update script + snapshot) - MSRV is **1.88** (`Cargo.toml` `rust-version`), so the default toolchain is Rust **stable** (>= 1.88). The base image's older 1.83 toolchain is not sufficient — stable is installed and set as default in the snapshot, with `rustfmt` and `clippy` components. @@ -15,7 +18,7 @@ GUI; the "applications" are the examples under `sentry/examples/` and `sentry-ac "system library `openssl` was not found", reinstall with `sudo apt-get install -y libssl-dev pkg-config`. -### Standard commands (mirror CI in `.github/workflows/`) +## Standard commands (mirror CI in `.github/workflows/`) - Lint: `cargo fmt --all -- --check` and `cargo clippy --all-features --workspace --tests --examples --locked -- -D clippy::all` - Build/check: `cargo check --all-features --locked` @@ -23,7 +26,7 @@ GUI; the "applications" are the examples under `sentry/examples/` and `sentry-ac `cargo test --workspace --all-features --doc --locked` - CI sets `RUSTFLAGS: -Dwarnings`; export it when reproducing CI locally. -### Running an example (the "app") +## Running an example (the "app") - `cargo run --example message-demo` runs, but with **no DSN the client is disabled** and no event is transmitted (it just logs "initialized disabled sentry client"). - To exercise the full capture → serialize → transport path, provide a DSN via the @@ -31,7 +34,7 @@ GUI; the "applications" are the examples under `sentry/examples/` and `sentry-ac ingest server: `SENTRY_DSN="http://key@127.0.0.1:9999/42" cargo run --example message-demo`. A real event envelope is then POSTed to `/api//envelope/`. -### Pre-commit hooks +## Pre-commit hooks - Always commit with pre-commit hooks enabled. `pre-commit` (the tool) is installed in the snapshot and the repo's `commit-msg` hook is installed at `.git/hooks/commit-msg`. - Cursor sets `core.hooksPath` to its own dispatcher, which chains to the repo hooks in @@ -43,7 +46,7 @@ GUI; the "applications" are the examples under `sentry/examples/` and `sentry-ac like `Closes #123` into Markdown links (and Linear links) via `gh`. It is a no-op when the message has no issue footer. Do NOT manually add Linear links — let the hook do it. -### Commit messages & pull requests +## Commit messages & pull requests - Commit messages are reused as PR descriptions (see `.agents/skills/commit/SKILL.md`). Write each commit's subject + body for human reviewers/maintainers. - When opening a PR, use the commit message as the PR **title and description** verbatim. Do