refactor(internal/surfer/gcloud): move declarative YAML schema to its own package#5474
Open
julieqiu wants to merge 1 commit intogoogleapis:mainfrom
Open
refactor(internal/surfer/gcloud): move declarative YAML schema to its own package#5474julieqiu wants to merge 1 commit intogoogleapis:mainfrom
julieqiu wants to merge 1 commit intogoogleapis:mainfrom
Conversation
…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.
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.