-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
surferIssues related to the surfer project (https://github.com/googleapis/librarian/issues/2375)Issues related to the surfer project (https://github.com/googleapis/librarian/issues/2375)
Milestone
Description
Currently, casing transformations (e.g., strcase.ToKebab, strcase.ToSnake) are performed at the last minute within the builder logic. This can lead to inconsistencies and makes the logic harder to trace.
Context & Rationale
- Maintainability: Scattered casing logic is fragile. If a naming convention changes, it must be updated in multiple places.
- Precedent: Reviewers noted this was a "mistake made in gen_sfc" and should be avoided by abstracting casing into the model.
- Sidekick vs Surfer: We need to determine if these transformations belong in the core
sidekick/apimodel (affecting all generators) or a Surfer-specific internal model.
Implementation Considerations
- Evaluate if
api.Fieldshould expose aKebabNameorSnakeNameproperty. - If modifying
sidekickis not desired, ensure the Surfer internal model (see issue refactor(internal/python): replace command mocks and add GitHub action #3365) handles these transformations during the mapping phase. - Audit all calls to
strcaseininternal/surfer/gcloud/builder.go.
Proposed Solution
- Research the impact of adding gcloud-specific naming properties to the
sidekickAPI model. - Alternatively, implement a transformation layer in Surfer that populates an internal model with pre-cased names.
Relevant files
internal/surfer/gcloud/builder.gointernal/sidekick/api/model.go
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
surferIssues related to the surfer project (https://github.com/googleapis/librarian/issues/2375)Issues related to the surfer project (https://github.com/googleapis/librarian/issues/2375)