Skip to content

Commit 4aa2f48

Browse files
authored
chore: fix v2 beta edge case (#6698)
- 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
1 parent 1b56cd0 commit 4aa2f48

19 files changed

+8358
-31
lines changed

internal/.repo-metadata-full.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,22 +1340,22 @@
13401340
"release_level": "ga",
13411341
"library_type": "GAPIC_AUTO"
13421342
},
1343-
"cloud.google.com/go/recaptchaenterprise/apiv1beta1": {
1344-
"distribution_name": "cloud.google.com/go/recaptchaenterprise/apiv1beta1",
1343+
"cloud.google.com/go/recaptchaenterprise/v2/apiv1": {
1344+
"distribution_name": "cloud.google.com/go/recaptchaenterprise/v2/apiv1",
13451345
"description": "reCAPTCHA Enterprise API",
13461346
"language": "Go",
13471347
"client_library_type": "generated",
1348-
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/recaptchaenterprise/latest/apiv1beta1",
1349-
"release_level": "beta",
1348+
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/recaptchaenterprise/v2/latest/apiv1",
1349+
"release_level": "ga",
13501350
"library_type": "GAPIC_AUTO"
13511351
},
1352-
"cloud.google.com/go/recaptchaenterprise/v2/apiv1": {
1353-
"distribution_name": "cloud.google.com/go/recaptchaenterprise/v2/apiv1",
1352+
"cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1": {
1353+
"distribution_name": "cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1",
13541354
"description": "reCAPTCHA Enterprise API",
13551355
"language": "Go",
13561356
"client_library_type": "generated",
1357-
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/recaptchaenterprise/v2/latest/apiv1",
1358-
"release_level": "ga",
1357+
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/recaptchaenterprise/v2/latest/apiv1beta1",
1358+
"release_level": "beta",
13591359
"library_type": "GAPIC_AUTO"
13601360
},
13611361
"cloud.google.com/go/recommendationengine/apiv1beta1": {
@@ -1826,22 +1826,22 @@
18261826
"release_level": "beta",
18271827
"library_type": "GAPIC_AUTO"
18281828
},
1829-
"cloud.google.com/go/vision/apiv1p1beta1": {
1830-
"distribution_name": "cloud.google.com/go/vision/apiv1p1beta1",
1829+
"cloud.google.com/go/vision/v2/apiv1": {
1830+
"distribution_name": "cloud.google.com/go/vision/v2/apiv1",
18311831
"description": "Cloud Vision API",
18321832
"language": "Go",
18331833
"client_library_type": "generated",
1834-
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vision/latest/apiv1p1beta1",
1835-
"release_level": "beta",
1834+
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vision/v2/latest/apiv1",
1835+
"release_level": "ga",
18361836
"library_type": "GAPIC_AUTO"
18371837
},
1838-
"cloud.google.com/go/vision/v2/apiv1": {
1839-
"distribution_name": "cloud.google.com/go/vision/v2/apiv1",
1838+
"cloud.google.com/go/vision/v2/apiv1p1beta1": {
1839+
"distribution_name": "cloud.google.com/go/vision/v2/apiv1p1beta1",
18401840
"description": "Cloud Vision API",
18411841
"language": "Go",
18421842
"client_library_type": "generated",
1843-
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vision/v2/latest/apiv1",
1844-
"release_level": "ga",
1843+
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vision/v2/latest/apiv1p1beta1",
1844+
"release_level": "beta",
18451845
"library_type": "GAPIC_AUTO"
18461846
},
18471847
"cloud.google.com/go/vmmigration/apiv1": {

internal/aliasfix/mappings.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,12 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
487487
Status: StatusNotMigrated,
488488
},
489489
"google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1": {
490-
ImportPath: "cloud.google.com/go/recaptchaenterprise/v2/apiv1/v2pb",
490+
ImportPath: "cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb",
491491
Status: StatusNotMigrated,
492492
},
493493
"google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1": {
494-
ImportPath: "cloud.google.com/go/recaptchaenterprise/apiv1beta1/recaptchaenterprisepb",
495-
Status: StatusInProgress,
494+
ImportPath: "cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1/recaptchaenterprisepb",
495+
Status: StatusMigrated,
496496
},
497497
"google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1": {
498498
ImportPath: "cloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb",
@@ -659,12 +659,12 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
659659
Status: StatusInProgress,
660660
},
661661
"google.golang.org/genproto/googleapis/cloud/vision/v1": {
662-
ImportPath: "cloud.google.com/go/vision/v2/apiv1/v2pb",
662+
ImportPath: "cloud.google.com/go/vision/v2/apiv1/visionpb",
663663
Status: StatusNotMigrated,
664664
},
665665
"google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1": {
666-
ImportPath: "cloud.google.com/go/vision/apiv1p1beta1/visionpb",
667-
Status: StatusInProgress,
666+
ImportPath: "cloud.google.com/go/vision/v2/apiv1p1beta1/visionpb",
667+
Status: StatusMigrated,
668668
},
669669
"google.golang.org/genproto/googleapis/cloud/vmmigration/v1": {
670670
ImportPath: "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb",
@@ -723,7 +723,7 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
723723
Status: StatusInProgress,
724724
},
725725
"google.golang.org/genproto/googleapis/devtools/cloudbuild/v1": {
726-
ImportPath: "cloud.google.com/go/cloudbuild/apiv1/v2/apiv1pb",
726+
ImportPath: "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb",
727727
Status: StatusNotMigrated,
728728
},
729729
"google.golang.org/genproto/googleapis/devtools/clouddebugger/v2": {
@@ -783,7 +783,7 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
783783
Status: StatusNotMigrated,
784784
},
785785
"google.golang.org/genproto/googleapis/monitoring/v3": {
786-
ImportPath: "cloud.google.com/go/monitoring/apiv3/v2/apiv3pb",
786+
ImportPath: "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb",
787787
Status: StatusNotMigrated,
788788
},
789789
"google.golang.org/genproto/googleapis/privacy/dlp/v2": {

internal/gapicgen/generator/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ var MicrogenGapicConfigs = []*MicrogenConfig{
512512
{
513513
InputDirectoryPath: "google/cloud/recaptchaenterprise/v1beta1",
514514
Pkg: "recaptchaenterprise",
515-
ImportPath: "cloud.google.com/go/recaptchaenterprise/apiv1beta1",
515+
ImportPath: "cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1",
516516
GRPCServiceConfigPath: "recaptchaenterprise_grpc_service_config.json",
517517
ApiServiceConfigPath: "recaptchaenterprise_v1beta1.yaml",
518518
Transports: []string{"grpc", "rest"},
@@ -775,7 +775,7 @@ var MicrogenGapicConfigs = []*MicrogenConfig{
775775
{
776776
InputDirectoryPath: "google/cloud/vision/v1p1beta1",
777777
Pkg: "vision",
778-
ImportPath: "cloud.google.com/go/vision/apiv1p1beta1",
778+
ImportPath: "cloud.google.com/go/vision/v2/apiv1p1beta1",
779779
GRPCServiceConfigPath: "vision_grpc_service_config.json",
780780
ApiServiceConfigPath: "vision_v1p1beta1.yaml",
781781
Transports: []string{"grpc", "rest"},

internal/gapicgen/generator/config_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ var apivExceptions = map[string]bool{
3333
}
3434

3535
var packagePathExceptions = map[string]bool{
36-
"cloud.google.com/go/longrunning/autogen": true,
37-
"cloud.google.com/go/firestore/apiv1/admin": true,
38-
"cloud.google.com/go/recaptchaenterprise/v2/apiv1": true,
39-
"cloud.google.com/go/storage/internal/apiv2": true,
40-
"cloud.google.com/go/vision/v2/apiv1": true,
36+
"cloud.google.com/go/longrunning/autogen": true,
37+
"cloud.google.com/go/firestore/apiv1/admin": true,
38+
"cloud.google.com/go/recaptchaenterprise/v2/apiv1": true,
39+
"cloud.google.com/go/storage/internal/apiv2": true,
40+
"cloud.google.com/go/vision/v2/apiv1": true,
41+
"cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1": true,
42+
"cloud.google.com/go/vision/v2/apiv1p1beta1": true,
4143
}
4244

4345
// TestMicrogenConfigs validates config entries.

recaptchaenterprise/v2/apiv1beta1/doc.go

Lines changed: 191 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"schema": "1.0",
3+
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
4+
"language": "go",
5+
"protoPackage": "google.cloud.recaptchaenterprise.v1beta1",
6+
"libraryPackage": "cloud.google.com/go/recaptchaenterprise/v2/apiv1beta1",
7+
"services": {
8+
"RecaptchaEnterpriseServiceV1Beta1": {
9+
"clients": {
10+
"grpc": {
11+
"libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client",
12+
"rpcs": {
13+
"AnnotateAssessment": {
14+
"methods": [
15+
"AnnotateAssessment"
16+
]
17+
},
18+
"CreateAssessment": {
19+
"methods": [
20+
"CreateAssessment"
21+
]
22+
}
23+
}
24+
},
25+
"rest": {
26+
"libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client",
27+
"rpcs": {
28+
"AnnotateAssessment": {
29+
"methods": [
30+
"AnnotateAssessment"
31+
]
32+
},
33+
"CreateAssessment": {
34+
"methods": [
35+
"CreateAssessment"
36+
]
37+
}
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)