Skip to content

Commit 4542339

Browse files
authored
fix: add parsing of sidekick.toml package ignore field to migrate-sidekick (#3171)
Including ignore field in parsing of sidekick.toml package field, and store in librarian.yaml file. This will be set as part of the migrate-sidekick command. Fixes: #3129 Output: ``` - name: google-cloud-location channels: - path: google/cloud/location service_config: google/cloud/location/cloud.yaml version: 1.1.0 copyright_year: "2024" rust: package_dependencies: - name: location ignore: true package: "" ```
1 parent ce2b90c commit 4542339

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

devtools/cmd/migrate-sidekick/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ func parsePackageDependency(name, spec string) *config.RustPackageDependency {
196196
dep.UsedIf = value
197197
case "feature":
198198
dep.Feature = value
199+
case "ignore":
200+
dep.Ignore = value == "true"
199201
}
200202
}
201203

devtools/cmd/migrate-sidekick/main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ func TestReadSidekickFiles(t *testing.T) {
209209
Name: "lazy_static",
210210
Package: "lazy_static",
211211
UsedIf: "services",
212+
Ignore: true,
212213
},
213214
},
214215
},

devtools/cmd/migrate-sidekick/testdata/read-sidekick-files/success-read/.sidekick.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ item-field = 'items'
99
[codec]
1010
version = '1.2.0'
1111
copyright-year = '2025'
12-
'package:lazy_static' = 'used-if=services,package=lazy_static,force-used=true'
12+
'package:lazy_static' = 'used-if=services,package=lazy_static,force-used=true,ignore=true'
1313
'package:gaxi' = 'used-if=services,package=google-cloud-gax-internal,feature=_internal-http-client,source=internal'
1414

1515

0 commit comments

Comments
 (0)