Skip to content

Commit bccbeb4

Browse files
authored
chore: polish state.yaml (googleapis#14193)
This PR includes the following changes to `state.yaml` - Rename image from `google-cloud-python-generator:latest` to `python-librarian-generator:latest` - Remove `service_config` since it's unused - Rename `sourcePaths` to `source_roots` - Preserve the following file patterns via `preserve_regex` - .OwlBot.yaml - CHANGELOG.md - docs/CHANGELOG.md - docs/README.rst - samples/README.txt - Update YAML formatting - Remove the entire package directory via `remove_regex` Fixes googleapis/librarian#1514
1 parent 10779be commit bccbeb4

2 files changed

Lines changed: 28 additions & 18 deletions

File tree

.librarian/state.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
image: google-cloud-python-generator:latest
1+
image: python-librarian-generator:latest
22
libraries:
3-
- apis:
3+
- id: google-cloud-language
4+
version: 2.17.2
5+
last_generated_commit: 97a83d76a09a7f6dcab43675c87bdfeb5bcf1cb5
6+
apis:
47
- path: google/cloud/language/v1beta2
5-
service_config: ''
68
- path: google/cloud/language/v2
7-
service_config: ''
89
- path: google/cloud/language/v1
9-
service_config: ''
10-
id: google-cloud-language
11-
last_generated_commit: 97a83d76a09a7f6dcab43675c87bdfeb5bcf1cb5
12-
preserve_regex: []
13-
remove_regex: []
14-
sourcePaths:
15-
- packages/google-cloud-language
16-
version: 2.17.2
10+
source_roots:
11+
- ^packages/google-cloud-language
12+
preserve_regex:
13+
- .OwlBot.yaml
14+
- CHANGELOG.md
15+
- docs/CHANGELOG.md
16+
- docs/README.rst
17+
- samples/README.txt
18+
- tar.gz
19+
remove_regex:
20+
- ^packages/google-cloud-language

scripts/configure_state_yaml/configure_state_yaml.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def configure_state_yaml() -> None:
4444
with open(PACKAGES_TO_ONBOARD_YAML, "r") as packages_to_onboard_yaml_file:
4545
packages_to_onboard = yaml.safe_load(packages_to_onboard_yaml_file)
4646

47-
state_dict["image"] = "google-cloud-python-generator:latest"
47+
state_dict["image"] = "python-librarian-generator:latest"
4848
state_dict["libraries"] = []
4949
for package_name in packages_to_onboard["packages_to_onboard"]:
5050
package_path = Path(PACKAGES_DIR / package_name).resolve()
@@ -56,7 +56,6 @@ def configure_state_yaml() -> None:
5656
[
5757
{
5858
"path": gapic_metadata["protoPackage"].replace(".", "/"),
59-
"service_config": "",
6059
}
6160
]
6261
)
@@ -66,14 +65,21 @@ def configure_state_yaml() -> None:
6665
"version": release_please_manifest[f"packages/{package_name}"],
6766
"last_generated_commit": "97a83d76a09a7f6dcab43675c87bdfeb5bcf1cb5",
6867
"apis": api_paths,
69-
"sourcePaths": [f"packages/{package_name}"],
70-
"preserve_regex": "",
71-
"remove_regex": "",
68+
"source_roots": [f"^packages/{package_path.name}"],
69+
"preserve_regex": [
70+
".OwlBot.yaml",
71+
"CHANGELOG.md",
72+
"docs/CHANGELOG.md",
73+
"docs/README.rst",
74+
"samples/README.txt",
75+
"tar.gz",
76+
],
77+
"remove_regex": [f"^packages/{package_path.name}"],
7278
}
7379
)
7480

7581
with open(LIBRARIAN_YAML, "w") as f:
76-
yaml.dump(state_dict, f)
82+
yaml.dump(state_dict, f, sort_keys=False, indent=2)
7783

7884

7985
if __name__ == "__main__":

0 commit comments

Comments
 (0)