mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 14:30:28 -05:00
* fix(pipes): apply an enrichment on a DynamoDB stream source and deliver its events as AWS does A pipe with a DynamoDB stream source, a Lambda enrichment and an event bus target put nothing on the bus a rule could use: the stream path skipped the enrichment, an array answer reached the target as one payload, Source and DetailType written as JSON paths went out as the literal text, and a template of one placeholder naming a string put that string on the bus in quotes. - The stream path runs the enrichment through the SQS path's step, once per filtered batch. Disposal stays each source's: SQS deletes its messages, a stream commits its position. - An array answer reaches an event bus, SQS queue or SNS topic one element at a time. A Lambda or a state machine takes it whole. EventBridge User Guide, "Amazon EventBridge Pipes batching and concurrency": "Input transformers are applied separately on each individual JSON record in the array", and a target with no batch API, "such as Lambda and Step Functions", gets "the entire JSON array". https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-batching-concurrency.html - An event bus target's Source and DetailType, written as a JSON path, are read off the event before the template renders. "Amazon EventBridge Pipes event bus target": they "support dynamic JSON path syntax" and "can't reference new or transformed values resulting from input transformation". A path naming nothing fails the delivery, so no event reaches a rule under a literal or empty type. https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-target.html - A template of exactly one placeholder renders a string verbatim, which is what AWS does with <$.Detail> naming a serialized object; quotes added here made PutEvents refuse it as MalformedDetail. A placeholder inside a larger template renders as before. Kinesis and Kafka sources still deliver straight to the target, as docs/services/pipes.md says. Test: PipesStreamEnrichmentDockerIntegrationTest runs a real function behind a table's stream, with a filter, and a rule on the bus matching a field of the detail reaches a queue. Without the fix it times out with no event on the queue. PipesPollerTest and PipesTargetInvokerTest pin each rule. * fix(pipes): fail an enrichment batch past the target's limit, and share the dynamic parameter resolver An enrichment answering more than 10 events for an event bus, queue or topic fails the batch without invoking the target, as AWS does, since 10 is what those targets take in one request; the batch goes to the dead-letter queue or is read again. The event bus Source and DetailType resolve through the same method as a Redshift parameter, so a value counts as a path only when the whole of it is one. pollSqs deletes a delivered batch's messages in one place, and the Docker test uses SqsTestQueue and DynamoDbRequests. * fix(pipes): deliver an enrichment array to Redshift whole, and skip the target on an empty string Redshift has no batch API, so an enrichment's array reaches it in one BatchExecuteStatement as before; only an event bus, queue or topic takes one event per element under the limit of 10. An enrichment Lambda answering "" is an empty response, as AWS lists it, and invokes no target.