Skip to content

Commit df6e0a5

Browse files
authored
chore(tool/cmd/migrate): update keep for Go libraries (#4842)
Update keep for Go library bigtable, firestore and pubsub/v2. For #3618
1 parent 95a6828 commit df6e0a5

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

tool/cmd/migrate/go_api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ var (
3030
"auth/oauth2adapt": {"internal/version.go"},
3131
"batch": {"apiv1/iam_policy_client.go"},
3232
"bigquery": {"README.md"},
33+
"bigtable": {"README.md"},
3334
"compute/metadata": {"internal/version.go", "README.md"},
3435
"containeranalysis": {"apiv1beta1/grafeas/grafeaspb/grafeas.pb.go"},
3536
"datacatalog": {"apiv1/iam_policy_client.go"},
3637
"datastream": {"apiv1/iam_policy_client.go"},
38+
"firestore": {"README.md"},
3739
"grafeas": {"internal/version.go", "README.md"},
3840
"profiler": {"internal/version.go", "README.md"},
3941
"pubsub": {"internal/version.go", "README.md"},
42+
"pubsub/v2": {"README.md"},
4043
"root-module": {"internal/version.go", "README.md"},
4144
"run": {"apiv2/locations_client.go"},
4245
"spanner": {"README.md"},

tool/cmd/migrate/legacylibrarian_test.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ func TestBuildGoLibraries(t *testing.T) {
938938
{Path: "google/bigtable/v2"},
939939
{Path: "google/bigtable/admin/v2"},
940940
},
941+
Keep: []string{"README.md"},
941942
Go: &config.GoModule{
942943
GoAPIs: []*config.GoAPI{
943944
{Path: "google/bigtable/admin/v2", NoMetadata: true, ProtoOnly: true},
@@ -1011,6 +1012,48 @@ func TestBuildGoLibraries(t *testing.T) {
10111012
},
10121013
},
10131014
},
1015+
{
1016+
name: "firestore keep",
1017+
input: &MigrationInput{
1018+
librarianState: &legacyconfig.LibrarianState{
1019+
Libraries: []*legacyconfig.LibraryState{
1020+
{
1021+
ID: "firestore",
1022+
},
1023+
},
1024+
},
1025+
librarianConfig: &legacyconfig.LibrarianConfig{},
1026+
repoPath: "testdata/google-cloud-go",
1027+
googleapisDir: "testdata/googleapis",
1028+
},
1029+
want: []*config.Library{
1030+
{
1031+
Name: "firestore",
1032+
Keep: []string{"README.md"},
1033+
},
1034+
},
1035+
},
1036+
{
1037+
name: "pubsub/v2 keep",
1038+
input: &MigrationInput{
1039+
librarianState: &legacyconfig.LibrarianState{
1040+
Libraries: []*legacyconfig.LibraryState{
1041+
{
1042+
ID: "pubsub/v2",
1043+
},
1044+
},
1045+
},
1046+
librarianConfig: &legacyconfig.LibrarianConfig{},
1047+
repoPath: "testdata/google-cloud-go",
1048+
googleapisDir: "testdata/googleapis",
1049+
},
1050+
want: []*config.Library{
1051+
{
1052+
Name: "pubsub/v2",
1053+
Keep: []string{"README.md"},
1054+
},
1055+
},
1056+
},
10141057
} {
10151058
t.Run(test.name, func(t *testing.T) {
10161059
got, err := buildGoLibraries(test.input)

0 commit comments

Comments
 (0)