From 66df2aad415452fc213b0ff30c6b275be4fe1fff Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Thu, 26 Feb 2026 12:57:36 -0600 Subject: [PATCH] store: ESB getter boilerplate: ~120-140 lines shared across getters, future extraction candidate --- ...40-lines-shared-across-getters-f-83e293.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 graph/insights/esb-getter-boilerplate-120-140-lines-shared-across-getters-f-83e293.md diff --git a/graph/insights/esb-getter-boilerplate-120-140-lines-shared-across-getters-f-83e293.md b/graph/insights/esb-getter-boilerplate-120-140-lines-shared-across-getters-f-83e293.md new file mode 100644 index 00000000000..764bd4fcb59 --- /dev/null +++ b/graph/insights/esb-getter-boilerplate-120-140-lines-shared-across-getters-f-83e293.md @@ -0,0 +1,36 @@ +--- +id: 83e29321-7215-47a1-813e-a73187bda39f +type: insight +title: "ESB getter boilerplate: ~120-140 lines shared across getters, future extraction candidate" +tags: [esb-monorepo, getter-pattern, refactoring, technical-debt, insight, code-pattern] +importance: 0.55 +confidence: 0.8 +created: "2026-02-26T18:57:36.520923+00:00" +updated: "2026-02-26T18:57:36.520923+00:00" +--- + +# ESB Getter Boilerplate: Shared Code Pattern + +## Observation +Comparing poolbrain-customers getter (~250 lines) with the upcoming SF-CA getter, approximately 120-140 lines are near-identical boilerplate. + +## Shared Boilerplate Breakdown +| Section | ~Lines | +|---|---| +| GCP client init | 15 | +| createLogger() wrapper | 40 | +| getSecret() | 15 | +| Env var validation | 20 | +| Pub/Sub publishing loop | 20 | +| fromLastModifiedDate parsing | 25 | +| correlationId | 3 | + +## Future Extraction Target +`packages/getter-utils/` with proposed exports: +- `createLogger(logName)` +- `getSecret(secretName, logger)` +- `parsePollerMessage(cloudEvent)` +- `publishRecords(records, opts)` + +## Current Stance +Not abstracting yet — only 2 getters exist. Revisit when SF-CA getter is built and the pattern is confirmed across both implementations. Two data points is the minimum to validate the abstraction boundary.