Commit bf20f1c
authored
chore(librarian): update configure_state_yaml.py to avoid duplicate entries (#14452)
This PR resolves the issue where duplicate values for `id` could be
added to `state.yaml`. When duplicate entries exist in `state.yaml`
librarian seems to provide an empty `generate-request.json` which leads
to the following error (see
googleapis/librarian#2186):
```
Traceback (most recent call last):
File "/app/./cli.py", line 261, in handle_generate
request_data = _read_json_file(f"{librarian}/{GENERATE_REQUEST_FILE}")
File "/app/./cli.py", line 100, in _read_json_file
return json.load(f)
File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 31 column 2 (char 755)
```
See output below for `google-cloud-dlp` and `google-cloud-eventarc`
which already exist in `.librarian/state.yaml`
```
partheniou@partheniou-vm-3:~/git/google-cloud-python/scripts/configure_state_yaml$ python3 configure_state_yaml.py
Skipping package 'google-cloud-dlp' as it already exists in state.yaml.
Skipping package 'google-cloud-eventarc' as it already exists in state.yaml.
```1 parent c9e1b8d commit bf20f1c
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
0 commit comments