1.4 KiB
1.4 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 83e29321-7215-47a1-813e-a73187bda39f | insight | ESB getter boilerplate: ~120-140 lines shared across getters, future extraction candidate |
|
0.55 | 0.8 | 2026-02-26T18:57:36.520923+00:00 | 2026-02-26T18:58:15.151987+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.