Skip to content

Commit e6168f7

Browse files
rustyconoverclaude
andcommitted
supports_returning opt-in flag + simple writable fixture + sentry release fallback
* TableInfo gains supports_returning (default False): workers must opt in to RETURNING support per-table. Existing transactor-backed writable fixture and any future writers that wire affected-row emit must set this to True. * New vgi-fixture-simple-writable-worker entry point: SQLite-backed in-memory fixture exercising INSERT/UPDATE/DELETE (with and without RETURNING) without duckdb-python's subcursor / enable_suspended_queries. Includes intentional failure modes (items_no_returning, items_insert_only, items_broken_returning) to drive both the C++ supports_returning gate and the runtime schema validator. * Sentry: fall back to importlib.metadata.version("vgi") when SENTRY_RELEASE is unset so dev/test runs still tag a release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5d3d8a4 commit e6168f7

8 files changed

Lines changed: 837 additions & 10 deletions

File tree

‎CLAUDE.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ vgi-client --input data.parquet --function sum_all_columns --worker vgi-fixture-
291291
| `VGI_OTEL_DISABLE_METRICS` | Disable metrics only (`1`/`true`/`yes`) |
292292
| `SENTRY_DSN` | Enable Sentry error reporting (requires `[sentry]` extra). When set, `vgi-serve` calls `sentry_sdk.init()` before constructing the worker so vgi-rpc's auto-attach picks up RPC dispatch errors and VGI enriches with `vgi.function.name`, `vgi.attach_id`, `vgi.transaction_id`, etc. |
293293
| `SENTRY_ENVIRONMENT` | Environment tag passed to `sentry_sdk.init()` (e.g. `production`, `staging`) |
294-
| `SENTRY_RELEASE` | Release identifier passed to `sentry_sdk.init()` (e.g. git SHA) |
294+
| `SENTRY_RELEASE` | Release identifier passed to `sentry_sdk.init()` (e.g. git SHA). When unset, falls back to the installed `vgi` package version so every run is associated with a release; deploys should set this to a git SHA for commit tracking. |
295295
| `SENTRY_TRACES_SAMPLE_RATE` | Float in `[0, 1]` for performance sampling (Sentry's standard knob) |
296296
| `VGI_WORKER_SHARED_STORAGE` | Storage backend: `sqlite` (default), `azure-sql` (requires `[azure]` extra), or `cloudflare-do` |
297297
| `VGI_AZURE_SQL_SERVER` | Azure SQL server hostname (required when `azure-sql`) |
@@ -367,12 +367,16 @@ auto_apply_complete function=SequenceFunction input_rows=100 output_ro
367367

368368
Set `SENTRY_DSN` (and install `vgi[sentry]`) to forward unhandled exceptions to Sentry. `vgi-serve` calls `sentry_sdk.init()` automatically before building the worker, which lets vgi-rpc's auto-attach hook (added in `vgi-rpc 0.12.0`) wire RPC-level instrumentation onto every `RpcServer`. VGI then layers on:
369369

370-
- **Dispatch-scoped scope tags** — `vgi.function.name`, `vgi.function.type`, `vgi.attach_id`, `vgi.transaction_id`, `vgi.principal`, `vgi.auth_domain`, `vgi.authenticated`, plus init-time fields (`vgi.init.execution_id`, `vgi.init.phase`).
370+
- **Dispatch-scoped scope tags** — `vgi.function.name`, `vgi.function.type`, `vgi.principal`, `vgi.auth_domain`, `vgi.authenticated`, plus init-time fields (`vgi.init.execution_id`, `vgi.init.phase`). `vgi.attach_id` and `vgi.transaction_id` are set by **vgi-rpc's** dispatch hook (since 0.14.0) on every method that carries them — top-level kwargs, request dataclasses, and `InitRequest.bind_call` are all unwrapped automatically. Tag values are 12-char SHA-256 prefixes, so the tag-value distribution UI stays bounded; the full hex remains in catalog breadcrumbs for direct lookup.
371371
- **Per-batch breadcrumbs** under category `vgi.execute` carrying `function_name`, `function_type`, `duration_ms`, `input_rows`, `output_rows`, `input_bytes`, `output_bytes`, and `execution_id`. If a stream crashes mid-flight, the event timeline shows the size and shape of every preceding batch.
372-
- **Catalog-lifecycle breadcrumbs** under categories `catalog.attach`, `catalog.detach`, `catalog.create`, `catalog.transaction.begin`, `catalog.transaction.commit`, `catalog.transaction.rollback`. These provide the mapping from opaque `attach_id` and `transaction_id` hex strings back to catalog names — without them, an event tagged `vgi.attach_id=4f3c...` is unreadable to a developer.
372+
- **Catalog-lifecycle breadcrumbs** under categories `catalog.attach`, `catalog.detach`, `catalog.create`, `catalog.transaction.begin`, `catalog.transaction.commit`, `catalog.transaction.rollback`. These provide the mapping from short-hashed `vgi.attach_id` / `vgi.transaction_id` tags back to full hex IDs (and to catalog names) — without them, an event tagged `vgi.attach_id=4f3c2a1b9d8e` is unreadable to a developer.
373+
- **Catalog-attach scope tags** — `vgi.catalog.name`, `vgi.data_version_spec`, `vgi.implementation_version` are set on the `catalog_attach` transaction so events fired during attach are filterable by catalog identity. Note: these tags only apply to the attach transaction itself, not subsequent operations on the attached catalog (one Sentry transaction per RPC method).
374+
- **Standards-aligned user mapping** — JWT `sub` → `user.id`; `preferred_username` → `user.username`; `email` → `user.email`; `name` → `user.name`. Override per-IdP via `SentryConfig.user_claim_map` (e.g. Auth0 namespaced claims). Static bearer tokens populate only `user.id`.
373375

374376
**Attach options redaction:** by default *no* options are logged in the `catalog.attach` / `catalog.create` breadcrumbs because options routinely carry credentials. Implementers opt in via `CatalogInterface.loggable_attach_options(options) -> Mapping`, which returns a redacted, safe-to-log subset (host, region, bucket — never password/token/secret). When the override returns an empty mapping (the default), the `options` field is omitted from the breadcrumb entirely. See `docs/catalog-interface.md` for details.
375377

378+
**Releases.** `vgi-serve` populates `release` from `SENTRY_RELEASE` if set, otherwise from `importlib.metadata.version("vgi")`. Production deploys should set `SENTRY_RELEASE=$(git rev-parse HEAD)` (or a tagged release identifier) so Sentry's commit-tracking and regression-detection features can correlate events to specific commits. Publishing GitHub releases makes the release-comparison UI more useful.
379+
376380
The same enrichment applies to OTel spans when `VGI_OTEL_ENABLED=1` — both backends read from the same `VgiTracer.set_current_span_attributes()` call sites in `vgi/otel.py`. Either, neither, or both can be active in a process.
377381

378382
### Type Inference Rules

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ vgi-fixture-versioned-worker = "vgi._test_fixtures.versioned:main"
4949
vgi-fixture-versioned-tables-worker = "vgi._test_fixtures.versioned_tables:main"
5050
vgi-fixture-attach-options-worker = "vgi._test_fixtures.attach_options:main"
5151
vgi-fixture-writable-worker = "vgi._test_fixtures.writable.worker:main"
52+
vgi-fixture-simple-writable-worker = "vgi._test_fixtures.simple_writable:main"
5253
vgi-transactor = "vgi.transactor.server:main"
5354

5455
[tool.hatch.metadata]

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)