Skip to content

gcp: an upstream type that shares a short name renames a type users already import #5549

Closed

Description

@lex00

The gcp naming rule keeps a bare name only for types in priorityNames (lexicons/gcp/src/codegen/naming.ts). When upstream adds a CRD whose short name an existing type has, both become <Service><Name>, so the existing type is renamed.

The upgrade to Config Connector v1.161.0 (#5512) renames 21 resources and their 76 property types this way, for example Note to ContaineranalysisNote because GrafeasNote arrived, and Schema to PubSubSchema. Every later upstream collision will rename something a user imports.

To decide: whether a name, once published, is kept (the surface snapshot could be the record of which type holds each bare name, so only the newcomer is prefixed), and whether a breaking lexicon upgrade ships with a note listing its renames. Nothing in chant, behold, terragucci, plywood or sql-yodeler uses the 21 renamed names today.

Activity

  1. added
    area:gcp
    design
    epic:ci-hardening
    on Nov 23, 2026
  2. lex00 commented on Nov 23, 2026

    @lex00
    ContributorAuthor

    Decided 2026-11-22: published names stay stable. A type keeps the name it shipped with, and only the newcomer that shares its short name is prefixed. A breaking lexicon upgrade ships with a note that lists its renames and removals.

  3. added
    bug
    and removed
    design
    on Nov 23, 2026
  4. lex00 commented on Nov 23, 2026

    @lex00
    ContributorAuthor

    Branch fix/gcp-stable-names makes gcp generation pass its committed surface.snapshot.json to core's reservedNames (added for #1459). Each published name stays with its resource type, and property type names follow because they are <Resource>_<Def>. A type with no published name gets the name the current rule gives it over the whole input. Without that step, a lone newcomer whose short name is shared only by published types would take the bare name: GCP::Transcoder::Job would become Job beside BQJob and DataflowJob. With no snapshot, or a caller-supplied schema set, naming is unchanged.

    I checked this offline against main's snapshot and the v1.161.0 type list from #5512. All 22 published names that #5512 renames stay bare (AistreamsCluster is a real removal). Every new type gets the same name #5512 gives it, no two types share a name, and a second run over the updated snapshot names everything the same.

    Other lexicons:

    • The algorithm is core's NamingStrategy (packages/core/src/codegen/naming.ts). aws and cpln already reserve published names from their snapshots. Both still have the newcomer gap above, because core leaves reserved types out of the short-name contest. This branch fixes that gap in gcp only.
    • azure, k8s, github, gitlab and fly use core's naming without reservedNames, and each has a surface.snapshot.json. An upstream type that shares a short name with an existing type can rename the existing type in any of them. azure and k8s are the likeliest, since their upstream adds types often.

    When #5512 is regenerated after this lands, the generator has to read main's snapshot, not the branch's. The branch's snapshot already records the renamed names, and reading it would keep them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:gcpbreakingbugepic:ci-hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions