Add Climate Orders skippable-error coverage in source-stripe#381
Add Climate Orders skippable-error coverage in source-stripe#381Copilot wants to merge 14 commits into
Conversation
Add two new connector packages:
- **source-metronome**: Reads from the Metronome billing API (customers,
contracts, products, rate cards, credit grants, invoices, entitlements).
Supports cursor-based pagination, per-customer/per-contract fan-out,
and webhook-driven live updates for credit balance and entitlement
changes.
- **destination-redis**: Writes synced data to Redis as individual SET
keys (`{prefix}{stream}:{pk}`). Pipelined batch writes, per-stream
failure tracking, SCAN-based teardown.
Also:
- Register both connectors in the engine (default-connectors.ts)
- Add Redis service to compose.yml (port 56379)
- Regenerate OpenAPI specs with new connector config schemas
- Add e2e test script (scripts/e2e-metronome-redis.sh)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
PixelDraw demo app: each pixel drawn sends a usage event to Metronome, credit balance is gated via Metronome-synced data in Redis (no local state). The sync pipeline keeps Redis up to date via webhooks. - Express server with /api/draw (hot path) and /api/credits - Canvas UI with color picker and live credit balance display - Usage events sent to Metronome ingest API per pixel - Balance checked from Metronome-synced credit_grants in Redis only Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
Zero-dependency SQLite destination connector that uses Node.js 24's built-in node:sqlite module (DatabaseSync). Supports upsert with newer-than deduplication, hard deletes, and auto-creates tables on first write. Registered in both the engine default connectors and the service CLI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
* Fix reverse ETL connector progress and schemas Committed-By-Agent: cursor * Fix reverse ETL regression with source schema and status handling Fix source-postgres connector specification so conformance sees a valid JSON Schema shape for `config`, prevent destination-stripe from forwarding non-error stream status once a stream has failed, and make the reverse ETL custom-object double-run test state progression deterministic. Committed-By-Agent: cursor
* docs: update architecture docs to match current codebase
- packages.md: add missing packages (logger, openapi, hono-zod-openapi,
test-utils, dashboard, visualizer), fix stale dependency claims
(yesql removed, stripe SDK → undici, protocol deps updated)
- service/ARCHITECTURE.md: rewrite for Temporal-based architecture
- engine/ARCHITECTURE.md: fix stale export names (forward→pipe, etc.)
- principles.md: add logger+openapi to approved shared utilities
- AGENTS.md: update package table and isolation rule
- Remove deprecated docs (impl-status.md, overview.md)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
* got the outline going
* More outline update
* docs(slides): add knowledge-transfer deck and bump node to 24
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
* Align KT slides with the current sync protocol and runtime surfaces
The knowledge-transfer deck had drifted away from the current engine, webhook, and connector behavior. This updates the slides to match the actual code paths, adds concrete protocol examples, and marks deprecated protocol message wrappers so the presentation teaches the current direction instead of legacy shapes.
Constraint: Slides needed to stay faithful to current code paths while remaining presentation-readable
Rejected: Keep generic interface aliases and legacy protocol examples | too ambiguous for a codebase handoff
Rejected: Present webhook flow through Temporal/liveLoop | newer /pipeline_handle_events direction is the simpler story to teach
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep slides aligned with the actual protocol and API surfaces; if the message union or webhook entrypoints change again, update the deck at the same time
Tested: Built Slidev deck in Docker; verified preview served over HTTP on localhost:3030
Not-tested: Runtime behavior of the deprecated protocol annotations beyond type/docs usage
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
* Keep generated OpenAPI specs aligned with protocol deprecation docs
The protocol annotation updates changed generated schema descriptions for deprecated eof payloads. The pre-push hook rejects drift, so this records the regenerated engine and service OpenAPI artifacts alongside the slide/protocol update already on the branch.
Constraint: Repo pre-push hook requires generated OpenAPI files to match current source annotations
Rejected: Push docs/protocol changes without regenerating specs | hook blocks on generated drift
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Any protocol description or schema metadata change that feeds OpenAPI should be followed immediately by ./scripts/generate-openapi.sh
Tested: Ran ./scripts/generate-openapi.sh and inspected generated engine/service OpenAPI diffs
Not-tested: Full downstream client compatibility beyond generated type refresh
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
* docs(slides): refine knowledge-transfer deck and add styles
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
* update slides
* fix(demo): align write-to-postgres with protocol message format
Records must be nested as `{"type":"record","record":{...}}` per the
RecordMessage schema, and the catalog needs `newer_than_field` with a
matching timestamp in record data for destination-postgres upserts.
Also adds dummy-source demo scripts and reorders KT slides.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
* Polish the KT deck so the presentation reads cleanly live
This pass simplifies the opening slide, tightens the webhook and subdivision explanations, and adjusts layout choices so the deck behaves better in Slidev during an actual presentation rather than just reading well in source form.
Constraint: Slides need to fit the live Slidev rendering model, not just look correct in markdown
Rejected: Leave the slide structure as-is and rely on browser refreshes | rendering/layout issues were slide-source problems, not just stale client state
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep presentation changes grouped and verify them in the running Slidev preview before committing
Tested: Rebuilt Slidev deck in Docker repeatedly and verified preview responses on localhost:3030
Not-tested: Remote browser rendering differences beyond the local preview
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: codex <noreply@openai.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
Committed-By-Agent: claude # Conflicts: # apps/engine/package.json # apps/engine/src/__generated__/openapi.d.ts # apps/engine/src/__generated__/openapi.json # apps/engine/src/lib/default-connectors.ts # apps/service/src/__generated__/openapi.d.ts # apps/service/src/__generated__/openapi.json # pnpm-lock.yaml # scripts/generate-openapi-specs.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
Committed-By-Agent: claude # Conflicts: # apps/service/package.json # apps/service/src/cli.ts # pnpm-lock.yaml
Agent-Logs-Url: https://github.com/stripe/sync-engine-fork/sessions/d8060c2c-88ae-4640-a52d-32725abe1127 Co-authored-by: mattmueller-stripe <131693246+mattmueller-stripe@users.noreply.github.com>
|
|
1 similar comment
|
|
There was a problem hiding this comment.
Pull request overview
This pull request makes the Stripe source explicitly treat the Climate Orders “account not eligible” API response as a permanent/skippable error, and adds a focused unit test to prevent regressions.
Changes:
- Added the Climate Orders error message pattern to
SKIPPABLE_ERROR_MESSAGES. - Added a new
isSkippableErrorunit test case for aclimate_ordererror message.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/source-stripe/src/src-list-api.ts | Adds a Climate Orders-specific skippable error substring to the permanent-error skip list. |
| packages/source-stripe/src/src-list-api.test.ts | Adds a targeted isSkippableError test case covering the Climate Orders error message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // climate_order, climate_product | ||
| // "This account is not eligible for Climate Orders. [GET /v1/climate/orders (400)]" | ||
| // "This account is not eligible for Climate Orders. [GET /v1/climate/products (400)]" | ||
| 'This account is not eligible for Climate Orders.', |
| [ | ||
| 'climate_order', | ||
| 'This account is not eligible for Climate Orders. [GET /v1/climate/orders (400)]', | ||
| true, | ||
| ], |
Summary
This addresses the unresolved PR review comment requesting dedicated
isSkippableErrorcoverage for the Climate Orders permanent error.The change adds the missing skip pattern and a focused unit test so this behavior is explicit and regression-protected.
SKIPPABLE_ERROR_MESSAGESinpackages/source-stripe/src/src-list-api.ts.climate_ordercase topackages/source-stripe/src/src-list-api.test.tsassertingisSkippableError(...) === truefor the Climate Orders API error shape.How to test (optional)
pnpm --filter @stripe/sync-source-stripe test -- src-list-api.test.tsRelated