Skip to content

Commit 2a5c165

Browse files
authored
chore: onboard compute to owlbot (#7705)
1 parent 7a9e211 commit 2a5c165

File tree

5 files changed

+13
-29
lines changed

5 files changed

+13
-29
lines changed

.github/.OwlBot.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ deep-remove-regex:
4747
# - /cloudbuild/apiv1/v2/
4848
- /cloudbuild/apiv2/
4949
- /clouddms/apiv1/
50+
- /compute/apiv1
5051
- /contactcenterinsights/apiv1/
5152
- /container/apiv1/
5253
- /containeranalysis/apiv1beta1/
@@ -305,6 +306,8 @@ deep-copy-regex:
305306
dest: /cloudbuild/apiv2
306307
- source: /google/cloud/clouddms/v1/cloud.google.com/go/clouddms/apiv1
307308
dest: /clouddms/apiv1
309+
- source: /google/cloud/compute/v1/cloud.google.com/go/compute/apiv1
310+
dest: /compute/apiv1
308311
- source: /google/cloud/contactcenterinsights/v1/cloud.google.com/go/contactcenterinsights/apiv1
309312
dest: /contactcenterinsights/apiv1
310313
- source: /google/container/v1/cloud.google.com/go/container/apiv1

internal/gapicgen/generator/config.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@ func isMigrated(importPath string) bool {
111111
}
112112

113113
var MicrogenGapicConfigs = []*MicrogenConfig{
114-
// Cloud APIs
115-
{
116-
InputDirectoryPath: "google/cloud/compute/v1",
117-
Pkg: "compute",
118-
ImportPath: "cloud.google.com/go/compute/apiv1",
119-
ApiServiceConfigPath: "compute_v1.yaml",
120-
Transports: []string{"rest"},
121-
ReleaseLevel: "ga",
122-
NumericEnumsDisabled: true,
123-
},
124114
{
125115
InputDirectoryPath: "google/cloud/texttospeech/v1",
126116
stopGeneration: true,

internal/gapicgen/generator/gapics.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,6 @@ func (g *GapicGenerator) microgen(conf *MicrogenConfig) error {
320320
if !conf.NumericEnumsDisabled {
321321
args = append(args, "--go_gapic_opt", "rest-numeric-enums")
322322
}
323-
// This is a bummer way of toggling diregapic generation, but it compute is the only one for the near term.
324-
if conf.Pkg == "compute" {
325-
args = append(args, "--go_gapic_opt", "diregapic")
326-
}
327323
if stubsDir := conf.getStubsDir(); stubsDir != "" {
328324
// Enable protobuf/gRPC generation in the google-cloud-go directory.
329325
args = append(args, "--go_out=plugins=grpc:"+g.googleCloudDir)

internal/gapicgen/generator/genproto.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ var denylist = map[string]bool{
4747
"google.golang.org/genproto/googleapis/cloud/ondemandscanning/v1": true,
4848
}
4949

50-
// noGRPC is the set of APIs that do not need gRPC stubs.
51-
var noGRPC = map[string]bool{
52-
"google.golang.org/genproto/googleapis/cloud/compute/v1": true,
53-
}
54-
5550
// GenprotoGenerator is used to generate code for googleapis/go-genproto.
5651
type GenprotoGenerator struct {
5752
genprotoDir string
@@ -145,14 +140,13 @@ func (g *GenprotoGenerator) Regen(ctx context.Context) error {
145140
if !strings.HasPrefix(pkg, "google.golang.org/genproto") || denylist[pkg] || hasPrefix(pkg, skipPrefixes) {
146141
continue
147142
}
148-
grpc := !noGRPC[pkg]
149143
pk := pkg
150144
fn := fileNames
151145

152146
if !isMigrated(pkg) {
153147
grp.Go(func() error {
154148
log.Println("running protoc on", pk)
155-
return g.protoc(fn, grpc)
149+
return g.protoc(fn)
156150
})
157151
} else {
158152
log.Printf("skipping, %q has been migrated", pkg)
@@ -201,12 +195,14 @@ func goPkg(fileName string) (string, error) {
201195

202196
// protoc executes the "protoc" command on files named in fileNames, and outputs
203197
// to "<genprotoDir>/generated".
204-
func (g *GenprotoGenerator) protoc(fileNames []string, grpc bool) error {
205-
stubs := fmt.Sprintf("--go_out=%s/generated", g.genprotoDir)
206-
if grpc {
207-
stubs = fmt.Sprintf("--go_out=plugins=grpc:%s/generated", g.genprotoDir)
198+
func (g *GenprotoGenerator) protoc(fileNames []string) error {
199+
args := []string{
200+
"--experimental_allow_proto3_optional",
201+
fmt.Sprintf("--go_out=%s/generated", g.genprotoDir),
202+
fmt.Sprintf("--go_out=plugins=grpc:%s/generated", g.genprotoDir),
203+
"-I", g.googleapisDir,
204+
"-I", g.protoSrcDir,
208205
}
209-
args := []string{"--experimental_allow_proto3_optional", stubs, "-I", g.googleapisDir, "-I", g.protoSrcDir}
210206
args = append(args, fileNames...)
211207
c := execv.Command("protoc", args...)
212208
c.Dir = g.genprotoDir

internal/postprocessor/config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ service-configs:
557557
service-config: cloudbuild_v1.yaml
558558
- input-directory: google/devtools/cloudbuild/v2
559559
service-config: cloudbuild_v2.yaml
560+
- input-directory: google/cloud/compute/v1
561+
service-config: compute_v1.yaml
560562
- input-directory: google/devtools/containeranalysis/v1beta1
561563
service-config: containeranalysis_v1beta1.yaml
562564
- input-directory: google/firestore/admin/v1
@@ -635,9 +637,6 @@ service-configs:
635637
- input-directory: google/cloud/tasks/v2beta3
636638
service-config: cloudtasks_v2beta3.yaml
637639
import-path: cloud.google.com/go/cloudtasks/apiv2beta3
638-
- input-directory: google/cloud/compute/v1
639-
service-config: compute_v1.yaml
640-
import-path: cloud.google.com/go/compute/apiv1
641640
- input-directory: google/devtools/containeranalysis/v1beta1/grafeas
642641
service-config: ../containeranalysis_v1beta1.yaml
643642
import-path: cloud.google.com/go/containeranalysis/apiv1beta1

0 commit comments

Comments
 (0)