CCM-17379: Persist supplier config#582
Open
stevebux wants to merge 2 commits into
Open
Conversation
02c123c to
5db0da2
Compare
There was a problem hiding this comment.
Pull request overview
Adds an event-ingestion path to persist supplier-configuration events into the Supplier Configuration DynamoDB table, by introducing a new supplier-config-ingress Lambda triggered from an EventSub SNS → SQS subscription, and extending the internal datastore with an upsert API.
Changes:
- Introduces
lambdas/supplier-config-ingressto consume SQS messages and upsert supplier config entities, emitting EMF metrics. - Extends
@internal/datastorewithSupplierConfigEntitytyping andupsertSupplierConfig()plus associated tests. - Adds Terraform resources for the new SQS queue, SNS subscription filtering, Lambda module wiring, event source mapping, and alarm targeting.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package-lock.json | Adds workspace deps for the new supplier-config-ingress lambda (but currently contains an inconsistent zod resolution). |
| lambdas/supplier-config-ingress/tsconfig.json | TypeScript config for the new lambda package. |
| lambdas/supplier-config-ingress/src/index.ts | Exposes the Lambda handler entrypoint. |
| lambdas/supplier-config-ingress/src/handler/supplier-config-ingress-handler.ts | Implements SQS batch processing, schema validation, upsert calls, and EMF metric emission. |
| lambdas/supplier-config-ingress/src/config/env.ts | Defines required env vars for the lambda. |
| lambdas/supplier-config-ingress/src/config/deps.ts | Wires logger + DynamoDB document client + repository dependencies. |
| lambdas/supplier-config-ingress/src/tests/supplier-config-ingress-handler.test.ts | Unit tests for record parsing, failure reporting, and metrics emission. |
| lambdas/supplier-config-ingress/package.json | New lambda workspace package definition and scripts. |
| lambdas/supplier-config-ingress/jest.config.ts | Jest config aligned with other lambdas. |
| lambdas/supplier-config-ingress/.gitignore | Ignores build/test artifacts for the new lambda. |
| lambdas/supplier-allocator/src/handler/tests/allocate-handler.test.ts | Cleans up unused repo mocks in tests. |
| internal/datastore/src/types.ts | Adds SupplierConfigEntity enum/type for supplier-config entities. |
| internal/datastore/src/supplier-config-repository.ts | Adds upsertSupplierConfig() and helper update-expression builders. |
| internal/datastore/src/test/supplier-config-repository.test.ts | Refactors and expands repository tests; adds upsert coverage across entities. |
| infrastructure/terraform/components/api/sns_topic_subscription_eventsub_sqs_supplier_config.tf | Creates SNS→SQS subscription with message-body filter for supplier-config events. |
| infrastructure/terraform/components/api/README.md | Documents the new SQS/Lambda modules in the component README. |
| infrastructure/terraform/components/api/module_sqs_supplier_config.tf | Provisions new supplier-config SQS queue (+ DLQ) and SNS send policy. |
| infrastructure/terraform/components/api/module_lambda_supplier_config_ingress.tf | Provisions new lambda and IAM permissions for SQS read + DynamoDB update. |
| infrastructure/terraform/components/api/locals_alarms.tf | Registers new lambda + SQS queue for the alarms modules. |
| infrastructure/terraform/components/api/lambda_event_source_mapping_supplier_config_ingress.tf | Connects SQS queue to lambda with partial batch failure reporting enabled. |
| .github/scripts/dispatch_internal_repo_workflow.sh | Fixes a bash conditional syntax error. |
99fe0d7 to
e8b19d2
Compare
d4457f8 to
89ea5d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Context
Type of changes
Checklist
DT3-Specific Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.