Skip to content

provider-generator: deterministic dedupe strategy for provider-function name collisions (replace hard-fail) #340

Description

@so0k

Context

Follow-up from PR #296 review (jsteinich). The generator currently hard-fails with an actionable error when provider-function names collide after sanitization: two functions to one method name, a function landing on a reserved wrapper member (constructor, providerLocalName), two parameters to one identifier, or a provider config attribute colliding with the generated functions getter. The reviewer accepted this "to start with" but flagged it as a long-term support risk: a provider release introducing a collision turns into a deterministic cdktn get / prebuilt-regeneration failure.

Evidence the risk is currently theoretical: the RFC-04 collision sweep (cdktn-planning branch rfc04/collision-sweep) ran the exact compiled sanitizers against all 29 catalog providers + Grafana + MongoDB Atlas — 31/31 clean.

Scope

  • Design a deterministic dedupe (e.g. suffix rules with emitted diagnostics, mirroring uniqueClassName's approach but loudly) to replace the hard-fail so a colliding upstream release degrades to a discoverable rename instead of a generation failure.
  • Evaluate adopting jsii's per-language reserved-word lists proactively in the generator-side table (jsii currently handles these at compile time behind --silence-warnings reserved-word).
  • Wire the collision sweep into the drift-check story (In-repo consistency check for the provider-feature availability matrix and its hand-maintained maps #309) so a colliding provider release is caught before it breaks users.

Relations: #296, #309, cdktn-planning rfc04/collision-sweep.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions