Skip to content

Commit

Permalink
chore: fix v2 beta edge case (#6698)
Browse files Browse the repository at this point in the history
- There was a bug in the code used to generate the mappings files
where the location for type found in v2 libraries were placed in
the correct directory.
- start generating betas of old client in v2 modules.
- Flipped these "new" libs to migrated since they have not been generated in v2 before

Changes:

feat(recaptchaenterprise/v2): start generating apiv1beta1

feat(vision/v2): start generating apiv1p1beta1
  • Loading branch information
codyoss committed Sep 20, 2022
1 parent 1b56cd0 commit 4aa2f48
Show file tree
Hide file tree
Showing 19 changed files with 8,358 additions and 31 deletions.
32 changes: 16 additions & 16 deletions internal/.repo-metadata-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -1340,22 +1340,22 @@
"release_level": "ga",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/recaptchaenterprise/apiv1beta1": {
"distribution_name": "cloud.google.com/go/recaptchaenterprise/apiv1beta1",
"cloud.google.com/go/recaptchaenterprise/v2/apiv1": {
"distribution_name": "cloud.google.com/go/recaptchaenterprise/v2/apiv1",
"description": "reCAPTCHA Enterprise API",
"language": "Go",
"client_library_type": "generated",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/recaptchaenterprise/latest/apiv1beta1",
"release_level": "beta",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/recaptchaenterprise/v2/latest/apiv1",
"release_level": "ga",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/recaptchaenterprise/v2/apiv1": {
"distribution_name": "cloud.google.com/go/recaptchaenterprise/v2/apiv1",
"cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1": {
"distribution_name": "cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1",
"description": "reCAPTCHA Enterprise API",
"language": "Go",
"client_library_type": "generated",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/recaptchaenterprise/v2/latest/apiv1",
"release_level": "ga",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/recaptchaenterprise/v2/latest/apiv1beta1",
"release_level": "beta",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/recommendationengine/apiv1beta1": {
Expand Down Expand Up @@ -1826,22 +1826,22 @@
"release_level": "beta",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/vision/apiv1p1beta1": {
"distribution_name": "cloud.google.com/go/vision/apiv1p1beta1",
"cloud.google.com/go/vision/v2/apiv1": {
"distribution_name": "cloud.google.com/go/vision/v2/apiv1",
"description": "Cloud Vision API",
"language": "Go",
"client_library_type": "generated",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vision/latest/apiv1p1beta1",
"release_level": "beta",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vision/v2/latest/apiv1",
"release_level": "ga",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/vision/v2/apiv1": {
"distribution_name": "cloud.google.com/go/vision/v2/apiv1",
"cloud.google.com/go/vision/v2/apiv1p1beta1": {
"distribution_name": "cloud.google.com/go/vision/v2/apiv1p1beta1",
"description": "Cloud Vision API",
"language": "Go",
"client_library_type": "generated",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vision/v2/latest/apiv1",
"release_level": "ga",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vision/v2/latest/apiv1p1beta1",
"release_level": "beta",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/vmmigration/apiv1": {
Expand Down
16 changes: 8 additions & 8 deletions internal/aliasfix/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,12 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
Status: StatusNotMigrated,
},
"google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1": {
ImportPath: "cloud.google.com/go/recaptchaenterprise/v2/apiv1/v2pb",
ImportPath: "cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb",
Status: StatusNotMigrated,
},
"google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1": {
ImportPath: "cloud.google.com/go/recaptchaenterprise/apiv1beta1/recaptchaenterprisepb",
Status: StatusInProgress,
ImportPath: "cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1/recaptchaenterprisepb",
Status: StatusMigrated,
},
"google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1": {
ImportPath: "cloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb",
Expand Down Expand Up @@ -659,12 +659,12 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
Status: StatusInProgress,
},
"google.golang.org/genproto/googleapis/cloud/vision/v1": {
ImportPath: "cloud.google.com/go/vision/v2/apiv1/v2pb",
ImportPath: "cloud.google.com/go/vision/v2/apiv1/visionpb",
Status: StatusNotMigrated,
},
"google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1": {
ImportPath: "cloud.google.com/go/vision/apiv1p1beta1/visionpb",
Status: StatusInProgress,
ImportPath: "cloud.google.com/go/vision/v2/apiv1p1beta1/visionpb",
Status: StatusMigrated,
},
"google.golang.org/genproto/googleapis/cloud/vmmigration/v1": {
ImportPath: "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb",
Expand Down Expand Up @@ -723,7 +723,7 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
Status: StatusInProgress,
},
"google.golang.org/genproto/googleapis/devtools/cloudbuild/v1": {
ImportPath: "cloud.google.com/go/cloudbuild/apiv1/v2/apiv1pb",
ImportPath: "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb",
Status: StatusNotMigrated,
},
"google.golang.org/genproto/googleapis/devtools/clouddebugger/v2": {
Expand Down Expand Up @@ -783,7 +783,7 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
Status: StatusNotMigrated,
},
"google.golang.org/genproto/googleapis/monitoring/v3": {
ImportPath: "cloud.google.com/go/monitoring/apiv3/v2/apiv3pb",
ImportPath: "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb",
Status: StatusNotMigrated,
},
"google.golang.org/genproto/googleapis/privacy/dlp/v2": {
Expand Down
4 changes: 2 additions & 2 deletions internal/gapicgen/generator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ var MicrogenGapicConfigs = []*MicrogenConfig{
{
InputDirectoryPath: "google/cloud/recaptchaenterprise/v1beta1",
Pkg: "recaptchaenterprise",
ImportPath: "cloud.google.com/go/recaptchaenterprise/apiv1beta1",
ImportPath: "cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1",
GRPCServiceConfigPath: "recaptchaenterprise_grpc_service_config.json",
ApiServiceConfigPath: "recaptchaenterprise_v1beta1.yaml",
Transports: []string{"grpc", "rest"},
Expand Down Expand Up @@ -775,7 +775,7 @@ var MicrogenGapicConfigs = []*MicrogenConfig{
{
InputDirectoryPath: "google/cloud/vision/v1p1beta1",
Pkg: "vision",
ImportPath: "cloud.google.com/go/vision/apiv1p1beta1",
ImportPath: "cloud.google.com/go/vision/v2/apiv1p1beta1",
GRPCServiceConfigPath: "vision_grpc_service_config.json",
ApiServiceConfigPath: "vision_v1p1beta1.yaml",
Transports: []string{"grpc", "rest"},
Expand Down
12 changes: 7 additions & 5 deletions internal/gapicgen/generator/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ var apivExceptions = map[string]bool{
}

var packagePathExceptions = map[string]bool{
"cloud.google.com/go/longrunning/autogen": true,
"cloud.google.com/go/firestore/apiv1/admin": true,
"cloud.google.com/go/recaptchaenterprise/v2/apiv1": true,
"cloud.google.com/go/storage/internal/apiv2": true,
"cloud.google.com/go/vision/v2/apiv1": true,
"cloud.google.com/go/longrunning/autogen": true,
"cloud.google.com/go/firestore/apiv1/admin": true,
"cloud.google.com/go/recaptchaenterprise/v2/apiv1": true,
"cloud.google.com/go/storage/internal/apiv2": true,
"cloud.google.com/go/vision/v2/apiv1": true,
"cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1": true,
"cloud.google.com/go/vision/v2/apiv1p1beta1": true,
}

// TestMicrogenConfigs validates config entries.
Expand Down
191 changes: 191 additions & 0 deletions recaptchaenterprise/v2/apiv1beta1/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions recaptchaenterprise/v2/apiv1beta1/gapic_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"schema": "1.0",
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
"language": "go",
"protoPackage": "google.cloud.recaptchaenterprise.v1beta1",
"libraryPackage": "cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1",
"services": {
"RecaptchaEnterpriseServiceV1Beta1": {
"clients": {
"grpc": {
"libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client",
"rpcs": {
"AnnotateAssessment": {
"methods": [
"AnnotateAssessment"
]
},
"CreateAssessment": {
"methods": [
"CreateAssessment"
]
}
}
},
"rest": {
"libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client",
"rpcs": {
"AnnotateAssessment": {
"methods": [
"AnnotateAssessment"
]
},
"CreateAssessment": {
"methods": [
"CreateAssessment"
]
}
}
}
}
}
}
}
Loading

0 comments on commit 4aa2f48

Please sign in to comment.