sfc-gh-skarlapudi opened a new pull request, #11787:
URL: https://github.com/apache/nifi/pull/11787
## Summary
Follow-up to NIFI-16242 (#11581). That fix backfills missing
required-with-default
Connector properties, but only inside
`migrateProperties`/`inheritConfiguration` — the
native flow-sync path (NAR upgrade, first load).
`ConnectorNode.replaceWorkingConfiguration`,
the only call site a configured `ConnectorConfigurationProvider` uses to
push its own
view of a Connector's working configuration, bypasses that backfill
entirely. Its own
comment states the provider's view is authoritative and any property absent
from it is
removed from the step.
So a provider-sourced configuration that predates a required-with-default
property
(e.g. a stored `config.json` written before the property existed) drops it
on every
single reconciliation with the provider, not just once on upgrade — the
connector comes
up invalid with `"<property> is required"`, exactly the symptom NIFI-16242
fixed, just
reached through a different, recurring path instead of a one-time migration.
We hit this
in production: a customer managing 100+ connectors via an external
configuration-provider
integration had their automation break on a release that added a new
required-with-default
property, because their stored configuration predated it.
## Changes
- Extracts the per-step backfill logic already used by
`applyMissingRequiredPropertyDefaults`
into a shared helper,
`applyMissingRequiredPropertyDefaults(ConfigurationStep, Map)`.
- Calls it from `replaceWorkingConfiguration` before the replace is applied,
so a
required-with-default property is never left genuinely absent regardless
of which path
wrote the configuration.
- Optional properties are intentionally excluded, matching the existing
guard in
`applyMissingRequiredPropertyDefaults` — backfilling an optional default
could
spuriously satisfy another property's `dependsOn` condition.
- Adds two tests mirroring the existing `inheritConfiguration` coverage,
applied to this
new call site: one confirming the backfill fires through
`replaceWorkingConfiguration`
(using a `"Table Storage Format"`-shaped property, matching the real-world
case), one
confirming an optional property's default is still not inserted.
## Test plan
- [x] `mvn test -Dtest=TestStandardConnectorNode` in `nifi-framework-core`:
67/67 passing,
including the two new tests.
- [x] Verified the new test fails without the `replaceWorkingConfiguration`
change (reverted
locally, re-ran, confirmed the "is required"-shaped failure) and
passes with it restored.
- [ ] End-to-end reproduction against a real
`ConnectorConfigurationProvider` integration is
in progress; will update this PR with results.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]