Skip to content

fix(common): configmap passthrough in serviceDiscovery/streaming env helpers + streaming knobs - #1772

Merged
guimoreirar merged 1 commit into
mainfrom
fix/lerian-common-sd-streaming-configmap-passthrough
Jul 30, 2026
Merged

fix(common): configmap passthrough in serviceDiscovery/streaming env helpers + streaming knobs#1772
guimoreirar merged 1 commit into
mainfrom
fix/lerian-common-sd-streaming-configmap-passthrough

Conversation

@guimoreirar

Copy link
Copy Markdown
Member

What

Adds an optional configmap param to lerian-common.serviceDiscovery.env and lerian-common.streaming.env so consumers can honor legacy flat configmap.SD_* / configmap.STREAMING_* server keys (each resolves configmap.<KEY>global.streaming/serviceDiscovery.<field> → default), mirroring what multiTenant.env already does. Also adds the streaming knobs the apps read: STREAMING_COMPRESSION (lz4), STREAMING_REQUIRED_ACKS (all), STREAMING_BATCH_LINGER_MS (5), STREAMING_IMPORTANT_EMIT_TIMEOUT_MS (5000), STREAMING_SASL_ALLOW_PLAINTEXT (false).

Why

A human review of the midaz productization (#1741) found these two helpers read only global.* and drop the component's legacy configmap.* server config — breaking the documented backward-compat contract for on-prem/client values that use the configmap block (multiTenant.env already handles it). This restores parity and lets midaz + reporter drop their inline streaming-knob duplicates in follow-up PRs.

Backward-compatibility (critical)

The configmap param is optional (defaults to empty dict). Current callers that don't pass it render byte-identical — the ONLY new output for a no-configmap caller is the 5 streaming knobs at their defaults (the intended parity gap-closer). Proven by rendering midaz with the updated lib: SD block unchanged, streaming block gains only the 5 defaulted knobs; and passing configmap.SD_ADDRESS/STREAMING_COMPRESSION correctly wins over global.

Scope

charts/lerian-common only (1-chart-per-PR). No manual version bump (release pipeline auto-bumps). SD timeout/tuning keys (SD_ALLOW_STALE etc.) are emitted by the separate serviceDiscovery.envFlat helper, not this derivation helper, so they are intentionally not added here (the reviewer confirmed their absence is behavior-neutral: empty → unset → same default).

Follow-ups (separate PRs)

midaz (#1741) and reporter pass configmap to their SD/streaming calls + bump the lerian-common pin, and drop their inline streaming-knob emissions.

…ing streaming knobs

serviceDiscovery.env and streaming.env now accept an optional configmap
param and prefer the legacy flat configmap.SD_*/configmap.STREAMING_*
value over the global/derived value, mirroring multiTenant.env. This
honors the flat configmap backward-compat contract for operators not yet
on the derivation model.

streaming.env also emits the producer knobs the apps read but the helper
previously omitted (STREAMING_SASL_ALLOW_PLAINTEXT, STREAMING_COMPRESSION,
STREAMING_REQUIRED_ACKS, STREAMING_BATCH_LINGER_MS,
STREAMING_IMPORTANT_EMIT_TIMEOUT_MS), each resolving configmap > global >
default, so consumers can drop their inline duplicates.

No-configmap callers (midaz #1741, reporter) render byte-identical except
the newly-added streaming knobs at their defaults.
@guimoreirar
guimoreirar requested a review from a team as a code owner July 30, 2026 22:57
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7454ca4e-1be7-4c42-ae48-3f3b8d95af53

📥 Commits

Reviewing files that changed from the base of the PR and between df17798 and b508308.

📒 Files selected for processing (2)
  • charts/lerian-common/templates/_service_discovery.tpl
  • charts/lerian-common/templates/_streaming.tpl

📝 Walkthrough

Walkthrough

The shared Helm helpers now accept optional legacy ConfigMap inputs. Service-discovery values use SD_* overrides, while streaming values use STREAMING_* overrides and emit additional configurable constants.

Changes

Shared template configuration overrides

Layer / File(s) Summary
Service-discovery override precedence
charts/lerian-common/templates/_service_discovery.tpl
The helper documents the optional configmap input and prefers non-empty SD_* values over global or derived service-discovery settings.
Streaming override and constant emission
charts/lerian-common/templates/_streaming.tpl
The helper adds configmap.STREAMING_* precedence, supports additional global streaming fields, and emits compression, acknowledgement, batching, timeout, client ID, and CloudEvents values.

Possibly related PRs

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/lerian-common-sd-streaming-configmap-passthrough

Comment @coderabbitai help to get the list of available commands.

@guimoreirar guimoreirar self-assigned this Jul 30, 2026
@guimoreirar
guimoreirar merged commit 97ab3a2 into main Jul 30, 2026
4 checks passed
@guimoreirar
guimoreirar deleted the fix/lerian-common-sd-streaming-configmap-passthrough branch July 30, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant