Skip to content

refactor(internal/surfer/gcloud): move declarative YAML schema to its own package#5474

Open
julieqiu wants to merge 1 commit intogoogleapis:mainfrom
julieqiu:gcloud-declarative-package
Open

refactor(internal/surfer/gcloud): move declarative YAML schema to its own package#5474
julieqiu wants to merge 1 commit intogoogleapis:mainfrom
julieqiu:gcloud-declarative-package

Conversation

@julieqiu
Copy link
Copy Markdown
Member

@julieqiu julieqiu commented Apr 20, 2026

Move structs for the declarative YAML to its own package. Pure code in motion.

Generate documentation for the schema using go generate and the config_doc_generate tool.

…o new package

The yaml-tagged structs that command_writer.go marshals into the gcloud
declarative YAML format are moved out into a new declarative package and
exported. The declarative YAML format is a distinct schema from the
gcloud package's domain types (Command, Argument, etc.), and giving it a
named package separates the schema concept from the writer that uses it.

Naming the schema as a first-class package also allows it to be
documented by the existing config_doc_generate tool, which walks every
struct in a package; left mixed in with the domain types in the gcloud
package, the schema could not be documented in isolation.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the gcloud declarative YAML schema by moving internal struct definitions from command_writer.go to a new dedicated package, internal/surfer/gcloud/declarative. It also introduces an automated documentation generation process using go generate, resulting in the new gcloud-declarative-schema.md file. Feedback was provided regarding missing doc comments on exported fields within the new package; these comments are required by the repository's style guide and are necessary for the documentation tool to correctly populate field descriptions.

Comment thread internal/surfer/gcloud/declarative/declarative.go
@julieqiu julieqiu marked this pull request as ready for review April 20, 2026 02:40
@julieqiu julieqiu requested review from a team as code owners April 20, 2026 02:40
@julieqiu julieqiu enabled auto-merge (squash) April 20, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant