Skip to content

Commit 488ffae

Browse files
authored
refactor(surfer): merge gcloud packages (#2833)
Merge `internal/surfer/gcloudyaml` and `internal/surfer/gcloud` into a single `internal/surfer/gcloud` package to consolidate gcloud logic into one location. Remove `gcloudyaml.Config` from the sidekick config, since we plan to make surfer its own CLI tool. For #2375
1 parent a138f6a commit 488ffae

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

internal/sidekick/config/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"path"
2424

2525
"github.com/googleapis/librarian/internal/sidekick/license"
26-
"github.com/googleapis/librarian/internal/surfer/gcloudyaml"
2726
toml "github.com/pelletier/go-toml/v2"
2827
)
2928

@@ -61,10 +60,6 @@ type Config struct {
6160
CommentOverrides []DocumentationOverride `toml:"documentation-overrides,omitempty"`
6261
PaginationOverrides []PaginationOverride `toml:"pagination-overrides,omitempty"`
6362
Release *Release `toml:"release,omitempty"`
64-
65-
// Gcloud is used to pass data into gcloud.Generate. It does not use the
66-
// normal .sidekick.toml file, but instead reads a gcloud.yaml file.
67-
Gcloud *gcloudyaml.Config
6863
}
6964

7065
// GeneralConfig contains configuration parameters that affect Parsers and Codecs, including the

internal/surfer/gcloud/command.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Package gcloud provides utilities for generating gcloud command configurations and related types.
1615
package gcloud
1716

18-
import "github.com/googleapis/librarian/internal/surfer/gcloudyaml"
19-
2017
// Command is a single gcloud command.
2118
type Command struct {
22-
ReleaseTracks []gcloudyaml.ReleaseTrack `yaml:"release_tracks,omitempty"`
23-
Autogenerated bool `yaml:"auto_generated,omitempty"`
24-
Hidden bool `yaml:"hidden,omitempty"`
25-
HelpText *CommandHelpText `yaml:"help_text,omitempty"`
26-
Arguments *Arguments `yaml:"arguments,omitempty"`
27-
Request *Request `yaml:"request,omitempty"`
28-
Response *Response `yaml:"response,omitempty"`
29-
Async *Async `yaml:"async,omitempty"`
19+
ReleaseTracks []ReleaseTrack `yaml:"release_tracks,omitempty"`
20+
Autogenerated bool `yaml:"auto_generated,omitempty"`
21+
Hidden bool `yaml:"hidden,omitempty"`
22+
HelpText *CommandHelpText `yaml:"help_text,omitempty"`
23+
Arguments *Arguments `yaml:"arguments,omitempty"`
24+
Request *Request `yaml:"request,omitempty"`
25+
Response *Response `yaml:"response,omitempty"`
26+
Async *Async `yaml:"async,omitempty"`
3027
}
3128

3229
// Arguments are the arguments for a gcloud command.

internal/surfer/gcloudyaml/gcloud.go renamed to internal/surfer/gcloud/config.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Package gcloudyaml provides Go type definitions for parsing and representing
16-
// Google Cloud CLI (gcloud) configuration files.
17-
package gcloudyaml
15+
// Package gcloud generates gcloud command YAML files.
16+
package gcloud
1817

1918
// Config represents the top-level schema of a gcloud config YAML file.
2019
type Config struct {

internal/surfer/gcloudyaml/gcloud_test.go renamed to internal/surfer/gcloud/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package gcloudyaml
15+
package gcloud
1616

1717
import (
1818
"bytes"

0 commit comments

Comments
 (0)