Skip to content

Add DynamoStreamHandler (v8.1.0) - #63

Merged
mckalexee merged 3 commits into
mainfrom
dynamo-stream-handler
Jun 6, 2026
Merged

Add DynamoStreamHandler (v8.1.0)#63
mckalexee merged 3 commits into
mainfrom
dynamo-stream-handler

Conversation

@mckalexee

Copy link
Copy Markdown
Contributor

Summary

Adds a sixth handler type, DynamoStreamHandler, for processing DynamoDB streams, and sets up release infrastructure (CHANGELOG + GitHub Release step). Releases v8.1.0.

DynamoStreamHandler

  • New handler factory in handlers/dynamo-stream-handler.ts. Records pass through raw (images stay in DynamoDB AttributeValue form — no unmarshalling, no new dependency). Return a retry list to report failed records; the wrapper maps each to its SequenceNumber for partial batch response. A thrown error fails the whole batch.
  • Stream retries are checkpoint-based (Lambda rewinds to the earliest failure), so handlers must be idempotent — documented in the factory and README.
  • ServiceDynamoStreamFunction wires a DynamoEventSource with startingPosition (default TRIM_HORIZON), batchSize, maxBatchingWindow, retryAttempts, bisectBatchOnError, parallelizationFactor, maxRecordAge, and reportBatchItemFailures: true.
  • The source table is referenced by name via a new tables map on LambdaService, mirroring the existing eventBuses pattern. Handler authors write only a string tableName; the ITable is supplied where the service is created.

Out of scope (deliberately): image unmarshalling, onFailure DLQ destination, and filterCriteria.

Release infrastructure

  • New CHANGELOG.md (Keep a Changelog format), seeded with 8.1.0 and 8.0.1.
  • publish.yml now creates a GitHub Release from the matching CHANGELOG section (contents: write), and bumps actions/checkout / actions/setup-node v4 → v6.
  • New "Releasing" section in CLAUDE.md documenting the cut-a-release process.

Tests

  • Unit tests for the handler wrapper (success / void / partial {retry} mapping / throw-fails-batch).
  • Extract test asserts the new dynamoStream bucket.
  • Infra test asserts the EventSourceMapping has StartingPosition: TRIM_HORIZON and FunctionResponseTypes: [ReportBatchItemFailures]; snapshot updated for the one new Lambda.
  • npm run build clean, all 39 tests pass.

Releasing after merge

Tag the merge commit: git tag v8.1.0 && git push origin v8.1.0 → publishes to npm (latest) and creates the GitHub Release.

Adds a sixth handler type, DynamoStreamHandler, for processing DynamoDB
streams. Records pass through raw (images stay in AttributeValue form);
handlers return a `retry` list to report failed records via partial batch
response. The source table is referenced by name through a new `tables`
map on LambdaService, mirroring the existing eventBuses pattern.

Also sets up release infrastructure: a CHANGELOG.md, a GitHub Release step
in the publish workflow (notes lifted from the matching CHANGELOG section),
and a "Releasing" section in CLAUDE.md. Bumps version to 8.1.0.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Test Results

 1 files  ±0  11 suites  +2   16s ⏱️ +6s
38 tests +5  38 ✅ +5  0 💤 ±0  0 ❌ ±0 
39 runs  +5  39 ✅ +5  0 💤 ±0  0 ❌ ±0 

Results for commit e4e9bf2. ± Comparison against base commit 770f863.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Test Results

 1 files  ±0  11 suites  +2   19s ⏱️ +9s
40 tests +7  40 ✅ +7  0 💤 ±0  0 ❌ ±0 
41 runs  +7  41 ✅ +7  0 💤 ±0  0 ❌ ±0 

Results for commit 7513b13. ± Comparison against base commit 770f863.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.77%. Comparing base (770f863) to head (7513b13).

Files with missing lines Patch % Lines
constructs/service-dynamo-stream-function.ts 77.77% 2 Missing and 2 partials ⚠️
constructs/lambda-service.ts 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
+ Coverage   83.14%   83.77%   +0.62%     
==========================================
  Files          24       26       +2     
  Lines         623      678      +55     
  Branches      148      161      +13     
==========================================
+ Hits          518      568      +50     
- Misses        103      106       +3     
- Partials        2        4       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mckalexee added 2 commits June 5, 2026 23:23
…notes

- DynamoStreamHandler: if a record returned for retry has no sequence
  number, fail the whole batch instead of silently dropping it (reporting
  a subset could checkpoint Lambda past the unreported record).
- publish.yml: extract release notes before publishing so a stable release
  with no CHANGELOG section aborts before npm publish; prereleases without a
  section get a generic body instead of failing the workflow.
- lambda-service: comment explaining the table lookup is key-only by design.
- Tests for the missing-sequence-number guard and the missing-table error.
@mckalexee
mckalexee merged commit 413b63a into main Jun 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant